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 239673 - [80cat] Maven JavaFX project shows false errors in Java editor when compile set to JDK 1.7u45
Summary: [80cat] Maven JavaFX project shows false errors in Java editor when compile s...
Status: VERIFIED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.0
Hardware: PC Windows 8
: P3 normal (vote)
Assignee: Milos Kleint
URL:
Keywords:
: 239996 240097 (view as bug list)
Depends on: 240105
Blocks: 240097
  Show dependency tree
 
Reported: 2013-12-20 05:49 UTC by Lou Dasaro
Modified: 2014-01-21 02:29 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Shows the errors after changing the platform to JDK 1.7u45 (187.62 KB, image/jpeg)
2013-12-20 05:49 UTC, Lou Dasaro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lou Dasaro 2013-12-20 05:49:52 UTC
Created attachment 143353 [details]
Shows the errors after changing the platform to JDK 1.7u45

On NetBeans running on JDK 8, After creating a new Maven JavaFX project, go to Project Properties->Build->Compile and change the Java Platform to 1.7u45.

The code builds and runs fine, but numerous errors appear in the editor windows See Attachment #1 [details]. 

Changing the Java Platform back to 1.8 causes the errors in the editor windows to disappear.

Environment:
Product Version: NetBeans IDE Dev (Build 201312190002)
Java: 1.8.0-ea; Java HotSpot(TM) Client VM 25.0-b62
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b120
System: Windows 8 version 6.2 running on x86; Cp1252; en_US (nb)
Comment 1 Lou Dasaro 2013-12-20 05:53:24 UTC
Sorry, I meant "numerous errors appear in the editor windows. See attachment 143353 [details] "
Comment 2 Lou Dasaro 2013-12-20 06:40:50 UTC
Seems related to running NB on Java 8. I uninstalled and reinstalled using:
Java: 1.7.0_45; Java HotSpot(TM) Client VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18

and the problem disappears. But it still needs analysis for running NB on Java 8.
Comment 3 Roman Svitanic 2013-12-20 09:16:35 UTC
Adding Milos to CC.

Milos, do you have an idea what could case this issue?

JDK8 has jfxrt.jar on bootclasspath, while JDK7 does not. Could it be related to this problem?
Comment 4 Milos Kleint 2013-12-20 09:31:42 UTC
(In reply to Roman Svitanic from comment #3)
> 
> JDK8 has jfxrt.jar on bootclasspath, while JDK7 does not. Could it be
> related to this problem?

right, but in order to build on jdk7, the project should have the jfxrt.jar added to the maven-compiler-plugin's bootcp configuration and we should be able to pick it up from there.

that seems to work for me with the fx project created from archetype we have.
Comment 5 Roman Svitanic 2013-12-20 09:43:34 UTC
(In reply to Milos Kleint from comment #4)
> that seems to work for me with the fx project created from archetype we have.

It seems to work only in case when IDE is running od JDK7. When IDE is running on JDK8 and maven FX project is using JDK7, this issue appears.
Comment 6 Roman Svitanic 2013-12-20 15:07:55 UTC
When IDE is running on JDK8 with jfxrt.jar on bootclasspath, it seems that this jar has precedence before jar specified in maven-compiler-plugin's bootcp.

for example bootcp for MainApp.java is (note the first line):

C:\jdk\jdk1.8.0b120\jre\lib\jfxrt.jar
C:\jdk\jdk1.7.0_45\jre\lib\resources.jar
C:\jdk\jdk1.7.0_45\jre\lib\rt.jar
C:\jdk\jdk1.7.0_45\jre\lib\sunrsasign.jar
C:\jdk\jdk1.7.0_45\jre\lib\jsse.jar
C:\jdk\jdk1.7.0_45\jre\lib\jce.jar
C:\jdk\jdk1.7.0_45\jre\lib\charsets.jar
C:\jdk\jdk1.7.0_45\jre\lib\jfr.jar
C:\jdk\jdk1.7.0_45\jre\classes
C:\jdk\jdk1.7.0_45\jre\lib\ext\access-bridge-64.jar
C:\jdk\jdk1.7.0_45\jre\lib\ext\dnsns.jar
C:\jdk\jdk1.7.0_45\jre\lib\ext\jaccess.jar
C:\jdk\jdk1.7.0_45\jre\lib\ext\localedata.jar
C:\jdk\jdk1.7.0_45\jre\lib\ext\sunec.jar
C:\jdk\jdk1.7.0_45\jre\lib\ext\sunjce_provider.jar
C:\jdk\jdk1.7.0_45\jre\lib\ext\sunmscapi.jar
C:\jdk\jdk1.7.0_45\jre\lib\ext\zipfs.jar

IDE was running on JDK8, maven fx project had Java platform JDK7.
Comment 7 Roman Svitanic 2014-01-14 13:27:17 UTC
*** Bug 239996 has been marked as a duplicate of this bug. ***
Comment 8 Roman Svitanic 2014-01-14 13:27:44 UTC
*** Bug 240097 has been marked as a duplicate of this bug. ***
Comment 9 Roman Svitanic 2014-01-14 13:32:32 UTC
I am reassigning this bug to Milos after discussion and debugging. Since the changes (workaround of the bootclasspath issue) must be done probably in the Maven module.

Probable method: org.netbeans.modules.maven.classpath.EndorsedClassPathImpl#stripDefaultJavaPlatform

Thanks Milos.
Comment 10 Quality Engineering 2014-01-17 02:48:06 UTC
Integrated into 'main-silver', will be available in build *201401170001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/b48651f0e1ec
User: Milos Kleint <mkleint@netbeans.org>
Log: #239673 when javafx is on bootcp in maven pom, we need to remember it when replacing the IDE's java  platform jars (as is in maven model) with the platform jars of selected java platform. Eg. when IDE runs on 1.8 but project runs on 1.7.
Comment 11 Milos Kleint 2014-01-17 08:34:50 UTC
considered fixed
Comment 12 Lou Dasaro 2014-01-21 02:29:10 UTC
Verified fixed in:
Product Version: NetBeans IDE Dev (Build 201401200001)
Java: 1.8.0-ea; Java HotSpot(TM) Client VM 25.0-b63
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b121
System: Windows 8 version 6.2 running on x86; Cp1252; en_US (nb)