Re: JDK version issue in NetBeans

Svata Dedic
 

Dne 16. 10. 19 v 20:58 Andrew Crosland napsal(a):
start of a clean build I see a warning:
"ant -f D:\\JMRI\\nbproject\\nbjdk.xml clean debug
Warning: nbjdk.active=JDK_1.8 or nbjdk.home=${platforms.JDK_1.8.home} is an invalid Java platform; ignoring and using C:\Program
Your project is set up to look for Java Platform named "JDK 1.8" (the space is replaced by underscore for setting persistence). The default JDK used to run NetBeans IDE may be present, but has a different (builtin, fixed) name, so it does not count.

Add any JDK8 with that name (Tools > Java Platforms) to your NetBeans IDE.

The way how the project is set up today does not allow to override versioned
nbproject/nbjdk.properties
with your private defaults; the versioned property file is loaded first, the (local) user build properties later. Ant only honours first definition of the property.

The project seems to build OK, at the end of the process I see this warning, which I am guessing is related:
"warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.openide.util.ServiceProviderProcessor' less than -source '1.8'"
You can't do anything about it in JMRI, but it can be done in Apache NetBeans project (JMRI uses org.openide.lookup library). The annotation processor could (finally !!) declare RELEASE_8, as NetBeans already supports just JDK8+ for compilation.

-Svata

Join jmri@jmri-developers.groups.io to automatically receive all group messages.