Hello,

I'm using NetBeans 12.2rc1 with AdoptOpenJDK 11.0.9+11. My projects still
need Java 8 so I've added a Java Platform JDK 1.8 that points to an
installed AdoptOpenJDK 8.0.272.10.

I've set my projects to use the JDK 1.8 platform. My project.properties for
each of them have the following entries after this (note that I added
javac.release=8 manually):

javac.release=8
javac.source=1.8
javac.target=1.8
platform.active=JDK_1.8

With this the project compiles and runs OK. However, one of the subprojects
gives the following warning when doing a Clean and Build:

warning: [options] bootstrap class path not set in conjunction with -source
8

I also have an ANT target in my build.xml to use ProGuard for obfuscating
the jar. My target looks as follows:

        <taskdef resource="proguard/ant/task.properties"
classpath="..\DeveloperTools\proguard\lib\proguard.jar"/>
        <echo message="Running ProGuard to obfuscate the jar..."/>
        <proguard configuration="myproject.pro">
            <libraryjar path="${platforms.JDK_1.8.home}/jre/lib/rt.jar"/>
            <libraryjar path="${platforms.JDK_1.8.home}/jre/lib/jce.jar"/>
        </proguard>
        <echo message="Done."/>

When I run this target I get the following error message:

Warning: MappedPCAPFile: can't find referenced method 'java.nio.ByteBuffer
position(int)' in library class java.nio.ByteBuffer
Warning: PCAPFile: can't find referenced method 'java.nio.ByteBuffer
rewind()' in library class java.nio.ByteBuffer

This seems to indicate that somehow the ANT task uses Java 11 and not the
specified JDK 1.8 platform. If I run all of this in NetBeans 8.2 with JDK
1.8 as the default platform everything works OK.

I don't want to run NetBeans 12.2 with JDK 1.8 as the default platform, as
that gives all kind of problems to do with nb-javac.

How can I fix my ANT task to also use JDK 1.8 (as specified in the
project.properties?

As a second question, why do the MANIFEST.MF files in the resulting jar
state "Created-By: 11.0.9+11 (AdoptOpenJDK)"? I would expect my JDK 1.8
platform to be used?

Greets,
    Humphrey.

-- 
In the mountains of truth, you never climb in vain - Nietzsche
#-------------------------------------------------------------
 \_O
,__/>
  <"
   '

Reply via email to