This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 250848 - main-silver compile fails; uses wrong library because of JAVA_HOME
Summary: main-silver compile fails; uses wrong library because of JAVA_HOME
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks: 251957
  Show dependency tree
 
Reported: 2015-03-03 00:50 UTC by err
Modified: 2015-11-03 20:45 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description err 2015-03-03 00:50:33 UTC
The problem was the JAVA_HOME environment variable. Given

    $ cat nbbuild/user.build.properties
    cluster.config=basic
    nbjdk.home=C:/b/j/Java/jdk1.7.0_60

It WORKS with JAVA_HOME set as

    $ echo $JAVA_HOME
    /b/j/Java/jdk1.7.0_60

If FAILS with

    $ echo $JAVA_HOME
    /b/j/Java/latest
    $ ls -l /b/j/Java/latest
    lrwxrwxrwx 1 err None 11 Feb  6 14:35 /b/j/Java/latest -> jdk1.8.0_31/

Does the problem has to do with ant, javac or NB? What's the meaning of setting nbjdk.home? (BTW, it failed around halfway through the build)

The issue is certainly nashorn library, some looking around I found the source for openjdk8-nashorn, and if the NB build was using the jkd8 nashorn, then I would expect the error. Why is it using nashorn from JAVA_HOME and not from main-silver/libs.nashorn during compilation? The one in main-silver seems to have some patches applied.

Here is the failure I was getting
 [nb-javac] C:\f\repos\main-silver\javascript2.editor\src\org\netbeans\modules\javascript2\editor\model\impl\PathNodeVisitor.java:84: error: constructor NodeVisitor in class NodeVisitor<T> cannot be applied to given types;
 [nb-javac] public class PathNodeVisitor extends NodeVisitor {
 [nb-javac]        ^
 [nb-javac]   required: LexicalContext
 [nb-javac]   found: no arguments
 [nb-javac]   reason: actual and formal argument lists differ in length
 [nb-javac]   where T is a type-variable:
 [nb-javac]     T extends LexicalContext declared in class NodeVisitor
Comment 1 err 2015-03-03 23:37:00 UTC
Forgot to mention:

$ ant -version
Apache Ant(TM) version 1.9.3 compiled on December 23 2013

System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)

$ /b/j/Java/latest/bin/java -version
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

$ /b/j/Java/jdk1.7.0_60/bin/java -version
java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)
Comment 2 skygo 2015-10-07 13:50:57 UTC
Hi, sorry Iattach to the issue #251957 the fix for the javascript2.editor. And the fix concern more the module itself than the nb build system.

project.properties was too unix centric.

nbproject/project.properties should be changed to the following:

nashorn.prepend=${nb_all}/libs.nashorn/external/nashorn-02f810c26ff9-patched.jar
bootclasspath.prepend=${nashorn.prepend}${path.separator}${nb_all}/libs.nashorn/external/asm-all-4.0.jar