How to install and start using NetBeans to program in Java

Whether we are thinking of learning to program, or if we already have the necessary knowledge and are dedicated to it professionally, it is vitally important to have the right tools to carry out this task. In the case of Java, for example, we can find a large number of programming environments, or IDEs, that allow us to program in this language. However, not all programs are the same nor do they offer us the same tools and features when carrying out this task. Thus, if we are looking for a complete yet simple tool with which to program in Java, we should definitely give NetBeans a try.

install and start using NetBeans

What is NetBeans?

NetBeans is a free and open source IDE, or integrated development environment , specially designed for programming in Java. This programming environment was originally created in the year 2000 by the company Sun Microsystems (currently owned by Oracle , and managed by Apache ). Today it continues to be one of the most maintained programming environments and with a huge community behind it.

This IDE has always allowed programmers to easily create Java desktop programs, as well as Java EE tools and web applications. However, its developers have been able to adapt very well to new technologies, and it also has support for creating HTML5 applications with JavaScript and CSS. And this does not end here, but it also has tools that facilitate the development of applications in languages such as PHP, C and C++.

One of the strongest points of this program is the well-known ” NetBeans Platform “. This is a framework, included in this IDE, that greatly simplifies the development of Java Swing applications without the need to install anything or rely on any additional SDKs. Applications created from this platform can dynamically install modules to add additional functionality, such as the possibility of receiving updates from the program itself or adding new functions while it is running. Some of the features that we can control from this platform are:

  • The user interface.
  • User settings.
  • Storage management.
  • The window in which it runs.
  • The assistant framework.
  • The included NetBeans libraries.
  • The IDE tools.

Other very interesting components that we can also find are NetBeans Profiler , for monitoring and detecting vulnerabilities in programs, and the GUI Design Tool , for creating interfaces.

How to download and install

As we have already explained, Apache NetBeans is a completely free program for all users and open source. If we are thinking of installing it on our computer, we will be able to do it from any operating system that has support for Java, be it Windows , Linux , macOS or BSD, among others. In addition, all the programs that we create with this program will work without problems, and without the need to rewrite them, in any of these systems.

To download this tool, the first thing we must do is access theApache NetBeans website . In it we will find a link from which we will be able to download the latest version available for this program, as well as the possibility of downloading any previous version, up to 9.0 (when Apache began to take control of the tool) .

Descargar Apache NetBeans

In addition to downloading this IDE, we will also need to download and install the Java JDK on the computer , if we do not already have it installed. We can download this from here , it has a size of about 150 MB, and if we don’t install it previously, the NetBeans installer will give us an error and won’t let us continue.

Instalar JDK Windows

In the case of Linux, we can install this programming IDE directly from its official snapd package. To do this we just have to open a terminal and execute the following command in it:

sudo apt update && sudo apt install snapd && sudo apt install netbeans

The programming IDE download is approximately 400-500 MB in size. When the download finishes, we can now run the installer to start installing the IDE on the PC. The first thing this will do is check that our computer meets the requirements (and has the JDK installed), and then we will be able to see a window where we can choose the components that we want to be part of the installation.

Instalación NetBeans en Windows - 1

The recommended thing, if we don’t want problems, is to install them all (as it comes by default), although we don’t have in mind, at the moment, to use some of them like PHP. But this way, if we need it in the future, we won’t have to do anything else.

In the next step, what we will find will be the license and use terms, which we will have to accept to continue.

Instalación NetBeans en Windows - 2

Next, the installer will allow us to choose where we want to install NetBeans. And we can also choose in which directory we have the JDK installed.

Instalación NetBeans en Windows - 3

Finally, we only have to see a summary of the installation. And also choose if, during it, we want to search for and download new versions of the program, if any.

Instalación NetBeans en Windows - 4

With everything ready, we can start installing the program. The copy and configuration process will take a few seconds, and when it is finished we will have NetBeans ready to start using it.

Instalación NetBeans en Windows - 5

Create a new project in Java

Once the program is installed on the computer, we can launch it using the direct access that will appear on the desktop, or from the entry that will have been created in the Start menu.

NetBeans - Interfaz

To create a new project, and start programming our games, what we have to do is click on the “File” menu and choose if we want to create a “New Project” (new project), or simply a “New File” (new archive).

NetBeans - Crear nuevo proyecto 1

We will select the type of project (or file) that we want to create. By default, to avoid filling our hard drive with unnecessary elements, the components necessary for the creation of projects will be disabled in our system. We will have to activate them (and download and install what is necessary) the first time we are going to create a project.

We configure the project and finish with the wizard.

NetBeans - Nuevo proyecto

We already have our new project open in NetBeans, and we can start working with it. Now we can add new files to the project of the type we want, depending on the main objective of our project.

NetBeans - Nuevo archivo de código

Once a file has been created, we can finally see the editor and start writing the necessary lines of code so that it fulfills its purpose.

Editor NetBeans

Now, the limit is set by our imagination. Let’s program!