[
https://issues.apache.org/jira/browse/NETBEANS-2452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16831197#comment-16831197
]
Jamey Vassilev commented on NETBEANS-2452:
------------------------------------------
I found a workaround.
For me the -Xbootclasspath option was in a conditional statement that was
setting property endorsed.classpath.cmd.line.arg to
-Xbootclasspath/p:'${toString:endorsed.classpath.path}'
Putting
{code:java}
<property name="endorsed.classpath.cmd.line.arg" value="--patch-module
java.base='${toString:endorsed.classpath.path}'"/>
{code}
in the projects 'build.xml' file just above the ending project tag instead of
the "build-impl.xml" got it working.
My exact line in build-impl.xml was:
{code:java}
<condition else="" property="endorsed.classpath.cmd.line.arg"
value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
<and>
<isset property="endorsed.classpath"/>
<length length="0" string="${endorsed.classpath}"
when="greater"/>
</and>
</condition>
{code}
So instead of setting that property as mentioned above without the condition, I
went ahead and put it in build.xml as
{code:java}
<condition else="" property="endorsed.classpath.cmd.line.arg"
value="--patch-module java.base='${toString:endorsed.classpath.path}'">
<and>
<isset property="endorsed.classpath"/>
<not>
<equals arg1="${endorsed.classpath}" arg2="" trim="true"/>
</not>
</and>
</condition>{code}
seems to work and retain the ability to do a clean and build even after
modifying the project's properties.
Note: The build-impl.xml file does warn not to edit it, but rather edit the
build.xml file.
This is a workaround, so would be nice if build-impl.xml was created with the
--patch-module switch instead of the -Xbootclasspath/p: when using a jdk that
doesn't support the -Xbootclasspath
> -Xbootclasspath/p is no longer a supported option
> -------------------------------------------------
>
> Key: NETBEANS-2452
> URL: https://issues.apache.org/jira/browse/NETBEANS-2452
> Project: NetBeans
> Issue Type: Bug
> Components: java - Compiler, java - Platform, projects - Ant
> Affects Versions: 9.0, 10.0, 11.0
> Environment: OpenJDK 11
> Reporter: Emile Brinkman
> Assignee: Emile Brinkman
> Priority: Major
> Labels: patch
> Fix For: 11.0
>
>
> I have upgraded from NetBeans 8.2 and JDK1.8 to Apache NetBeans 11.0 and
> OpenJDK 11. The Xbootclasspath option is no longer supported bij JDK11 and
> apparently has to be changed to --patch-module. It is however still used in
> the ANT build-impl.xml file under endorsed.classpath.path. The problem is
> that if you change "-Xbootclasspath/p:" to "-patch module java.base=" that
> NetBeans automatically overwrites it back to "-Xbootclasspath/p" when you
> change properties of a project. -Xbootclasspath/a and -Xbootclasspath also
> don't work.
> I also get the following error when running a class even when I changed
> everything to --patch module:
> {{-Xbootclasspath/p is no longer a supported option.}}
> {{Error: Could not create the Java Virtual Machine.}}
> {{Error: A fatal exception has occurred. Program will exit.}}
>
> {{C:\Users\user1\AppData\Local\NetBeans\Cache\11.0\executor-snippets\run.xml:111:
> The following error occurred while executing this line:}}
>
> {{C:\Users\user1\AppData\Local\NetBeans\Cache\11.0\executor-snippets\run.xml:94:
> Java returned: 1}}
> {{BUILD FAILED (total time: 0 seconds)}}
> Removing the cache folder doesn't help. I am not able anymore to run this
> class even when I change the Source/Binary format of the project back to
> JDK1.8. It seems that Apache NetBeans has hardcoded -Xbootclasspath
> internally?
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
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