Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting JRE in Netbeans

Tags:

java

netbeans

I have JDK 1.6, JRE6 and JRE7 (64-bit & 32-bit) installed in my PC.

I am using Netbeans 7.3 BETA 2 and it is using JDK 6 and JRE 6.

I want to change it to JRE7. How can i achieve this ?

I have checked in Stackoverflow itself and found that we have to change the netbeans.conf file content for the netbeans_jdkhome value to the path of new Java path.

In another stackoverflow question, I found How to specify which JRE to use in Netbeans?.

But, in this also, I am not able to find how to get this resolved. Can anybody help on this ?

My installation path is as follows,

JDK6 path - C:\Program Files (x86)\Java\jdk1.6.0_31

JRE6 path - C:\Program Files (x86)\Java\jre6

JRE7 path - C:\Program Files (x86)\Java\jre7 (32-bit)

JRE7 path - C:\Program Files\Java\jre7 (64-bit)

Thanks in advance.

like image 410
Dinesh Avatar asked Jul 12 '13 07:07

Dinesh


People also ask

How do I change the Java Runtime version in NetBeans?

Modify compiler version for a project on NetBeansRight-click on project, go to Properties. Go to “Sources”, then “Sources/Binary Format” and choose the corresponding JDK version (I had to).

How set JDK location in NetBeans?

The Apache NetBeans IDE will run under the specified JDK. So to change JDK for NetBeans, to update the netbeans_jdkhome property in the netbeans. conf file which can be found under installation directory > netbeans > etc directory.

Where is JRE location?

The default installation directory of a static JRE is C:\Program Files (x86)\Java\jre n (for 32-bit versions) or C:\Program Files\Java\jre n (for 64-bit versions), where n is the full Java SE release and update number (for example, n = 1.8.


1 Answers

Goto Tools -> Platforms

enter image description here

Click "Add Platform", browse to the location where the JDK you want to add is installed....

enter image description here

Click on the JDK you want to add and select "Finish"

Updating projects

You can change the platform that projects use, by right clicking the project node and selecting properties and selecting Libraries. Here you change the platform that the project will use to build the classes with.

enter image description here

You can also change the source/binary format (version) which Netbeans is expecting to use. For example, you use JDK 7, but build/develop for Java 6

enter image description here

Changing the JDK that Netbeans itself uses to run

Goto {install/location/of/Netbeans}/etc and open the netbeans.conf.

There is a property called netbeans_jdkhome (it was towards the end of my file). You change this to what ever JDK you want Netbeans to be launched with

like image 116
MadProgrammer Avatar answered Oct 10 '22 19:10

MadProgrammer