tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edwards, Peter" <Peter.Edwa...@astrazeneca.com>
Subject RE: Very basic problem
Date Wed, 02 Jan 2002 15:55:17 GMT
Also, I think you are confusing CLASSPATH with PATH. 
  PATH is used by DOS to determine where the executables are e.g. java.exe
  CLASSPATH is used by Java to determine where class files (or jar files)
are

In your case the CLASSPATH should only contain the directory containing your
compiled class file. Do not confuse yourself by putting
"d:\jdk1.3;d:\jdk1.3\bin;" on your classpath.

Most people do not set the environment variable CLASSPATH at all since this
will be different for every application you write. I would set JAVA_HOME to
"d:\jdk1.3" and then use the command line as follows (assuming you are in
the directory where your class file is):

%JAVA_HOME%\bin\java -cp . test

Note - "-cp" replaces "-classpath" in JDK1.3
 
Using JAVA_HOME like this allows you to save cmd/bat files that will work
even if you move to a new version of Java - just change JAVA_HOME.

Pete

-----Original Message-----
From: Jim Urban [mailto:jim.urban@netsteps.net]
Sent: 02 January 2002 15:38
To: Tomcat Users List
Subject: RE: Very basic problem


This question should be asked on a Java forum, but here is your answer:
Add "." to the beginning of your classpath:
CLASSPATH=.;d:\jdk1.3;d:\jdk1.3\bin;
This tells Java to look in the current directory for classes.
Jim

-----Original Message-----
From: Jack Li [mailto:JLi@MurraysDiscount.com]
Sent: Wednesday, January 02, 2002 9:26 AM
To: 'tomcat-user@jakarta.apache.org'
Subject: Very basic problem


Hello All,
I have a very basic problem. I try to an java application under DOS (Windows
operating system is windows 2000 server). I got error:

java.lang.NoClassDefFoundError: test.

The application is a sample from text book, very simple:

class test {
  public static void main(String args[]) {
    System.out.println("Hello, World!");
  }

}

I run it by "java test". I installed jdk1.3, and setup the CLASSPATH point
to d:\jdk1.3;d:\jdk1.3\bin;

what do I missed ?

Thanks,
Jack


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>



--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message