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 240479 - "Keep JavaFX RT artifacts on class path" option is both broken and dangerous
Summary: "Keep JavaFX RT artifacts on class path" option is both broken and dangerous
Status: RESOLVED INVALID
Alias: None
Product: javafx
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.0
Hardware: Macintosh (x86) Mac OS X
: P3 normal (vote)
Assignee: Roman Svitanic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-14 23:35 UTC by swpalmer
Modified: 2014-01-20 11:05 UTC (History)
0 users

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 swpalmer 2014-01-14 23:35:28 UTC
Product Version: NetBeans IDE 8.0 Beta (Build 201401091443)
Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b65
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b123
System: Mac OS X version 10.9.1 running on x86_64; UTF-8; en_US (nb)


The intention of "Keep JavaFX RT artifacts on Compile Classpath if not present by default" (Project Properties->Build->Deployment) appears to be to add jfxrt.jar to the classpath in the jar manifest.  However jfxrt.jar does not end up in the lib folder, and several other JavaFX jars (javaws.jar, deploy.jar, plugin.jar) are explicitly excluded.

This feature is misguided though.  If the jfxrt.jar is copied to the lib folder and placed on the class path it will create a potential mismatch between the java code and the native code of JavaFX because the default action on Java 7 would be to use the provided jfxrt.jar from the lib folder, but load the native libraries from the JRE folders.  If the JRE at runtime is not the same as the JRE at build time the native libraries and the java libraries may be incompatible.

I believe there are releases of Java 7 where this will be the case.

I suggest removing this feature altogether.  JavaFX projects should be used, or a different strategy should be used to get jfxrt.jar onto the class path for JRE 7 to ensure the native libraries match.
Comment 1 swpalmer 2014-01-15 00:45:33 UTC
Perhaps I am misunderstanding the intent of this feature.

Is it intended to only keep the javafx class on the COMPILE classpath for when you are using Java 7 ?  Therefore allowing you to deal with getting it on the runtime class path in your own code.  We do something like this with one of our products where we hack jfxrt.jar onto the classpath at runtime in a J2SE project because we are not using the JAvFX launcher (it's a Swing app with a JFXPanel).

If so it doesn't belong in the Deployment section.
Comment 2 Tomas Zezula 2014-01-15 17:21:59 UTC
Implemented in the JFX Project.
Comment 3 Roman Svitanic 2014-01-20 11:05:00 UTC
(In reply to swpalmer from comment #1)
> Is it intended to only keep the javafx class on the COMPILE classpath for
> when you are using Java 7 ?  Therefore allowing you to deal with getting it
> on the runtime class path in your own code.

You are right, option is labeled as "Keep JavaFX RT artifacts on Compile Classpath if not present by default". From this label it is obvious that this option affects only the compile classpath. Therefore I think on JDK7 it does what is expected.

> If so it doesn't belong in the Deployment section.

I agree, this may not be the most appropriate place to place this option, but this definitely won't be a P3 issue.