10

So I want to set the default Java Platform which is used to build my projects in Netbeans 8.2 (netbeans_jdkhome).

Prior versions allowed me to do that see this answer.

The only problem is that I want to set this platform to be 1.7 (instead of current 1.8) but Netbeans 8.2 requires to run on 1.8 so I cannot have 1.7 as default Java Platform.

Is there any way to override it ?


EDIT:

PLEASE DO NOT UPVOTE LenglBoy ANSWER AS IT WAS EXACTLY WHAT I WAS NOT LOOKING FOR

His answer was in the link that I posted, he didn't even read my question. If anyone has a solution that works with latests versions of Netbeans, please post it.

Groben
  • 1,130
  • 2
  • 9
  • 27

3 Answers3

8

You can get your default JDK by: Tools - Java Plattforms. There you can add all your JDKs and watch their bibs. If you want to change the default one you need to go the path: C:\Program Files\NetBeans 8.2\etc and you need to change the netbeans.conf

In line 57 (in mine) you see something like this:

netbeans_jdkhome="C:\Program Files\Java\jdk1.8.0_66"

Change the Path to your wanted JDK and you´re finish.

Here a longer description.

LenglBoy
  • 1,225
  • 1
  • 9
  • 21
  • This is exactly what I said was not possible with netbeans 8.2 – Groben Dec 01 '16 at 12:05
  • Same situation but it worked. Netbeans running all new projects default java 1.8 and old ones with 1.7 and itself with 1.8, too. – LenglBoy Dec 01 '16 at 14:11
  • 1
    If you put 1.7 as your netbeans_jdkhome, netbeans doesn't start, it requires 1.8 – Groben Dec 02 '16 at 08:30
  • Excellent. Just to add that if you have write access privilege denied, then close NetBeans, right-click the netbeans.conf and choose properties, then choose the security tab and choose all users full access. That is of course if you are using Windows-based platform. – Mark Burleigh Aug 13 '18 at 17:54
3

For now, it appears there is no way to override it, here is NetBeans Help about Java Platform Manager:

Use to register different versions of the Java Development Kit (JDK) and other Java tools that your programs depend on. The dialog box lists all of your registered JDKs in the left pane and lists the JDK that the IDE is running on as the Default Platform.

So I'll have to change platform for each project because Netbeans 8.2 can not run with JDK 1.7 (so I can't set it as default platform).

LenglBoy didn't even read my question, the same thing was done in the link I posted.

There is a recent plugin that allows to right-click maven projects to set the JDK (still cannot set it by default).

Groben
  • 1,130
  • 2
  • 9
  • 27
0

There is no eclipse like default option. You can set java platform for every imported project. Change JRE in NetBeans project

Jovo Skorupan
  • 117
  • 1
  • 3