Skip to Main Content

Java Programming

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!

Can't Import netscape.javascript; classpath set properly

807603Dec 31 2007 — edited Dec 31 2007
I have an applet that is trying to say
import netscape.javascript.*
No matter how I try to compile it, I get the error
package netscape.javascript does not exist
I am primarily using ant for building; here is the pertinent section of my build.xml file:
<property name="output" location="javaclasses" />
   
   <target name="compile">
      <javac srcdir="./"
             destdir="${output}"
             includes="**/*.java"
             classpath="./,\
                        javaclasses/packages/epsgraphics.jar,\
                        /usr/lib/jvm/java-1.5.0-sun-1.5.0_update13-sr2/jre/lib/plugin.jar,\
                        javaclasses"
             listfiles="yes">
      </javac>
   </target>
Note that plugin.jar is included in my classpath. Using jar -tf <...>/plugin.jar, I can see that it contains the netscape package, the javascript subdirectory, and the JSObject.class I am interested in.

Attempting to resolve this manually with the command line
javac -classpath "./;javaclasses/packages/epsgraphics.jar;/usr/lib/jvm/java-1.5.0-sun-1.5.0_update13-sr2/jre/lib/plugin.jar;javaclasses" myApplet.java
gives the same error.

Moving plugin.jar to my local directory, or any other directory specified in the classpath (which worked just fine until I tried accessing plugin.jar) and re-jiggering the classpath so it can be located gives the same result: it can't find netscape.javascript.

I'm using javac from java-1.5.0-sun-1.5.0_update13-sr2 on Suse Linux 10.3.

What am I missing here?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 28 2008
Added on Dec 31 2007
3 comments
521 views