How to set up smartphones and PCs. Informational portal
  • home
  • Mistakes
  • Programs for Java programming and education. Java Development Environments

Programs for Java programming and education. Java Development Environments

Almost all books and tutorials on Java for beginners begin with a description of OOP: how great it is and how great it is. It is clear, since any other programming is simply impossible in Java, except for object-oriented programming, it is first proposed to master 40..80 pages of crazy analogies with the hierarchy of cats / dogs / ducks / cars, and only after that it is proposed to write “Hello, World!” . :-)

At the same time, it is worth noting that absolutely all Java training is based on the most primitive output of the result to the console. That is not console application in the usual sense, namely the output of some data line by line. Well, for example, Turbo Pascal 3.0 was released in 1985 and it already had support for graphics modes. In 1990, Turbo Vision appeared - a very cool thing - a la Windows only for DOS. And in Java in 2018, only output to the console is possible. And now all this enthusiasm and coolness is somehow shattered already at the “Hello, World!” stage ... Probably worse is just having fun on a programmable calculator MK-61 or MK-52 - but what? there is the same line-by-line output.

But, the funniest thing is that in Java you can actually create programs using visual programming! I only found out about this when I read (or rather got acquainted with) a 500-page book, where in one of the last chapters, it suddenly became clear that there are normal GUIs (graphical user interfaces) for Java and you can design programs with buttons, input fields and normal menus . The question is: why did you spend so much time on this lousy console when you could do everything beautifully and neatly at once?

After spending several days studying this issue, I found out a few funny nuances.

First- There are three types of GUI for Java (libraries): A.W.T., Swing(who comes up with these names?) and JavaFX.

Today (Java 8 and 9) they are all included in the JDK package: that is, everything works out of the box and you do not need to bother with installing them. This is a big plus.

But, AWT is the first and very old implementation, so you don't need to use it. In general - not kosher. Swing is also not kosher, because something is wrong there and programs are terribly slow because of it. I won’t say more precisely, I didn’t understand it, but it seems like it’s officially no longer developing several versions. But JavaFX is buzzing and our bright future.

There is another such abomination - java applets, those that work in the browser and at the same time “hang” it tightly, just like Flash, only worse. Fortunately, this / these thing / things are practically no longer used, so it is pointless to spend time studying them.

So the only thing worth spending time on is JavaFX.

second moment. It is not that simple. Consider Delphi (or Visual Studio, Lazarus, whatever). Even for a "green" beginner, creating a simple program (one button and a text field for output) will go like this:

  • start Delphi;
  • a new project with the main form is automatically created;
  • select a button on the component palette and place it on the form; everything is visual
  • similarly we throw a text field on the form;
  • if necessary, in the properties panel, you can specify the button text, dimensions, etc.;
  • run - Delphi will offer to save, save.

That is, we did not write a single line of code, the IDE did everything herself. If you look at the generated code, you can't call it simple - some knowledge is already required here, but Delphi is smart enough to understand how to work with it.

If we want to add some action, for example, when clicking on a button, fill the text field with the phrase “Hi!”, Then we do this:

  • double click on the button (or select the onClick event);
  • Delphi creates the handler code for this event and throws us into the editor;
  • we type the name of the text field and Delphi gives hints on which you can navigate what and how to do.

So again, the IDE has done all the hard work.

But it's in other languages, Java goes its own way. To create a button in JavaFX, you need to manually create a Stage - “theater stage” (the name is in all seriousness!) And on them place the scene (Scene). To it is some container in which other elements are already embedded.

This assumes that each element and each of its properties must be programmed individually. Here is an example for two buttons and one label from my tutorial book

Response = new Label("Push a Button"); Button btnUp = new Button("Up"); Button btnDown = new Button("Down"); btnUp.setOnAction(new EventHandler () ( public void handle(ActionEvent ae) ( response.setText("You pressed Up."); ) )); btnDown.setOnAction(new EventHandler () ( public void handle(ActionEvent ae) ( response.setText("You pressed Down."); ) )); rootNode.getChildren().addAll(btnUp, btnDown, response); ...

When there are about a dozen buttons, plus 20 menu items, plus 30 other components, the code will not seem small. And this is without the code that is responsible for additional properties, such as alignment, size, font ... And this second indicates that JavaFX tutorials show how to write “fx code” with pens. Longing, in a word...

But, here comes the salutary third nuance. It turns out that smart people (apparently familiar with full-fledged IDEs) have developed a different kind of application, where a descriptive xml file called fxml, and such programs change as " FXML JavaFX Applications»

It's quite surprising to me that learning Java doesn't start with just such applications. Even though it's not Delphi, it's still a million million times better than working with the console and filling your head with other rubbish about why you need to use a hundred lines with OOP where in other languages ​​it takes one simple procedure. ;-)

Now seriously. If you have never programmed in Java, then you can try it right now. It's actually pretty cool, although it does take some time to get used to the programs. If you have experience with "visual IDEs", then even better - meet a lot of people you know.

JDK

Java must be installed on the computer. I will not provide links on how to do this - Google will help, because everything is too simple.

IDE

In Java, there is no one program - the development environment, so there are examples on the Web from different programs. The most primitive ones like Notepad++ are only suitable for console output, but if we consider something more serious, then only three candidates stand out: NetBeans , Eclipse and IntelliJ IDEA .

