You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Rangi Keen (Jira)" <ji...@apache.org> on 2019/11/15 16:19:00 UTC

[jira] [Commented] (NETBEANS-3390) Presence of java.lang.Module causes build path errors in Eclipse

    [ https://issues.apache.org/jira/browse/NETBEANS-3390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16975213#comment-16975213 ] 

Rangi Keen commented on NETBEANS-3390:
--------------------------------------

Building with JDK 11 first requires that you build the {{nbbuild/external/vanilla-javac-*.jar}} archives. When you have {{$JAVA_HOME}} set to JDK 11, these will fail to compile with errors similar to
{quote}package sun.reflect.annotation is declared in module java.base, which does not export it to module java.compiler}}
{quote}
As such, you need to first compile these using JDK 8 before compiling the rest of the platform with JDK 11:
{code:java}
JAVA_HOME=<path to JDK 8> ant prepare-vanilla-javac
{code}
For reference, it appears the vanilla javac target was added as part of [an experiment on using javac from JDK for source code modeling|https://github.com/apache/netbeans/commit/ffc0de5a17b88ced95a0bd5b89175108701f86a0].

> Presence of java.lang.Module causes build path errors in Eclipse
> ----------------------------------------------------------------
>
>                 Key: NETBEANS-3390
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-3390
>             Project: NetBeans
>          Issue Type: Bug
>          Components: platform - Launchers&amp;CLI
>    Affects Versions: 10.0, 11.0, 11.1, 11.2
>            Reporter: Rangi Keen
>            Priority: Major
>
> To reproduce:
> * Create a Java project in Eclipse 2019-09 (and probably also 2019-06)
> * Add a dependency on {{org.netbeans.modules:org-netbeans-bootstrap}}
> * Build the project in Eclipse
> You'll see the following in the problems window:
> bq. The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project
> In the Eclipse log file, there are many errors similar to the following:
> bq. MESSAGE Compile error during code evaluation: The package java.lang is accessible from more than one module: <unnamed>, java.base
> This appears to be due to the addition of {{java.lang.Module}} in {{o.n.bootstrap}} as part of [JDK 9 instrumentation support|https://github.com/apache/netbeans/commit/4325e6ca3600c7234072df38ce50ff8c69172343].
> Removing this file and building/running with JDK 11 resolves the issue.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

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