package netscape.javascript does not exist

T

tdubb123

when i try to compile a java program program.java

I do

javac program.java

and I got errors

iReport.java:105: package netscape.javascript does not exist
import netscape.javascript.*;
^
iReport.java:21818: cannot resolve symbol
symbol : class JSObject
location: class iReport
JSObject win = (JSObject) JSObject.getWindow(this);
^
iReport.java:21818: cannot resolve symbol
symbol : class JSObject
location: class iReport
JSObject win = (JSObject) JSObject.getWindow(this);
^
iReport.java:21818: cannot resolve symbol
symbol : variable JSObject
location: class iReport
JSObject win = (JSObject) JSObject.getWindow(this);
^
4 errors
 
R

Roland

when i try to compile a java program program.java

I do

javac program.java

and I got errors

iReport.java:105: package netscape.javascript does not exist
import netscape.javascript.*;
^
iReport.java:21818: cannot resolve symbol
symbol : class JSObject
location: class iReport
JSObject win = (JSObject) JSObject.getWindow(this);
^
iReport.java:21818: cannot resolve symbol
symbol : class JSObject
location: class iReport
JSObject win = (JSObject) JSObject.getWindow(this);
^
iReport.java:21818: cannot resolve symbol
symbol : variable JSObject
location: class iReport
JSObject win = (JSObject) JSObject.getWindow(this);
^
4 errors
For Java 1.4.2 and later: add plugin.jar to your classpath. It can be
found in the lib directory of your JRE installation, e.g.
C:\Program Files\Java\jre1.5.0\lib\plugin.jar

For Java 1.4.0/1.4.1: use jaws.jar (same directory).
--
Regards,

Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
 
R

Rhino

(e-mail address removed) wrote in @g14g2000cwa.googlegroups.com:
when i try to compile a java program program.java

I do

javac program.java

and I got errors

iReport.java:105: package netscape.javascript does not exist
import netscape.javascript.*;
^
iReport.java:21818: cannot resolve symbol
symbol : class JSObject
location: class iReport
JSObject win = (JSObject) JSObject.getWindow(this);
^
iReport.java:21818: cannot resolve symbol
symbol : class JSObject
location: class iReport
JSObject win = (JSObject) JSObject.getWindow(this);
^
iReport.java:21818: cannot resolve symbol
symbol : variable JSObject
location: class iReport
JSObject win = (JSObject) JSObject.getWindow(this);
^
4 errors

Clearly, the javac compiler can't 'see' the netscape.javascript package
when it tries to compile. Where are the javascript classes relative to
the program.java source code?

You need to point to the javascript classes with something like this:

javac -classpath c:\temp\netscape.jar program.java

Naturally, you need to replace 'netscape.jar' in the example with the
correct name/location of the jar.


Or use an IDE like Eclipse which has built-in facilities to make
external jars visible to the compiler; then, if you set the reference to
the external jar correctly, your problem will go away and your code will
be incrementally compiled whenever you change it.

Rhino
 
T

Teresa Kleb via JavaKB.com

I changed my CLASSPATH as recommended, but the JAWS.JAR file doesn't exist
for J2SDK1.4.2_07 or it's corresponding JRE download. Do you know why?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top