NetBeans- the simplest program that starts quickly (relative to the rest) and works pretty well.

Eclipse- also a good option, more powerful than NetBeans, but weaker than IntelliJ IDEA.

IntelliJ IDEA- looks the coolest, but you have to pay for it with the speed of work. It is worth noting that Android Studio is based on IntelliJ IDEA, but for some reason the studio is much slower.

An important point is related to programming for Android. Of these three IDEs, only IntelliJ IDEA is more or less suitable for this. There is a lot of material on the web about programming for Android in Eclipse, but they are all outdated - do not waste time running an old ADT plugin and trying to do anything with it. Maybe the old Android SDK will work, but all the new ones don't.

I'll show you how to make an FXML JavaFX application in all three programs, but before you get started, you need to install one more program: SceneBuilder (use the Java 8 version). This is the key program where, in fact, all visual construction is performed. SceneBuilder it can work on its own without an IDE, so you can run it and see how it works. The output will be an fxml file that contains all the necessary markup. This file is used in the IDE, instead of writing a megaton of code. :-)

TK

The program you create will be very simple - a button and a text field. When you click on the button, let the text “Hello!” be added to the text field.

In each program, you need to pre-register the setting - used by the JDK. If you can't figure out how to do it, google it.

NetBeans

Before starting work, you need to connect SceneBuilder: Service - Options - Java - JavaFX - Scene Builder Start Page. Select a program directory. The setting only needs to be done once. This applies to all IDEs.

Create a new project, where you need to select "FXML JavaFX Application".

We click "Finish" and, after some work by NetBeans, we see the finished files:

  • Myfx.java- this is the main-file, which, in fact, launches the entire program.
  • FXMLDocumentController.java- this is the "controller", where programming will be mainly.
  • FXMLDocument.fxml- this file stores the visual part.

Now run the program. First, the assembly and compilation will go (quite fast), after which the window of our program will pop up.

This is cool, because we haven't written a single line of code, but we already have a program with a working button. :-)

If you correctly specified the path to SceneBuilder, you can select the menu item "Open" on file FXMLDocument.fxml. The same thing happens if you double click. SceneBuilder will open. If there is no item, then the path is not correct, check the setting.

The principle of operation in SceneBuilder is the same for all IDEs, so for now I will describe only general points, then you will figure it out for yourself.

It is worth noting that after editing the file, you do not need to close SceneBuilder. You just need to save (Ctrl + S) and switch to the IDE - it will pick up the changes itself.

The SceneBuilder window is divided into three parts:

  • on the left - sets of components, hierarchy and Controller, where the main class is indicated (this is important!)
  • in the center is the form itself, where the visual construction takes place.
  • on the right - the properties of the components, divided into three tabs (this is a conditional division). The Code tab is responsible for what will be used in the java file.

Building FX programs must start with a container. In this example, NetBeans used AnchorPane. It is quite convenient, allowing you to set the “correct” indents for nested elements. tab Containers contains other containers with which you can practice on your own (I myself have not mastered even half of it :-)).

The hierarchy of components is a very handy thing that allows you to quickly select the desired element.

According to the terms of reference, we should have a text field. NetBeans uses Label, but we won't remove anything, just add a new element TextField on the form (arbitrarily to your taste).

Preview is possible in SceneBuilder (Ctrl+P). In this mode, only the form and all elements "without java programming" are displayed.

Now an important point: in order to be able to use the component in a java program (in our code), two things must be done.

The first is to check that the correct controller is specified. In our case, NetBeans has already done everything itself and specified myfx.FXMLDocumentController .

As you can see, this is the controller from the file FXMLDocumentController.java(package.controller). The IDE does not always specify it, but it is important because the fxml file (more precisely, the java code) uses it for binding.

The second point - the used component must have its own ID - this is the fx:id parameter. Here I have indicated textField1.

A yellow triangle will appear at the top of the message that supposedly there is no link between this id and the controller. Ignore him for now, we'll talk about that later.

The button that will fill the text field must also have its own id, as well as an onAction event method (this is the main component event, not onClick, as in Delphi). NetBeans has already taken care of this, so we don't have to write anything.

On this visual construction can be completed. Save and switch to NetBeans. We see that the file FXMLDocument.fxml changed: added textField1:

Now we need to somehow use the text field in java code. Unlike Delphi, NetBeans does not create any code for this, so we will have to add it in a "semi-manual" way. To do this, different IDEs use different methods, but the general principle is that you need to position the cursor on the desired field in the editor and do some "action". In NetBeans it's called Install Controller on the menu A source. (Yes, Java has big problems with naming...)

After executing this command, it will go to the file FXMLDocumentController.java, where the variable declaration will be added to the code textField1:

Pay attention to "@FXML" - this annotation indicates that the code is somehow used in FXML. After these changes, SceneBuilder will no longer issue a warning like the yellow triangle before. If you run SceneBuilder again, you can check this.

We start the program for execution for the test. Now our task is to fill in the text field by clicking on the button. As you already understood the method handleButtonAction just doing the right job. In it we add:

TextField1.setText("Hello!");

Pay attention to how it works code completion after the dot is pressed.

As you type, NetBeans will narrow down the suggestions area where you can choose from. This feature makes life very easy for programmers, because there are too many options and this allows you to avoid various kinds of syntax errors when typing.

This feature is present in all IDEs, although there are differences in implementation and usage.

