Bjoern Voigt created NETBEANS-6378:
--------------------------------------

             Summary: Unable to use JEP 247 with ANT projects: error: option 
-source cannot be used together with --release
                 Key: NETBEANS-6378
                 URL: https://issues.apache.org/jira/browse/NETBEANS-6378
             Project: NetBeans
          Issue Type: Bug
          Components: core, java - Compiler
    Affects Versions: 12.5
            Reporter: Bjoern Voigt


[JEP 247|https://openjdk.java.net/jeps/247] enhances {{javac}} so that it can 
compile Java programs to run on selected older versions of the platform.

If for instance {{javac}} from JDK 17 should compile a program for Java 8 
compatibility, then the following command line is suitable:
{code:java}
javac --release 8 Main.java{code}
The --release option can be specified in Netbeans projects here: Build -> 
Compiling -> Additional Compiler Options.

Unfortunately the --release option results in build errors, at least with 
Netbeans ANT projects:
{code:java}
error: option -source cannot be used together with --release{code}
The full build log:
{code:java}
ant -f /tmp/NetBeansProjects/JavaApplication9 -Dnb.internal.action.name=rebuild 
clean jar
init:
deps-clean:
Updating property file: 
/tmp/NetBeansProjects/JavaApplication9/build/built-clean.properties
Deleting directory /tmp/NetBeansProjects/JavaApplication9/build
clean:
init:
deps-jar:
Created dir: /tmp/NetBeansProjects/JavaApplication9/build
Updating property file: 
/tmp/NetBeansProjects/JavaApplication9/build/built-jar.properties
Created dir: /tmp/NetBeansProjects/JavaApplication9/build/classes
Created dir: /tmp/NetBeansProjects/JavaApplication9/build/empty
Created dir: 
/tmp/NetBeansProjects/JavaApplication9/build/generated-sources/ap-source-output
Compiling 2 source files to /tmp/NetBeansProjects/JavaApplication9/build/classes
error: option -source cannot be used together with --release
error: option -target cannot be used together with --release
Usage: javac <options> <source files>
use --help for a list of possible options
BUILD FAILED (total time: 0 seconds)
 

{code}
 

 

 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to