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:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Very basic problem
the PATH should point to d:\jdk1.3\bin and CLASSPATH to d:\jdk1.3\jre\lib\rt.jar -Message d'origine- De: Jack Li [SMTP:[EMAIL PROTECTED]] Date: mercredi 2 janvier 2002 16:26 À:'[EMAIL PROTECTED]' Objet: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:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] --Interscan- (on the network) email-body was scanned and no virus found --Traite par ISVW--- -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Very basic problem
you have to include JAVA_HOME in your autoexec.bat file If the problem is not solved just say java in dos promt and see what comes - Original Message - From: Jack Li [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 02, 2002 8:55 PM 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:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Very basic problem
In the memory of my first java lines I will reply to this out of subject question. Firstly, You should have the current directory in your CLASSPATH. Secondly you should put a capital to your class name and your file (to be clean) class Test { pubic static void main(String[] args){ System.out.println(Hello World); } } then you launch it with : java -classpath . Test Arnaud -Message d'origine- De: Jack Li [SMTP:[EMAIL PROTECTED]] Date: mercredi 2 janvier 2002 16:26 À:'[EMAIL PROTECTED]' Objet: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:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
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:[EMAIL PROTECTED]] Sent: Wednesday, January 02, 2002 9:26 AM To: '[EMAIL PROTECTED]' 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:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Very basic problem
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:[EMAIL PROTECTED]] 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:[EMAIL PROTECTED]] Sent: Wednesday, January 02, 2002 9:26 AM To: '[EMAIL PROTECTED]' 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:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Very basic problem
Thanks for all the quick responses. It works now. What I did is to put .; and d:\jdk1.3\jre\lib\rt.jar in CLASSPATH. Jack -Original Message- From: DESBOIS Sébastien [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 02, 2002 10:29 AM To: Tomcat Users List Subject: RE: Very basic problem the PATH should point to d:\jdk1.3\bin and CLASSPATH to d:\jdk1.3\jre\lib\rt.jar -Message d'origine- De: Jack Li [SMTP:[EMAIL PROTECTED]] Date: mercredi 2 janvier 2002 16:26 À:'[EMAIL PROTECTED]' Objet: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:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Very basic problem
Go to the directory where your test.class file is created . Make sure that the test.class file is present Type java test in that directory. Do you still get the error message ? Thanks Anshu Pal -Original Message- From: amol [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 02, 2002 10:22 AM To: Tomcat Users List Subject: Re: Very basic problem you have to include JAVA_HOME in your autoexec.bat file If the problem is not solved just say java in dos promt and see what comes - Original Message - From: Jack Li [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 02, 2002 8:55 PM 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:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Very basic problem
Hi, Please setup the following: Environment Variable Name: CLASSPATH = .;E:\jdk1.2.2\lib\dt.jar;E:\jdk1.2.2\lib\tools.jar;E:\jdk1.2.2\jre\lib\rt.ja r; PATH = .;E:\jdk1.2.2\bin; You seem to have set the classpath wrongly and you haven't mentioned anything about the path... The above should help you... Regards. - Original Message - From: Jack Li [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 02, 2002 8:55 PM 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:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]