Skip to main content

problem setting up environment variables for Java2

2 replies [Last post]
azslap
Offline
Joined: 2006-02-17

Hello,

This is a desperate plea for help. Being a real novice, I feel out of place here.

I run Windows98. I have J2SDK(1.3) installed. Upon setting my path variable (using 'set PATH=%PATH%;c:\jdk1.3\bin') to c:\jdk1.3\bin and Classpath to c:\jdk1.3\jre\lib\ext, this is what happens.
I go to c:\Project, where my java files are stored. I type javac (filename.java) and the file compiles properly. However, when I type java (filename) to run the class I get an "exception in thread main:Noclassdeffounderror: (filename)". My compiled java file is definitely in the same directory(ie. project), yet I get this error. However the compiled file runs perfectly when run from the c:\jdk1.3\bin directory.

If I don't add the classpath line, then java (filename) tells me it can't find the class used(since I use a particular jar file in c:\jdk1.3\jre\lib\ext), which is fine and is expected.

Earlier I had edited the autoexec.bat file using msconfig and sysedit. however when this problem started, i deleted these lines from the Autoexec.bat file(of whic there are three files now, each with a differnt extension). and since have used the " set PATH" and "set CLASSPATH" options. But as mentioned above, though the file compiles properly I get an error message( as explained before) when I try to run the compiled file. Please help. Thanks. Rosh

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
zander
Offline
Joined: 2003-06-13

Add your current dir to your classpath.

http://java.sun.com/j2se/1.3/docs/tooldocs/win32/classpath.html

azslap
Offline
Joined: 2006-02-17

Thanks I've ogt it working now