| Author |
Class Path Problem
|
Nikhil Jain
Ranch Hand
Joined: May 15, 2005
Posts: 383
|
|
Hello Ranchers, I have a problem in executing the following program package com; public class man { public static void main(String[] args) { System.out.println("1"); } } 1. The above program has been saved in c:\projects\source\com\man.java 2. I compiled the above by issuing following command c:\projects\> javac -d classes source\com\man.java The output was a successful compilation & the class file was available in c:\projects\classes\com\man.class 3. now when I try to executive the above class c:\projects\classes\com> java man I get the following Exception in thread "main" java.lang.NoClassDefFoundError: man I know that it has got something to do with setting the classpath, but I am not able to figure it out how....please help, shashank
|
SCJP 1.4, SCWCD 1.4, SCBCD 1.5
|
 |
marc weber
Sheriff
Joined: Aug 31, 2004
Posts: 11343
|
|
Try... c:\projects\classes>java com.man
|
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
|
 |
Ravinder Singh
Ranch Hand
Joined: Mar 06, 2006
Posts: 54
|
|
try this; it should work: c:\projects\classes>java -classpath . com.man ---------- Ravinder
|
 |
Nikhil Jain
Ranch Hand
Joined: May 15, 2005
Posts: 383
|
|
|
Thanks mark, it worked...
|
 |
 |
|
|
subject: Class Path Problem
|
|
|