NetBeans with Oracle Java

This semester, I took two classes with a professor who really likes Java. All the content is taught in Java, and in addition, some plugins we use for testing only exist in NetBeans. In class, this is not a problem because all the computers in the labs have NetBeans installed, but to study at home and do assignments, I needed to install it on my laptop.

During the installation of NetBeans on Arch Linux, I had to choose to install some open-source version of Java:

julio@julio-acer ~> sudo pacman -S netbeans
resolving dependencies...
:: There are 2 providers available for java-environment:
:: Repository extra
   1) jdk7-openjdk  2) openjdk6

Enter a number (default=1):

Unfortunately, I couldn’t do that because Banco do Brasil requires that I have the proprietary Oracle Java to access the site, and it’s not possible to install both versions simultaneously*.

To solve this problem, just install the JRE and JDK from AUR and install NetBeans ignoring the dependencies:

julio@julio-acer ~> sudo pacman --nodeps --nodeps -S netbeans
looking for inter-conflicts...
Targets (1): netbeans-7.1.1-1
Total Installed Size:   500.73 MiB
Proceed with installation? [Y/n]

And there you go, NetBeans should work with Oracle Java.

Observations:

  1. If you try to create a new Java project through NetBeans and encounter the following error:

    The JDK is missing and is required to run some NetBeans modules. Please use the –jdkhome command line option to specify a JDK installation or see http://wiki.netbeans.org/FaqRunningOnJre for more information.

    It’s because you probably only have the JRE. To run NetBeans, you also need to install the JDK, available in the AUR.

    Install the JDK and log off and log in to include it in the $PATH.

  2. If you use a tiling window manager like Awesome, when you open NetBeans only a gray screen will appear. To fix this issue, run the following command:

    julio@julio-acer ~> wmname LG3D
    
  3. The same applies to Eclipse


* You may have the jdk7-compat, but keeping two versions of Java on your computer is a waste of space.

Julio Batista Silva
Julio Batista Silva
Data Engineer

I’m a computer engineer passionate about science, technology, photography, and languages. Currently working as a Data Engineer in Germany.

comments powered by Disqus