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 243293 - JSObject cannot find symbol
Summary: JSObject cannot find symbol
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-26 14:30 UTC by nomood
Modified: 2014-04-16 13:21 UTC (History)
1 user (show)

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 nomood 2014-03-26 14:30:29 UTC
When calling getWindow from JSObject class (netscape.javascript.JSObject) in an applet, Netbeans 8 flag an error "cannot find symbol".

This very annoying because compilation is impossible with this error.

This issue wasn't in older netbeans versions.

More @ http://forums.netbeans.org/viewtopic.php?t=59854


Regards
Ludwig.
Comment 1 Jiri Prox 2014-03-26 14:52:07 UTC
The problem is that jdk8 already contains class netscape.javascript.JSObject  without requested method
see: http://stackoverflow.com/questions/13953920/not-able-to-resolve-jsobject-in-a-java-applet-project

As a temporal workaround you can use jdk1.7


Tomasi, are we able to specify the order of the jars on the classpath?
Comment 2 nomood 2014-03-26 15:51:15 UTC
The workaround works for me.
Thanks

Regards.

Ludwig.
Comment 3 Tomas Zezula 2014-03-27 20:23:24 UTC
In fact it's not a NetBeans issue.
The JDK 8 has 2 versions of netscape.javascript.JSObject.
One in the jfxrt.jar (the wrong one) and the second one in the plugin.jar (the correct one).
Using JDK 7 as Jirka suggested works.
But you can also use JDK 8 when you put plugin.jar on endorsed classpath as the endorsed classpath is prepended to bootclasspath.
If the project is Web Start applet project the plugin.jar is added automatically. It is set in the Projects Properties/Application/Web Start/Applet Descriptor.
Or you can do it by hand, open nbproject/project.properties and set the endorsed.classpath to:

endorsed.classpath=\
    ${java.home}/lib/javaws.jar:\
    ${java.home}/lib/plugin.jar

Then you should see the old netscape.javascript.JSObject.