# NetBeans

NetBeans is an IDE or Integrated Development Environment. It is FREE, open source, and has a worldwide community of users and developers.

It allows for quick and easy development of desktop, mobile and web applications with Java, JavaScript, HTML5, PHP, C/C++ and more.

## Installation

First of all we need to install the latest version of the Java Development Kit (JDK). Once finished, we can download and setup NetBeans.

### Downloading the Java Development Kit

First we need the latest version of the Java Development Kit (JDK).

Navigate to [https://www.oracle.com](https://www.oracle.com) and select **Downloads**.

![Downloads Oracle](https://981283853-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEK-j-hxx7zCDNXfjra%2F-LLUss7C28VNjhw8iIx2%2F-LLUst9_4WOGUX94x0eA%2Fstep4_downloads_jdk.png?generation=1535985821544175\&alt=media)

Scroll down to the **Java section** and select **Java (JDK) for Developers**.

![JDK Download](https://981283853-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEK-j-hxx7zCDNXfjra%2F-LLUss7C28VNjhw8iIx2%2F-LLUst9fchlfdv1ZCAPF%2Fstep5_jdk_download.png?generation=1535985819350722\&alt=media)

Now select **Download** below the Java symbol to download the latest stable version of the JDK (currently 10.0.2).

![Download](https://981283853-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEK-j-hxx7zCDNXfjra%2F-LLUss7C28VNjhw8iIx2%2F-LLUst9hwGaIK3SftfV8%2Fstep6_download.png?generation=1535985818777984\&alt=media)

Last you need to **accept the license agreement** and **download the Windows binary**.

![License and Windows binary](https://981283853-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEK-j-hxx7zCDNXfjra%2F-LLUss7C28VNjhw8iIx2%2F-LLUst9jAyPoZ6pAVS9c%2Fstep7_windows_binary.png?generation=1535985819997314\&alt=media)

### JDK Installation Wizard

Once fully downloaded you can start the installation wizard. Click **Next** to continue.

![The Installation Wizard](https://981283853-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEK-j-hxx7zCDNXfjra%2F-LMM8BBRvBMmSNFJiHEV%2F-LLUst9lW9_jbT47EWfR%2Fstep8_wizard.png?generation=1536912864360824\&alt=media)

**Keep the default selected features** and click _Next_.

![Default Features to Install](https://981283853-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEK-j-hxx7zCDNXfjra%2F-LMM8BBRvBMmSNFJiHEV%2F-LLUst9nBQd-Xk_3qJT7%2Fstep9_features.png?generation=1536912864391965\&alt=media)

Be sure to make a note of where the JDK is being installed. We need it later on.

Clicking **Next** will open the JRE (Java Runtime Environment) install wizard.

Leave the Java path as is and click **Next**.

![Keep the default path](https://981283853-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEK-j-hxx7zCDNXfjra%2F-LMM8BBRvBMmSNFJiHEV%2F-LLUst9pDaCxdbQLu6nW%2Fstep10_path.png?generation=1536912864314572\&alt=media)

The installation should end successfully.

![Keep the default path](https://981283853-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEK-j-hxx7zCDNXfjra%2F-LMM8BBRvBMmSNFJiHEV%2F-LLUst9rhprrmpLBfOD1%2Fstep11_finished.png?generation=1536912864402211\&alt=media)

Click **Close** to finish the installation.

### Downloading NetBeans

Currently the latest version of NetBeans is not available as an installer. It can only be downloaded as an extractable zip file. This is because NetBeans is trying to join the Apache Software Foundation (ASF) and is currently undergoing incubation.

To fetch the binaries, navigate to [http://netbeans.apache.org/](http://netbeans.apache.org/) and select **Download**.

![Downloads](https://981283853-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEK-j-hxx7zCDNXfjra%2F-LLUss7C28VNjhw8iIx2%2F-LL4EY46tnSm8MsVXomi%2Fstep1_website.png?generation=1535985818879143\&alt=media)

Navigate to the "Downloads" section and click the link for **Binaries**.

![Binaries](https://981283853-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEK-j-hxx7zCDNXfjra%2F-LLUss7C28VNjhw8iIx2%2F-LL4EY48iIr3IaEkP6gx%2Fstep2_downloads.png?generation=1535985814932130\&alt=media)

Select the **default mirror** to download the zip-file from. If your download does not start, try another mirror.

![Select download mirror](https://981283853-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEK-j-hxx7zCDNXfjra%2F-LLUss7C28VNjhw8iIx2%2F-LLUst9t67nxxn2tRYd5%2Fstep3_mirror.png?generation=1535985819509764\&alt=media)

### Extracting NetBeans

Once the download is finished, extract the zip-file where you downloaded it. You should get a directory or subdirectory called `netbeans`. Move it to your _c-drive_, `C:\Program Files` or somewhere else where you install your applications.

Once moved, create a shortcut (drag `netbeans64.exe` and hold `ALT` or right click and select `Create shortcut`) from `netbeans/bin/netbeans64.exe` to your desktop or start-menu. **Right click** the shortcut and select **Properties**.

Select the **Shortcut** tab and add the java JDK path behind the name of the target as shown below:

```
"C:\Program Files\netbeans\bin\netbeans64.exe" --jdkhome "C:\Program Files\Java\jdk-10.0.2"
```

![Shortcut Properties](https://981283853-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEK-j-hxx7zCDNXfjra%2F-LMM8BBRvBMmSNFJiHEV%2F-LLUst9viJxqyEJRrqjh%2Fshortcut_java_home.png?generation=1536912864408047\&alt=media)

Once added, hit **Apply** and **OK** to save the shortcut.

## Test installation

To test if your installation was successful launch the NetBeans IDE via the created shortcut. First time launching you should get the license agreement screen. Accept it.

![License Agreement](https://981283853-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEK-j-hxx7zCDNXfjra%2F-LMM8BBRvBMmSNFJiHEV%2F-LLUst9xhh0p3NK8fbqd%2Fstep12_license.png?generation=1536912864412134\&alt=media)

Let us create a simple "Hello World" application in Java. Start by navigating to `File => New Project`. Make sure you selected `Java - Java Application`. Click **Next**.

![Creating a new Java Application](https://981283853-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEK-j-hxx7zCDNXfjra%2F-LLUss7C28VNjhw8iIx2%2F-LL4EY4UwLXMkPEmOlZX%2Fstep13_new_project.png?generation=1535985817410498\&alt=media)

Give your application a decent name such as "HelloWorldInJava". For the moment you can leave the default project location as is and click **Finish**.

![Project Name](https://981283853-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEK-j-hxx7zCDNXfjra%2F-LLUss7C28VNjhw8iIx2%2F-LL4EY4WW3TDMc_g-w0j%2Fstep14_project_name.png?generation=1535985814427433\&alt=media)

Now you should see a code window with some readily generated Java code.

![Blank Project](https://981283853-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEK-j-hxx7zCDNXfjra%2F-LLUss7C28VNjhw8iIx2%2F-LL4EY4YEmV96j3hCG4N%2Fstep15_blank_project.png?generation=1535985814473218\&alt=media)

This however does not do anything. To make the program say hello to the world you should change the code between the curly braces `{}` as shown below.

```java
public class HelloWorldInJava {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // Say hello world in Java
        System.out.println("Hello World!");
    }

}
```

![Hello World in Java Code](https://981283853-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEK-j-hxx7zCDNXfjra%2F-LLUss7C28VNjhw8iIx2%2F-LL4EY4_e3TIeDMxRgDt%2Fstep16_hello_world_in_java.png?generation=1535985815697591\&alt=media)

Next hit the big green play button in NetBeans or press `F6` on your keyboard to run the program. You should see the message at the bottom of the screen in the terminal window.

![](https://981283853-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEK-j-hxx7zCDNXfjra%2F-LL4EVa4libM96oMBXqa%2F-LL4EY4brO1pL_WrL9TK%2Fstep17_hello_world.png?generation=1535538791360179\&alt=media)

Well you are of to conquer the world with your program skills. Happy hacking.