We run the program and see that everything works as it should.

We had to write just one line of code, well, and perform a few additional actions in the editor.

Eclipse

Eclipse takes a little longer to start than NetBeans. First you need to specify the path to the SceneBuilder. This is done in Window - Preferences - JavaFX.

Pay also attention to the fact that Eclipse is a non-Russian program (I don’t even know if there is a Russifier for it).

Create a new project and select JavaFX.

Click Next and get to the settings page. Here I have indicated the name of the project, as before myfx(I have different project directories for different IDEs, so they don't overlap).

Here you need to select the application type, container type and controller name. Click Finish and Eclipse quickly generates the skeleton of our future program.

Everything is very similar here, only one more file has been added application.css- yes, yes, in JavaFX you can use CSS to customize the look! Eclipse immediately generated a connection code for this file.

Run the program and make sure there are no errors.

Unlike NetBeans, this is a completely blank form. Let's open it in SceneBuilder using the context menu.

And here we see that there is no form. But, in fact, it is - it's just that the calculated size (height and width) is used by default, which in this case is zero. There are no components! In our case, this is not exactly what we need, so we will select the BorderPane in the hierarchical list and in the properties Pref Width and Pref Height let's set some values. These properties set the "desired" width and height. After that, the form immediately "appears".

The BorderPane container consists of 4 parts: top, right, bottom, left and center. Components should be placed in different parts - their position will depend on this when the window is resized.

It's quite hard to explain in words here, just try placing some buttons and then resize the window in the preview.

I didn’t get too smart and placed a text field at the top and a button in the center.

Now check that the controller is specified: in this case application.SampleController- Eclipse did the job for us.

Now we need to specify an id for our elements. For the button I set btn1, and the text field textField1. We again have the message "yellow triangle".

For the button, specify the method for the event - btn1Click.

Save and return to Eclipse. We will see that the file Sample.fxml updated, but warning icons appeared next to some lines.

The situation here is exactly the same as in NetBeans - you need to make changes in a "semi-manual" mode. In Eclipse, this is done using the context menu on the second mouse button: Quick Fix or hot key ctrl+1(which is more convenient).

At the same time, a hint about the intended action pops up. For example for textField1 it is proposed to add an identifier to the controller:

and for the button there is also an event handler method:

At the same time, Eclipse slows down a bit and changes are not immediately displayed on the screen. Here you need to either switch to the controller file, or wait a bit. As a result, the desired changes will be added to the code and the warning icons will disappear.

Let's add our code as we did before in NetBeans.

Pay attention to more intellectual work of autocompletion. In automatic mode, it slows down a little, but if you press Ctrl+Space(the same combination is used in many IDEs), it also allows you to get a good help.

Let's start our program.

And we write down one more IDE to our account. :-)

IntelliJ IDEA

IntelliJ IDEA starts up rather slowly, you can have time to check your mail. :-)

Again, specify the path to the SceneBuilder: File-Settings:

And specify its name (as usual - myfx):

IntelliJ IDEA will initialize and we will see the familiar three files. Let's run the program to check for errors.

There is also an empty form, but the title of the program is specified. If you look at the code Main.java, we will see the line:

PrimaryStage.setTitle("Hello World");

This is the title of the application. In other IDEs, this line is missing, but now we know what the “theater stage” is for. ;-)

Switch to SceneBuilder (similar to Eclipse): with the second mouse button you need to select Open in SceneBuilder.

Here is also an empty form, but with a container GridPane. Install Pref Width and Pref Height to display the form.

By itself, the GridPane is an a la grid of cells for elements. I think that there is no point in repeating here - all actions will be similar:

  • place button and test field,
  • give them an id
  • for the button, register a method for processing a click,
  • do not forget to check if the controller is specified ( sample.Controller).

Close SceneBuilder and return to IntelliJ IDEA. Here you need to add id identifiers to the code, and also create a method for reacting to the button click.

IntelliJ IDEA offers two ways to do this. The first - when you hover the mouse over the “problem place”, a hint will appear that you can click on:

The second is a hot key Alt+Enter

Each time you add, you switch to the controller file, where you can immediately see the changes.

At the same time, note that the line "@FXML" is not added. If we manually add it before the variables and the method, then IntelliJ IDEA will immediately offer to add the required java class:

In general, IntelliJ IDEA shows a fairly good ingenuity and acts as an assistant in writing code. And it does it on its own without any extra button presses.

Well, let's add our code for the handler and run the program:

Great, everything works!

Total

Main conclusion - Visual programming is possible in Java. It may not be perfect, but it is quite suitable, especially for beginners. Learning a language is much more interesting when there is some kind of tangible result - OOP, classes and other tricks are good, but it's better to start with buttons, input fields, menus and everything that a normal program implies. And the console is boring and uninteresting.

I brought three IDE not casually. There are a lot of Java examples on the Web, and they are all for different programs. Personally, I have not yet decided on my preference, since everyone has both pluses and minuses. Probably need to work with everyone, then it will be clear.

But, the key point is the ability to work with SceneBuilder. Building a form in JavaFX is slightly different from the same Delphi, primarily in the use of complex containers (they can be nested into each other). Therefore, you should first deal with them, after which you can already take on the components themselves.

It's time to move from language features to programs that will help you write code faster and more correctly. The development environment (IDE - Integrated Development Environment) includes:

  • code editor;
  • compiler;
  • collector;
  • debugger.

