Introduction
This is an article where the main focus is just to configure Java Runtime Environment for Netbeans IDE. Just make sure that any version of Java Development Kit (JDK) or any Java Runtime Environment (JRE) exist in the machine. Download and install it first if there isn’t any of them available in the machine. The machine is using Microsoft Windows 10. Furthermore, in this case, it is using a compressed format file of Netbeans IDE as the installer.
Add Java Runtime Environment Configuration in Netbeans IDE
So, the following is actually the steps for doing it :
-
First of all, just try to run the Netbeans IDE. Actually, there will be a specific error message appear informing that there is no Java Runtime Environment configured and attached to the Netbeans IDE. So, before Netbeans IDE can run properly, the Netbeans IDE must recognize the Java Runtime Environment exist in the machine. In other hands, something must be done to the Netbeans IDE so it can recognize where it is.
-
After making sure that the Java Development Kit (JDK) or Java Runtime Environment (JRE) is actually exist, just introduce it to the Netbeans IDE. In this context, the Netbeans IDE is Netbeans 8.2. In this version, there is a simple way to do that. Try to look at the root folder of the Netbeans IDE. For an example, it is in ‘C:\netbeans-8.2’. The configuration file for recognizing the Java Development Kit (JDK) or Java Runtime Environment (JRE) will be available in the ‘etc’ folder inside of it. In summary, the location in this example is ‘C:\netbeans-8.2\etc’. Inside of that folder, there is a file with the name of ‘netbeans.conf’. Open the file for further configuration.
-
In that file, it is a file with the full path location of ‘C:\netbeans-8.2\etc\netbeans.conf’ for an example in this context. There is a specific part from the content which is pointing out to it as follows :
# Default location of JDK: # (set by installer or commented out if launcher should decide) # # It can be overridden on command line by using --jdkhome <dir> # Be careful when changing jdkhome. # There are two NetBeans launchers for Windows (32-bit and 64-bit) and # installer points to one of those in the NetBeans application shortcut # based on the Java version selected at installation time. # #netbeans_jdkhome="/usr/lib/jvm/java-8-oracle"
If there is a Java Development Kit (JDK) available in the machine, for an example ‘C:\Program Files\Java\jdk1.8.0_181’, just add a new line following after the last commented part with the variable name of ‘netbeans_jdkhome’. So, the overall configuration will be exist as follows :
# Default location of JDK: # (set by installer or commented out if launcher should decide) # # It can be overridden on command line by using --jdkhome <dir> # Be careful when changing jdkhome. # There are two NetBeans launchers for Windows (32-bit and 64-bit) and # installer points to one of those in the NetBeans application shortcut # based on the Java version selected at installation time. # #netbeans_jdkhome="/usr/lib/jvm/java-8-oracle" netbeans_jdkhome="C:\Program Files\Java\jdk1.8.0_181"
-
Last but not least, just execute the Netbeans IDE once more. If there is no error message appear, the Netbeans IDE will run properly.