Hi all,

I'm new here, and also to Java development, so please bear with me if I ask any 
stupid question :) Currently I'm looking around NetBeans ecosystem, trying to 
figure it out, in hope to implement a few improvements to help me in my work, 
and if successful, also to contribute these to the general public.

I've found this page, from which I assumed that NetBeans may be built either 
from command line or NetBeans itself:

https://cwiki.apache.org/confluence/display/NETBEANS/Development+Environment

I've been having some troubles making it work though. With NetBeans 11.0 I was 
unable to build using the CLI, which made me look deeper and discover the 
NetBeans Build System project and that the build was successful if I ran it 
from NetBeans instead of CLI. I wasn't able to figure out what was the 
difference, but I was happy since building from NetBeans seemed more 
comfortable to me. However after NetBeans 11.1 release and me pulling the 
latest changes from master, that has changed. Now I seem to be able to build 
only from CLI, but not from NetBeans and I can't see what am I doing wrong. I 
haven't installed any other JDK or Ant versions in between.

I would really like to be able to build from NetBeans. I think there must be 
something in my setup that I'm missing and I'd like to understand what the 
issue is before I can focus on the issues I was trying to get to in the first 
place.


I have both JDK 1.8.0 and 12.0.1 installed (NetBeans runs with the latter), and 
I've configured the build properties to use 1.8 as advised by the build script 
(without this option the build stops at the very beginning with a message 
saying to either add this or another option to permit JDK 1.9+ builds):

    nbjdk.home=c:\\Program Files\\Java\\jdk1.8.0_212

My Ant is version 1.10.6 (I noticed NetBeans comes with its own Ant of a 
slightly different version) and I have an environment variable that seems to 
make it use the correct JDK:

    JAVA_HOME=c:\Program Files\Java\jdk1.8.0_212\

When I try to build from NetBeans, it always fails at openide.util module, the 
build log ends with lines similar to these (varies depending on whether the 
build is full or just one module)

...
100 warnings
...
...
Compiling 39 source files to 
C:\Workspace\Netbeans\platform\openide.util\build\test\unit\classes
error: Source option 6 is no longer supported. Use 7 or later.
error: Target option 6 is no longer supported. Use 7 or later.
C:\Workspace\Netbeans\nbbuild\templates\common.xml:587: The following error 
occurred while executing this line:
C:\Workspace\Netbeans\nbbuild\templates\common.xml:583: The following error 
occurred while executing this line:
C:\Workspace\Netbeans\nbbuild\templates\common.xml:637: The following error 
occurred while executing this line:
C:\Workspace\Netbeans\nbbuild\templates\common.xml:615: Compile failed; see the 
compiler error output for details.
BUILD FAILED (total time: 23 seconds)

By adding an echo task to the file mentioned, I got the details of the failing 
build task:

    <nb-javac srcdir="C:\Workspace\Netbeans\platform\openide.util\test\unit\src"
            
destdir="C:\Workspace\Netbeans\platform\openide.util\build\test\unit\classes"
            excludes="" debug="true" deprecation="true" encoding="UTF-8"
            source="1.6" target="1.6" optimize="off" includeantruntime="false">
        <classpath refid="test.unit.cp"/>
        <compilerarg line="-Xlint -Xlint:-serial"/>
        <processorpath refid="test.unit.cp"/>
    </nb-javac>

Any advice appreciated!

Reply via email to