Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JSObject.getWindow() method not found

LasaJul 21 2013 — edited Jul 26 2013

Hello,

I have spent many time dealing with this problem, and after testing different options, googleing and searching info in forums, finally...I'm desperated

This is the code I want to compile:

package test_applet;

import java.applet.*;

import netscape.javascript.JSObject;

public class test_applet extends Applet{

  private JSObject jso;

  public void init(){

  this.jso = JSObject.getWindow(this);

  }

}

The packages and OS are:

OS. Windows 7 64bits

JRE: 7u25

IDE: Eclipse KEPLER (Also tried with NetBeans but no difference...)

And the error:

java.lang.NoClassDefFoundError: com/sun/deploy/appcontext/AppContext

  at org.test.init(test_applet.java:13)

  at sun.applet.AppletPanel.run(Unknown Source)

  at java.lang.Thread.run(Unknown Source)

Caused by: java.lang.ClassNotFoundException: com.sun.deploy.appcontext.AppContext

  at java.net.URLClassLoader$1.run(Unknown Source)

  at java.net.URLClassLoader$1.run(Unknown Source)

  at java.security.AccessController.doPrivileged(Native Method)

  at java.net.URLClassLoader.findClass(Unknown Source)

  at java.lang.ClassLoader.loadClass(Unknown Source)

  at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

  at java.lang.ClassLoader.loadClass(Unknown Source)

  ... 3 more

which finally means it cannot find the method getWindow() within the class JSObject.

I read that it was required to add the external jar plugin.jar (under jre7 files) to solve this problem and also, to change the compilation order so as we could avoid this error. However, after trying all of this the error still persists...I've installed previous versions of JRE, copied the JAR file into the project folder...and failed.

The thing is: if I compile the code using javac -classpath c:/program..../plugin.jar test.java it works! but this is a pity because I want to compile from eclipse (or netbeans) to check errors and so on...

Does anyone know how to solve this? Any help will be welcome!

BR

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 23 2013
Added on Jul 21 2013
1 comment
5,057 views