Some development environments contain all this out of the box, others are brought to this status with the connection of plugins and modules. Here are the top 10 IDEs for java today.

IntelliJ IDEA

Description: One of the most functional environments for java development, equipped with a system of intellectual assistance in writing code. Based on context, IDEA adjusts how autocompletion works and tool availability. The abundance of tools allows you to speed up development, for example, using patterns and repetitions, as well as increase the performance of the final program. A huge number of plug-ins and add-ons for any task make the IDEA java development environment an almost ideal tool.

Cost: $499 for the first year of operation.

NetBeans

Description: Positioned by the manufacturer as a development environment that supports all the latest Java features, allowing you to write error-free code thanks to the FindBug tool. Website, documentation and IDE itself for java in Russian. Perhaps the most powerful free java development environment.

Cost: Free.

This list of java IDEs is far from complete and covers only the most popular representatives. Therefore, before choosing a favorite, remember that the best java development environment is the one that allows you to solve the current problem with the minimum amount of effort and with the best result.

From the author: Among all the languages ​​that are used in web development, Java is the most sensitive. This PL is characterized by complex syntax, high data typing, and error immunity. That is why this tool for Java - IDE is so in demand. The development environment helps to bypass the pitfalls that await a programmer writing in a text editor. If you don't want to go through the long and thorny road of text writing, welcome to the review of the top development environments most suitable for the coffee language.

Need an IDE for development

Java is one of those languages ​​for which the development environment is not a whim of individual specialists, but a real means of survival. A complex language cannot be read and executed until all elements of the system are configured properly. Sometimes, it is difficult for a web developer to understand why he needs such a bulky and productive software. All web languages ​​like HTML/CSS, JavaScript and PHP can be implemented without additional software (although there is even a top paid IDE for the latter - PHPStorm). But, as soon as it comes to Java, everything falls into place. Long and complex code documents defy manual organization.

But, as always, there are opponents of ideology. Some developers call IDEs "crutches" that are only needed by less trained programmers. For them, downloading a development environment is like cheating on fundamentals. Unfortunately, this approach can leave the developer behind the evolution of programming: large corporate projects, like highly functional web applications, require close interaction between team members, quick launch and debugging of the code. Moreover, the skill of working with the main IDEs is a criterion for employment in the best positions.

Of course, there are those who can build their developer tools so well that a full-fledged IDE becomes unnecessary. Be that as it may, the development environment consumes device resources that are needed to ensure the rest of the developer tools work. This is especially evident in outdated versions of Windows/Linux - as soon as the development environment starts, the rest of the resources stagnate.

Web developers almost always prefer text editors. They are lighter and allow you to create solutions on your knee. No additional tools, no deep configuration required, and the range of software is much wider. This view is retained by web programmers until they get started with Java.

I want to choose a program

The field of programming offers many solutions for creating full-fledged code. In particular, this applies to various development environments. It's not just big companies like Oracle that are building IDEs. Work on such software, as a rule, is the prerogative of professionals who want to optimize their activities. That's exactly what happened to Visual Studio: one of the best IDEs of all time. Microsoft, which was in full swing to introduce a version of Windows in the new century, simply presented its tools in one application. Now VS is the choice of millions.

Unfortunately, you can't call it "for Java developers". No, this does not mean at all that it will not be possible to write something in Java in this development environment: there are even special extensions. It's just that it is more focused on C, C # and some other Microsoft products. Java has its own top IDE, which we will present today. But, first, we need to understand what kind of ideal IDE we want to see (in tune with).

First, you can immediately decide that those who work online are not suitable for a Java developer. They will create interpretation problems, and constant freezes will only discourage programming. A smarter solution would be to download one of the software presented today. It's better to click download once than constantly put up with bugs. The era of cloud IDEs is yet to come.

Also, the Java development environment must support a number of technologies that are necessary for efficient coding. Among them are the Java virtual machine languages: primarily Java 10, but also Groovy and Scala. Version control is also one of the key points. Git alone will not be enough: you need Mercurial, SVN and others. It is impossible to guess which one will be popular in a few years (Git, of course ☺). A web developer will benefit from supporting a wide range of languages, including PL databases, web languages, both front-end (TS, JS, HTML) and back-end (one of the popular general-purpose languages). Since a feature of the JVM is the conversion of programming language words into byte code, powerful interpreters are also needed. It is they who can make Java fast in theory, fast in practice.

Well, of course, like the Java language itself, the development environment for it must be cross-platform. All other solutions hinder the development of the programmer. Since he chose Java, he chose universality.

The Three Elephants of Java Development

As always, there is a top three and all the others. This is already used in the web development industry, and we will not change traditions. The advantage of our review is that there will be no paid software (almost). You can freely download each development environment from the official website. Also, it will be one of those top charts where we subjectively pick a winner. Well, you can add up your own decision, based on your experience and our conclusions.

Idea for web development

IntelliJ IDEA is an IDE released by JetBrains based on the Java Virtual Machine. The environment itself is also written in Java and partly in Python, and is intended for them. They immediately identified themselves as the environment for Java, back in 2001. Then the development environment introduced a whole library of refactoring tools, which immediately brought IDEA to the top. The developers have made a choice not so much in favor of convenience, but in favor of productivity. Some routine operations are completely performed by the development environment.

