JDK-8038127 : JSObject.getWindow(java.applet.Applet) symbol not found
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Other
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2014-03-21
  • Updated: 2014-05-27
  • Resolved: 2014-05-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8u20Resolved
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Windows 7 Professional SP1

EXTRA RELEVANT SYSTEM CONFIGURATION :
Netbens 8.0 from official site.

A DESCRIPTION OF THE PROBLEM :
Cant compile applet even if the project properties are set to compile target JDK 1.6.

cannot find symbol 
 symbol: method getWindow(MyApplet)
 location: class JSObject
----
(Alt-Enter shows hints)
 
Problem:
Not found netscape.javascript.JSObject.getWindow(java.applet.Applet applet).

REGRESSION.  Last worked in version 7u51

ADDITIONAL REGRESSION INFORMATION: 
package netscape.javascript;

public abstract class JSObject {

    protected JSObject() {
        // <editor-fold defaultstate="collapsed" desc="Compiled Code">
        /* 0: aload_0
         * 1: invokespecial java/lang/Object."<init>":()V
         * 4: return
         *  */
        // </editor-fold>
    }

    public abstract Object call(String string, Object[] os) throws JSException;

    public abstract Object eval(String string) throws JSException;

    public abstract Object getMember(String string) throws JSException;

    public abstract void setMember(String string, Object o) throws JSException;

    public abstract void removeMember(String string) throws JSException;

    public abstract Object getSlot(int i) throws JSException;

    public abstract void setSlot(int i, Object o) throws JSException;
}


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Simple Java SE project:

package test;

import javax.swing.JApplet;
import netscape.javascript.JSObject;

public class MyApplet extends JApplet {

    private static JSObject thisWindow;

    @Override
    public void init() {
        try {
            thisWindow = JSObject.getWindow(this);
        } catch (Throwable thr) {
            System.out.println(thr);
        }
    }
}

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Compilation
ACTUAL -
Error. No compilation.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
cannot find symbol 
 symbol: method getWindow(MyApplet)
 location: class JSObject
----
(Alt-Enter shows hints)
 

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
package test;

import javax.swing.JApplet;
import netscape.javascript.JSObject;

public class MyApplet extends JApplet {

    private static JSObject thisWindow;

    @Override
    public void init() {
        try {
            thisWindow = JSObject.getWindow(this);
        } catch (Throwable thr) {
            System.out.println(thr);
        }
    }
}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Downgrading JDK version by uninstalling new one. 

SUPPORT :
YES


Comments
Looks like duplicate of JDK-8006306
25-03-2014

This is not a javax.script or nashorn issue. This is an issue relating to accessing webbrowser's javascript engine from java - which is part of plugin/deployment issue.
25-03-2014