This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 37879
    
  22
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Noclass Exception
 
Similar Threads
javax/mail/Messaging Exception
How to run and print this code
possible classpath problem?
Problem with Vista
error in the first program...