Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes Noclass Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Noclass Exception" Watch "Noclass Exception" New topic
Author

Noclass Exception

saravanan rajendran
Ranch Hand

Joined: Jun 13, 2008
Posts: 75
Hi,
I getting problem executing my java program please help me

code:
path set: set path=c:\program files\java\jdk1.5.0_06\bin
class a
{
public static void main(String arg[])
{
System.out.println("welcome");
}
}

compile:
javac a.java

class file create it is in same path only

run:

java a

error:

Noclass found exception

please help me i wasted lot of time for this
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Try java c:\program files\java\jdk1.5.0_06\bin\a
this will work


Hope this helps .


SCJP, SCWCD.
|Asking Good Questions|
saravanan rajendran
Ranch Hand

Joined: Jun 13, 2008
Posts: 75
thank you very much i got it.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39409
    
  28
Originally posted by Amit Ghorpade:
Try java c:\program files\java\jdk1.5.0_06\bin\a
Putting your own files in the bin folder? Never do that. The bin folder is for Java (JDK/JRE) to store its executable files.
Navigate elsewhere and create a folder, in "my documents" or "C" or somewhere, for your Java files. Make sure to navigate to the folder where the Java files live before using the command prompt.
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Originally posted by Campbell Ritchie
Putting your own files in the bin folder? Never do that. The bin folder is for Java (JDK/JRE) to store its executable files.


No I never put my files there, although doing so saves you from setting the path and related problems.
I only made the original poster understand the root of the problem.

Sorry for not suggesting him not to put his files over there, just missed
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Noclass Exception