We promised that there would be no paid software today. But the truth is that the ultimate version of IDEA has its own cost, albeit insignificant (up to $ 500), as for an IDE. If you are a professional javist who earns from $20 an hour, this is a trifle. By the way, only in the Ultimate package will the developer be able to work with the Java EE platform.

But there is also a free version of IDEA, which is not a stripped-down version. Yes, some features are missing, but language support is similar to the commercial version. It is convenient to write your first lines of code on it and expand it with plugins.

Modern trends and approaches in web development

Learn the algorithm for rapid growth from scratch in website building

IDEA is one of those development environments that can be called truly smart. Instead of fixes and highlighting, which even the simplest text editor has, IDEA offers auto-completion: fragments of the finished program are generated at the hands of the developer. It's not even worth mentioning that all brackets and other syntactic goodies will be closed automatically. And if something goes wrong and IDEA can't handle the problem, it will immediately signal the Java developer on the other side of the screen.

Bribes and refactoring, which occurs immediately in several languages. Javisists know that code is never pure Java, especially when it comes to web development. This includes database languages, hypertext, and so on. At this point, IDEA does what many are not yet capable of: by analyzing the written program, the IDE separates languages ​​from each other and analyzes them separately.

The program has well-implemented hotkeys, which, of course, you will need to get used to. But, as soon as everything happens, productivity rolls over. They can also cause debugging of the code that occurs in the next window.

The development environment is notable for the fact that it constantly expands the number of supported technologies. However, developers are not very dependent on these updates. At any time, they can download the appropriate plugin.

Eclipse IDE

This development environment is popular not only among Java developers, but also among web developers in general. A significant advantage over IDEA will definitely be the price - Eclipse is completely free, as well as add-ons to it. By the way, the creators of the development environment did not plan to compete with IDEA: they wanted to overshadow the success that Visual Studio received. To some extent, they succeeded: average web programmers almost always prefer Eclipse.

What's even better than IDEA? Free access to Java EE. It is available immediately, without additional payments and installation of plugins. By the way, about the last. Installing them in Eclipse is a significant task. They can "quarrel" with each other, causing inconvenience to the developer. But the positive thing is their number. We advise you to choose the official ones, because in this way it is less likely that they will begin to conflict with the development environment.

Eclipse is designed for you to personalize it for yourself. Therefore, the first experience with the IDE can push you away from further use. That rare case when a manual is needed for one of the best development environments. Fortunately, there are a lot of them on YouTube.

NetBeans

This is a development environment that was born from the pen of the creators of Java - Sun Microsystem. They wanted to create the best solution for their language, so they designed an IDE that is not only friendly with Windows.

In our list, it is the most cross-platform. NetBeans can be run not only on top axes, but also on any other device that is equipped with a JVM. You can immediately see the approach of Sun: they wanted their language to work on all devices (from a computer to a washing machine). Naturally, "beans" were called the official development environment for Java, although it is not so good. Today, NetBeans is being worked on by Oracle, which took over Sun.

NetBeans is as smart as IDEA, capable of smart refactoring. The system copes with this task much better than Eclipse, but worse than IDEA.

As you can understand from the volume of what has been said, IDEA will be named the best. Here is a list of reasons:

understanding of programming. No one is as quick to code and fix bugs as IDEA;

refactoring efficiency;

price. Yes, Eclipse is completely free. But you wouldn't buy bad food just because it's cheaper, would you?

This is our vision! By the way, Oracle has another IDE in its arsenal called JDeveloper - completely tailored for Java. Try it and draw your own conclusions. And we have everything!

Modern trends and approaches in web development

Learn the algorithm for rapid growth from scratch in website building

After installing all the necessary components, it's time to make a choice, with the help of which the development of programs will take place.

There are two ways here: either work with the JDK directly through the command line, or use the integrated development environment. Let's consider both of these options.

Compiling source code via command line

One of the options is to keep the entire program code in a text editor, and then compile the source Java code into byte code via the command line and then run this byte code.

Below is the sequence of actions:

1. Save our source code in *.java format (figure 2.1).

2. Run the command line and enter the folder with the source Java code (Figure 2.2).

3. Using the Javac command, we compile the source Java - code into byte - code (Figure 2.3).

4. Run the byte code using the Java command (Figure 2.4).

Figure 2.1 - Saving the source code

Figure 2.2 - Path to the folder on the command line

Figure 2.3 - Compiling to bytecode

Figure 2.4 - Running the bytecode

The method is good, but when developing serious applications, it is little used. For small projects, everything is in order - we compile all the source code and run the compiled bytecode. But if the project already has more than ten source code files in its hierarchy, then manually compiling is extremely inconvenient and slows down the development process. For these purposes, it is recommended to use integrated development environments.

Java IDE

Compiling Java code from the command line can seem like a chore, but it's an essential skill nonetheless. By following the basic JDK steps yourself, you can get a better idea of ​​how the development environment works. Most often, it is highly recommended that before installing any IDE (integrated development environment), learn how to work with the Java JDK through the command line.

However, after mastering the basic steps of executing Java programs, you will probably want to use a professional development environment.

