I’m trying to find the answer whether there is any differences in using Netbeans with Openjdk or not. Apparently, I found many links which reported that there is some glitches when using openjdk but when they working around or by updating the Openjdk version with the new release the glitches is gone. Some also discussing in the forums about the problems that arise when using Openjdk but when they switch to Oracle-jdk the problems is gone (of course, because it is the default requirement that mentioned in the documentation). This conditions is similar in setting up your Android development environment, you have to choose whether to use Openjdk or Oracle-jdk. Both are good to go and until now there is not much differences when using Openjdk or Oracle-jdk for Android development (see Setup Android Development in Korora/Fedora article).
On this matter my conclusion is like this. You can choose to use jdk between Openjdk or Oracle, but if you want to use Netbeans IDE when develop your applications and error free from the beginning when you start installing the Netbeans IDE, you should use Oracle-jdk and here is the link if you need to install Oracle-jdk. Otherwise, if you brave enough and not hesitate to made your hand dirty, use the default jdk which is come with your Linux distribution.
Now, here is the step by step guidance for installing the Netbeans 8.1 IDE on your Korora/Fedora system using Openjdk 1.8.0.
- Open your favorite browser and go to the Netbeans downloads site.
- Choose the Netbeans IDE that suitable with your needs, in this case I choose the Netbeans IDE for Java SE, and make sure you have the Openjdk packages is installed properly in your system.
- After the download process is finish, open your terminal and go to the download directory or the place that you choose for keeping all your download files. Then do this following command to make the netbeans-8.1-javase-linux.sh executable.
$ chmod +x netbeans-8.1-javase-linux.sh
- Execute the files by typing like this.
- It will gives you an installation window like the image below and then click the Next button.
- You have to accept the license agreement by ticking the “I accept….” check box then click the Next button.
- This step is the important part which is locating the Openjdk applications in your system. The Openjdk, by default in my system, was installed in the /usr/lib/jvm/ directory. It means that you have to change the options that I marked in the red box in the image below to point to the /usr/lib/jvm/ directory. Choose the right Openjdk version that installed in your system by typing /usr/lib/jvm and then click the down arrow near the Browse button. It will shows the installed Openjdk in your system (mine is java-1.8.0-openjdk-18.104.22.168-1.b15.fc22.x86_64).
If you not do that, you will get a warning window like this.
- To fix the warning just click Disable Modules and Continue button, wait until the installation process is finish then go to the Netbeans wiki like its state in the window warning and read the information about what you should do. The information is like the image below.
- According to the Netbeans Wiki, you need to go to the directory where the Netbeans was installed (in my system it was in /home/kris/netbeans-8.1). Go inside etc/ directory and open the netbeans.conf with text editor then scroll down until you see the netbeans_jdkhome options. Fill the options with the location of your Openjdk which will make the options become like this.
Save the configuration, exit from the text editor and execute the Netbeans with this command.
Done. Here is a screen shot of my Netbeans IDE that I successfully install and execute a simple java program.
Happy coding then….