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 251957 - can not build main-silver with jdk8
Summary: can not build main-silver with jdk8
Status: RESOLVED FIXED
Alias: None
Product: www
Classification: Unclassified
Component: Builds & Repositories (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P2 normal with 3 votes (vote)
Assignee: pgebauer
URL:
Keywords:
Depends on: 250848
Blocks:
  Show dependency tree
 
Reported: 2015-04-20 17:46 UTC by err
Modified: 2015-12-01 13:33 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
fix for the build on windows (741 bytes, patch)
2015-10-07 13:12 UTC, skygo
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description err 2015-04-20 17:46:19 UTC
It is impossible to build the NB with jdk1.8. I'm seeing two different
failures, one when JAVA_HOME is jdk1.7, the other JAVA_HOME is jdk1.8.

Why/how does JAVA_HOME affect the result of the build?
In other words, what does "nbjdk.home" do?

Given:
    $ cat nbbuild/user.build.properties
    cluster.config=basic

    nbjdk.home=C:/b/j/Java/jdk1.8.0_40
    permit.jdk8.builds=true


=== JAVA_HOME JDK1.8 FAILURE ===
(note: this is the same failure as in issue #250848)

 [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
 [nb-javac] C:\f\repos\main-silver\javascript2.editor\src\org\netbeans\modules\javascript2\editor\model\impl\PathNodeVisitor.java:99: error: method does not override or implement a method from a supertype


=== JAVA_HOME JDK1.7 FAILURE ===
(note: this fails much faster than when JAVA_HOME is 1.8)
(note: every compile gets the "major version 52 is newer than 51' error)


compile:
    [mkdir] Created dir: C:\f\repos\main-silver\api.search\build\classes
 [nb-javac] Compiling 122 source files to C:\f\repos\main-silver\api.search\build\classes
   [repeat] warning: C:\b\j\Java\latest\jre\lib\rt.jar(java/util/regex/Pattern.class): major version 52 is newer than 51, the highest major version supported by this compiler.
   [repeat]   It is recommended that the compiler be upgraded.
   ...
   [repeat] C:\f\repos\main-silver\api.search\src\org\netbeans\modules\search\ArraySet.java:74: error: name clash: spliterator() in ArrayList and spliterator() in Set have the same erasure, yet neither overrides the other
   [repeat] public class ArraySet<E extends Comparable<E>>
   [repeat]        ^
   [repeat]   where E#1,E#2 are type-variables:
   [repeat]     E#1 extends Object declared in class ArrayList
   [repeat]     E#2 extends Object declared in interface Set
   [repeat] Note: Some input files additionally use or override a deprecated API.
   [repeat] 1 error
   [repeat] 100 warnings
  [nbmerge] Failed to build target: all-api.search
Comment 1 Antonin Nebuzelsky 2015-07-10 14:28:52 UTC
Make sure to also have the JDK8 javac on PATH and it works.
Comment 2 err 2015-07-11 15:16:19 UTC
(In reply to Antonin Nebuzelsky from comment #1)
> Make sure to also have the JDK8 javac on PATH and it works.

Would you clarify as to why this is required? 

And why isn't it a WONTFIX rather than WORKSFORME?
Comment 3 err 2015-07-11 15:42:38 UTC
I added javac to the path, still fails.

$ uname -a
CYGWIN_NT-6.1 spirit 1.7.30(0.272/5/3) 2014-05-23 10:36 x86_64 Cygwin

$ echo $JAVA_HOME
/b/j/Java/latest

$ which javac
/b/j/Java/latest/bin/javac

$ ls -l /b/j/Java/latest
lrwxrwxrwx 1 err None 11 Mar 13 08:24 /b/j/Java/latest -> jdk1.8.0_40

$ echo $PATH
/err/bin:/usr/local/bin:/usr/bin:/cygdrive/c/ProgramData/Oracle/Java/javapath:/pf/Windows Resource Kits/Tools:.......:/pf/TortoiseHg:/pf/Skype/Phone:/usr/lib/lapack:/b/j/Java/latest/bin

$ cat nbbuild/user.build.properties

cluster.config=basic

nbjdk.home=C:/b/j/Java/latest
permit.jdk8.builds=true


BTW, the page http://wiki.netbeans.org/WorkingWithNetBeansSources makes no mention of this requirement.
Comment 4 Antonin Nebuzelsky 2015-07-13 11:15:19 UTC
(In reply to err from comment #3)
> I added javac to the path, still fails.

Did you "ant clean" before retrying "ant build"?
Comment 5 err 2015-07-13 15:46:38 UTC
(In reply to Antonin Nebuzelsky from comment #4)
> (In reply to err from comment #3)
> > I added javac to the path, still fails.
> 
> Did you "ant clean" before retrying "ant build"?

Yes.

I just tried again, with JAVA_HOME both ways.
It fails as in the initial report.
Comment 6 pgebauer 2015-09-22 13:19:47 UTC
I can build main-silver with jdk8 on our linux build machine without problems. The issue is very likely related to the reporter's local JDK setup.

I will try to reproduce the issue on Windows.
Comment 7 skygo 2015-09-23 16:08:37 UTC
hi, I try it on fedora linux 22 and windows with same ant 1.9.4 jdk 7_80 and jdk 8_60

running on jdk7 -> 
 targeting 1.7 
  windows and linux build OK

 targeting 1.8
  both build fail on the erasure issue

running on jdk8 ->
  targeting 1.8
   linux pass
   windows on error because of nashhorn.


PS on fedora default ant install some libs are missing (need a full ant)
Comment 8 skygo 2015-10-07 13:12:00 UTC
Created attachment 156590 [details]
fix for the build on windows

The project properties were not compatible with windows build.
I put same configuration as in other modules 
using ${nb_all} and ${path.separator}

Regards
Comment 9 err 2015-10-07 15:10:47 UTC
Since the problem is NOT
    "related to the reporter's local JDK setup"
as suggested in comment #6, and further analysis done by @skygo shows a possible fix, setting the priority back to 2.
Comment 10 err 2015-10-07 15:16:18 UTC
See bug # 250848, this bug /may/ be a dup of that one, or depend on it or something.
Comment 11 skygo 2015-12-01 13:33:14 UTC
Solved during on jdk9 branch
 bootstrap path could not be build nevertheless java_home settings due to usage of linux specific path separator

jet-main#75112bea32f9