In my java program I make heavy use of Suns implmentation of the Rhino script engine. Very recently however, my JDK does not seem to automatically import the rt.jar file anymore when compiling.
Whats strange is that NetBeans reports 0 live errors, they only show up when doing a complete Clean & Build. This wasn't happening before when I was importing NativeArray, so I'm really confused on why it all of a sudden stopped working.
Specs:
Check to see if it exists:
C:\Documents and Settings\LordQuackstar\Desktop\TestApp\src>javap sun.org.mozill a.javascript.internal.WrappedException Compiled from "WrappedException.java" public class sun.org.mozilla.javascript.internal.WrappedException extends sun.or g.mozilla.javascript.internal.EvaluatorException{ static final long serialVersionUID; public sun.org.mozilla.javascript.internal.WrappedException(java.lang.Throwa ble); public java.lang.Throwable getWrappedException(); public java.lang.Object unwrap(); }
Ok it exists, so here's some test code:
package testapp;
import sun.org.mozilla.javascript.internal.WrappedException;
public class Main {
public static void main(String[] args) {
WrappedException e = new WrappedException(null);
}
}
Netbeans output:
init: deps-clean: Updating property file: C:\Documents and Settings\LordQuackstar\Desktop\TestApp\build\built-clean.properties Deleting directory C:\Documents and Settings\LordQuackstar\Desktop\TestApp\build clean: init: deps-jar: Created dir: C:\Documents and Settings\LordQuackstar\Desktop\TestApp\build Updating property file: C:\Documents and Settings\LordQuackstar\Desktop\TestApp\build\built-jar.properties Created dir: C:\Documents and Settings\LordQuackstar\Desktop\TestApp\build\classes Created dir: C:\Documents and Settings\LordQuackstar\Desktop\TestApp\build\empty Compiling 1 source file to C:\Documents and Settings\LordQuackstar\Desktop\TestApp\build\classes C:\Documents and Settings\LordQuackstar\Desktop\TestApp\src\testapp\Main.java:8: package sun.org.mozilla.javascript.internal does not exist import sun.org.mozilla.javascript.internal.WrappedException; C:\Documents and Settings\LordQuackstar\Desktop\TestApp\src\testapp\Main.java:16: cannot find symbol symbol : class WrappedException location: class testapp.Main WrappedException e = new WrappedException(null); ^ C:\Documents and Settings\LordQuackstar\Desktop\TestApp\src\testapp\Main.java:16: cannot find symbol symbol : class WrappedException location: class testapp.Main WrappedException e = new WrappedException(null); ^ 3 errors C:\Documents and Settings\LordQuackstar\Desktop\TestApp\nbproject\build-impl.xml:528: The following error occurred while executing this line: C:\Documents and Settings\LordQuackstar\Desktop\TestApp\nbproject\build-impl.xml:261: Compile failed; see the compiler error output for details. BUILD FAILED (total time: 0 seconds)
Command line output:
C:\Documents and Settings\LordQuackstar\Desktop\TestApp\src\testapp>javac Main.java Main.java:3: package sun.org.mozilla.javascript.internal does not exist import sun.org.mozilla.javascript.internal.WrappedException; ^ Main.java:7: cannot find symbol symbol : class WrappedException location: class testapp.Main WrappedException e = new WrappedException(null); ^ Main.java:7: cannot find symbol symbol : class WrappedException location: class testapp.Main WrappedException e = new WrappedException(null); ^ 3 errors
So what would cause this to fail all of a sudden? It was working just fine yesterday. I didn't change anything besides importing 2 more classes from the same package. None of my dependencies changed.
Will test in linux to see if the problem still exists.
Before you say it: No I'm not download rhino separatly, No I'm not changing IDEs,
There are two indications that you shouldn't use this class: sun
and internal
- these mean that this is some internal class that shouldn't be used by third parties. Because it can change or be removed in future releases - i.e. this is not part of an API. So - download Rhino separately.
If you are using the scripting API - use only the API classes/interfaces - i.e. javax.script
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With