Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Objects and Exceptions????

Status
Not open for further replies.

Huitzilopochtli

Programmer
Feb 18, 2002
81
DE
Hello

I have a nice applet (if only it would work!), which imports the following:

import java.applet.*;
import java.awt.*;
import java.io.PrintStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.StringTokenizer;
import java.util.Vector;
import netscape.javascript.JSException;
import netscape.javascript.JSObject;


I was surprised, therefore, to find that I got a few error messages pointing to JSException and JSObject. I have indicated them below, and would be grateful for any help about how I can overcome them.

java:9: cannot resolve symbol
symbol : class JSObject
location: package javascript
import netscape.javascript.JSObject;
^
java:349: cannot resolve symbol
symbol : class JSObject
location: class navdeluxe
JSObject jsobject = JSObject.getWindow(this);
^
java:349: cannot resolve symbol
JSobject jsobject = JSObject.getWindow(this);
^
java:358: cannot resolve symbol
symbol : class JSException
catch(JSException _ex)
^

C:\jdk1.3.1\bin>

Best wishes
 
Make sure that the classes for the netscape package (if you are using classes and not a jar) are in the correct directories. They should be located in ./netscape/javascript/
 
Hello HavatheJut

Many thanks for your post.

Do you mean:

c/jdk1.3.1/bin/netscape/javascript/myclasses?

I presume that all the files would need to be in the same directory?

Many thanks Hava

Huitzilopochtli
 
Say that you are trying to compile JavaFile1.java and JavaFile2.java which use the javascript package (bear with me cuz im unfamiliar with java.netscape.javascript). Say that your two source files are in c:\java. If you are to use any package correctly, there are two basic approachs.
1. (Probably what you want here) Assuming that the netscape classes are not in a jar, these classes would have to be located in c:\java\nestcape\javascript2. If they are in a jar, or not in a subdirectory of c:\java, add them to the javac classpath.
2.a.
jar(replace ns with the appropriate name):
javac -classpath ns.jar
2.b.
class files in another dir that is one above the top package level (contains the subdirectory nestcape):
javac -classpath .;c:\j2sdk1.4.0\bin
Good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top