Recently, such environments have become so powerful and convenient that now there is simply no point in doing without them. The most common IDEs for Java today are: Eclipse, NetBeans and IDEA. Each of these media has its own advantages and disadvantages. Personally, I settled on the Eclipse IDE for some reason. Firstly, this environment has very convenient hot keys. Under it, a huge number of developer tools are freely available. Even such a large corporation as Google personally wrote a lot of tools for Eclipse. When developing, for example, under the Android OS, it is difficult to find the best IDE - for Eclipse, a very powerful Android SDK is freely available, on which more than one generation of Android applications have been developed.

In order to download this IDE, you should follow the link http://www.eclipse.org/downloads/ and select one of the proposed solutions (Figure 2.5).

Figure 2.5 - Suggested Eclipse Solutions

In total, about twelve solutions are offered for developers of various directions. As you can see, the choice is quite large. For my task, I chose the standard Eclipse Standard package. Next, select the desired operating system with architecture (Figure 2.6) and the free download of this environment begins.

Figure 2.6 - Selecting the desired OS and architecture

For more than a decade of history of the Java language, not a single generation of integrated development environments (Integrated Development Environment - IDE) has changed. The evolution of IDE tools is due to many factors, the totality of which is called - information technology, including software and hardware components, as well as the development of the language itself, which occurs not only in depth, optimization of some features, which clearly demonstrates the arrival of new Swing libraries instead of obsolete ones. AWT, but also "in breadth", this is the emergence of JSP technologies, greater integration with DBMS and application servers, support for Spring, Hibernate technologies, etc.

And if the first IDE tools, in today's understanding, represented a primitive text editor that served only for a set of source codes, and all the rest of the work, from compilation to the final assembly of the project, had to be done manually, then today's modern ones are actually multifunctional devices that take on itself not only the usual functions but also a number of additional ones, ranging from automatic Javadoc generation, refactoring, profiling, UML design, a client for connecting to any DBMS, and ending with such exotic ones that are not related to the development process, such as spell checking.

Of course, that the price for all these "conveniences" are increased requirements for computer resources. There is an opinion that 80% of users use the capabilities of existing software only by 20%, this can also be projected onto IDE tools. Since only a programmer who has been developing on the corresponding technology for more than one year can appreciate all their advantages. And it is difficult for novice programmers to adequately evaluate this or that tool, therefore, as a rule, its independent choice occurs according to two criteria - the intuitive understandability of the interface and various time-resource characteristics, such as loading, compiling, launching, occupied RAM. Indeed, at first, only a compiler, a debugger, and the Java machine itself are needed.

Therefore, the purpose of this article is to review the existing market for IDE tools for developing programs using the Java language, identifying the strengths and weaknesses of each according to various criteria, based on an analysis of the results of the project: "Testing and analysis of software development environments for Java" ("Testing and analyzes IDE for Java" (TAIDEJ)), which was organized by us, the site coordination group and took place from 01/01/2006 to 09/01/2006 on the site www.site.

The project was divided into several stages. At the first stage, we developed a questionnaire, table 2, and compiled a list of Java IDEs, table 3, which have been developed since the advent of the Java2 language to the present, including links to both IDE tools that everyone hears, and rather exotic ones. This list has been periodically updated thanks to our members. Here we want to express our deep gratitude to all project participants, as well as to all those who discussed and constructively criticized us in the forums, table 1

Table 1. Java - forums
Java - Forum on Sources.Ru
RSDNhttp://www.rsdn.ru/?forum
Forums - Juga.Ruhttp://forum.juga.ru/
IT archive forumshttp://www.javable.com/forum
Java Forums - Java Programminghttp://forum.java.sun.com/
java.net Forumshttp://forums.java.net
javalobby.orghttp://www.javalobby.org/java/forums
JavaWorldhttp://www.javaworld.com/javaforums
Computer forum Ru.Boardhttp://forum.ru-board.com
Programming - iXBT Hardware BBShttp://forum.ixbt.com
JUG KPI Forumhttp://jug.in.ntu-kpi.kiev.ua/forum
CITForumhttp://forum.citforum.ru
Realcoding.NEThttp://forums.realcoding.net

In developing the questionnaire, we tried to find out the following:

  1. the trend of changes in programmers' preferences, since the once successful tools either completely stopped developing or, for some reason, the companies developing them fell out of the way, and therefore many had to switch from one IDE - tool to another;
  2. how the programmer chose this or that means;
  3. how the programmer evaluates the tools with which he worked on a five-point scale;
Table 2. Questionnaire

Further tasks were to process and analyze the obtained statistical information, to assess the "resource intensity" of popular tools. In addition, reviews of some of the tools were prepared and posted on the project website.

