View Single Post
  #2 (permalink)  
Old 10-30-2007, 07:53 AM
hiranya hiranya is offline
Member
 
Join Date: Jun 2007
Location: Colombo, Sri Lanka
Posts: 31
hiranya is on a distinguished road
I'm fairly new to Java too. In my opinion there is no need to setup class paths to run simple Java programs like 'Hello World' applications. It should work fine. However here are some points you can check.

1. Is the name of your class equal to the name of the file? (your file name should be Test.java only if your class name is Test - I think you got this right since your program gets compiled without errors)

2. Check whether a file called Test.class is generated in the same directory once you compile the program.

3. To run the program issue the command 'java Test' (not 'java Test.class')

4. Have you encapsulated your class in a package? (sometimes this can cause problems when trying to run the application)

If you still want to try setting the class path refer the following article from Sun.
Setting the class path

Hope this helps. All the best.

Regards,
Hiranya
Reply With Quote