Table 3. List of IDEs for Java.
NameManufacturerProducts webpage
1 Applet Designer ProfessionalTVObjectshttp://www.tvobjects.com/
2 ApptivityProgress Softwarehttp://apptivity.progress.com/
3 Awesume Jawa 1.0Awesume Interactive Designhttp://www.awesume.se/en/index.htm
4 bluettefree RAD Java toolhttp://blue.donga.ac.kr/bluette/
5 BongoMarimbahttp://www.marimba.com/
6 Clarion Internet EditionTop Speed ​​Corporationhttp://www.topspeed.com/
7 CodeWarrior ProMetroWerkshttp://www.metrowerks.com/desktop/pro/
8 Cosmo codeSGIhttp://www.sgi.com/Products/cosmo/code/index.html
9 ED for WindowsSoft As It Getshttp://www.getsoft.com/ed_java.html
10 ElixirElixir Technology Pte Ltdhttp://www.elixir.com.sg/
11 Free BuilderFreeBuilder collectivehttp://www.freebuilder.com/
12 GRASPGRASP Projecthttp://www.eng.auburn.edu/grasp/
13 GrinderParadigm Exchangehttp://www.tpex.com/features.htm
14 HyperwireKinetixhttp://www.ktx.com/
15 Jamba AnimatorInterleafhttp://www.jamba.com/
16 JambaInterleafhttp://www.jamba.com/
17 JavaManHartWarehttp://homepage.dave-world.net/~hartware/
18 Java StudioSun Microsystemshttp://www.sun.com/
19 JavelinsStep Aheadhttp://www.ozemail.com.au/~stepsoft/
20 JaWizInfinityEdge Systemshttp://www.infinityedge.com/
21 JBuilderInprisehttp://www.inprise.com/jbuilder/
22 JDesignerProBulletProofhttp://www.bulletproof.com/
23 JDE for EmacsPaul Kinnucanhttp://sunsite.auc.dk/jde/
24 JADI SujalShahhttp://dan.hcf.jhu.edu/sujal/winjadi/
25 JIGS Cubedhttp://www.scubed.cc/
26 JipeEnvision Internet Serviceshttp://www.users.globalnet.co.uk/~eis/jipe.htm
27 JPadModelWorkshttp://www.modelworks.com/
28 KalimantanReal Time Enterprises, Inc.http://www.real-time.com/java/kalimantan/index.html
29 KAWATEK-TOOLS Inc.http://www.tek-tools.com/kawa/
30 lavaDan Pagehttp://www.hnet.demon.co.uk/products/lava/index.html
31 Lemurisland designhttp://www.island-design.co.uk/
32 NetBeansNetBeans Inc.http://www.netbeans.com/
33 OEM 1.0Innovative Softwarehttp://www.isg.de/OEW/Java/
34 PARTS for JavaObjectSharehttp://www.objectshare.com/p4j/p4j2info.htm
35 PowerJSybasehttp://www.sybase.com/products/powerj/
36 Roasternatural intelligencehttp://www.roaster.com/roaster/
37 SNiFF+Take Five Softwarehttp://www.takefive.com/sniff/
38 SpiriteVisNet Limitedhttp://www.evis.net/
39 supercedeSuper Cede, Inc.http://www.supercede.com/
40 visajImperial Software Technologyhttp://www.ist.co.uk/
41 Vision JadeVision Softwarehttp://www.visionsoft.com/
42 VisualAge for JavaIBMhttp://www.software.ibm.com/ad/vajava/
43 visual cafeSymantechttp://cafe.symantec.com/
44 Visual J++Microsofthttp://www.microsoft.com/visualj/
45 Web Application PlatformSilverstreamhttp://www.silverstream.com/products/main/main_f.htm
46 Java WebIDEChami.comhttp://www.chami.com/webide/
47 Wipe Outsoftwarebuero m&bhttp://www.softwarebuero.de/wipeout-eng.html
48 IntelliJ IDEAIntelliJ IDEAhttp://www.jetbrains.com/idea/
49 Eclipseeclipse.orghttp://www.eclipse.org
50 JDeveloperOraclehttp://www.oracle.com/technology/products/jdev/index.html
51 JCreatorXinox Softwarehttp://www.jcreator.com/
52 jEditjEdithttp://www.jedit.org/
53 X DevelopmentOmnicore Softwarehttp://www.omnicore.com/
54 Gel IDEGExperts Inc.http://www.gexperts.com/
55 IBM Web Sphere Studio Application DeveloperIBM Softwarehttp://www-306.ibm.com/software/awdtools/studioappdev/
56 eXtendNOVELLhttp://www.novell.com/products/extend/

Firstly, the method of distribution, respectively, the IDE can be divided into paid (JBuilder, Visual Cafe ...) and free (NetBeans, Eclipse, Gel), which anyone can download from the manufacturer's website.

We decided to single out the second classification feature not on the basis of some specific capabilities, since, according to this feature, it would probably be possible to split the IDE to infinity, but from the totality of the capabilities of the tool itself, and its demands on resources. Of course, in this case, the presence of a visual interface builder comes first, which in turn puts forward certain requirements for resources.

By this criterion, you can select tools that do not have a visual tool for GUI development (simple), for example Gel, JCreator, and which have (complex) - JBuilder, Idea.

Accordingly, the first in RAM during operation occupy less than 30 MB, and the second more than 100 MB. As for the visual development tools themselves, in my experience and in the opinion of many fellow programmers with many years of experience, their use is not always justified for novice programmers, although they seem to facilitate development on the one hand, but on the other hand make it difficult to conceptually understand such basic things. Swing libraries like layout managers, event handling, etc.

Also, a group of DSTU students was involved in the project (I would especially like to mention Egorenkov V. and Lagutin D.), who had just begun to study OOP, whose tasks were to familiarize themselves with the IDE for Java, install them, fix parameters when loading, issue their comments and, ultimately, the independent choice of the means for the initial work. The test results are summarized in Table 4.

Table 4. Results of testing IDE tools
ParametersGeIJScreator 3.5JBuilder XIdea 5NetBeans 4.1
Installation time1 sec1-1.5 sec58 sec22 sec50sec
installed package size10.3 MB6.49 MB332 MB157 MB118 MB
Distribution Size4.21 MB3.6 MB178 MB51.6 MB46.4Mb
launch5s1-1.5 sec9 sec6 sec6 sec
Occupied space in RAM17828 Kb12960 Kb74128 Kb65604 Kb61409 Kb
The amount of virtual memory used9020 Kb14960 Kb78588 Kb76416 Kb70406 Kb

* A machine based on: CPU Athlon64 3000+; RAM - 1024MB DDR-SDRAM (pc3200)

After that, a seminar was held at which the results of the work were summed up, as a result of which it was found that at the initial stage of work, when the process of studying the syntactic features of the language, there is no need to use the features that complex IDEs represent, although, of course, many people are interested in ways to quickly develop an interface, as this feature is the most intuitive, and immediately allows you to get results. But, as you know, the development of the interface is an integral, but not the most important part of the application. And the increased resource requirements from complex IDEs, especially considering that not all students have home computers even with 512 MB of RAM, give undeniable advantages to simple IDEs, so Gel was recognized as the leader among students from all available IDEs.

Name% of votesGrade
1 JBuilder21.47 3.0
2 Eclipse16.64 3.3
3 NetBeans14.22 2.9
4 IntelliJ IDEA11.66 3.5
5 JDeveloper7.11 2.8
6 Visual J++5.26 1.8
7 JCreator4.26 2.3
8 VisualAge for Java3.69 2.8
9 Java Studio3.41 2.0

Proceeding from this, we will analyze from what positions the programmer approaches the independent choice of means.

  1. Interface. This is the first component that the user encounters after installation and which forms the first impression of the program, and on the basis of which the final choice can be made. Here, not only the overall design is evaluated, although, of course, it also affects in a certain way, but also the convenience of arranging and configuring components such as the source code window, the project window, etc.
  2. Setting. Accordingly, after installation and the first launch of the development environment, its configuration is performed, i.e. the paths where the installed SDK, DOCS, J2EE are located are indicated. In this component, as a rule, significant differences are not observed. Moreover, modern tools, as a rule, independently determine the installed components.
  3. Code editor. Setting the display of source codes, as a rule, also does not differ in variety, in any tool you can easily adjust the font size and size, as well as color. An important advantage is the presence of an assistant when, when the mouse "freezes" on any variable or method, a rather detailed ToolTip (context window) pops up in which all the parameters of the object are expanded. There are also a lot of pleasant little things, output of line numbering, display of the class structure, display of paragraph symbols, spell check.

Having analyzed, according to these features, all currently existing IDE - tools, you can see that there are no significant differences between them, except for the interface design, and obviously the concept of convenience is subjective.

Analysis of the survey results, tables 5.6. As described above, in our survey, funds were divided into two groups, those that were previously used and those that are currently used. And if among the means that were used in the past there is a variety, we selected the means that received more than 3% of the votes of the total number of those participating in the survey, then among those that are currently used there is no such diversity, and we were forced to reduce the percentage of votes, and despite this, they did not receive much diversity.

As you can see, the "simple" IDE tool JCreator is an invariable participant in the selections, this is apparently due to the fact that it is quite easy to learn and not demanding on resources, therefore it is popular among novice programmers. JBuilder has fallen out of favor, apparently because free tools like Eclipse and NetBeans are outperforming it. Eclipse should be recognized as the undisputed leader, since it has not lost its rather high positions, but even added. The popularity of JDeveloper should be attributed to its focus on the Oracle database. The popularity of IntelliJ IDEA is due to the fact that at a certain point in time, the developers managed to present a product with powerful features, and for several years they have been quite successfully maintaining its brand at a high level, which is also confirmed by high user ratings.

In general, it should be noted that the results of the rating were predictable, the question concerned only the distribution of places, and the surprise for the authors was that NetBeans scored a relatively small percentage of votes, especially considering the capabilities of the latest version.

An analysis of the reasons for choosing an IDE tool showed that the choice of the first generation tools, as a rule, was carried out randomly or based on the results of an independent analysis, which is natural, since at that time the process of formation of both the language itself and development tools was taking place. The funds of the second generation were chosen mainly as a result of independent analysis or the advice of a friend. This is due, apparently, to the fact that by that time both the circle of professional Java programmers and the market for the main developers of IDE tools had formed.

Table 7. Reasons for choosing an IDE

Thus, today the leaders among Java IDE development tools are IntelliJ IDEA, Eclipse and NetBeans. In general, they all have approximately the same functionality, and it is quite difficult to evaluate which one is the best. Therefore, when choosing a tool, obviously, you need to focus on the IDE on which the project is being developed, if the programmer joins the development team, or choose the most accessible one if you plan to develop an independent project.

List of sources used

  1. Zhmailov B.B. Advantages and disadvantages of developing Java programs without using IDE tools. Journal "Bulletin of Computer and Information Technologies" №6, 2006
  2. , Sergey Berdachuk, "Oracle JDeveloper 10g - Java Development Environment"
  3. , Alexey Litvinyuk, "Introduction to the Eclipse Integrated Development Environment"
  4. , Alexander Demyanenko, "A brief overview of the IDE - Jbuilder"
  5. , Alexander Demyanenko, "A Brief Overview of IDE - Idea"
  6. , Boris Zhmailov, "An overview of IDE - Gel"
  7. , An overview of automated refactoring tools in the Java IDE

Top Related Articles