Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Noclass Exception

 
saravanan rajendran
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try java c:\program files\java\jdk1.5.0_06\bin\a
this will work


Hope this helps .
 
saravanan rajendran
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much i got it.
 
Campbell Ritchie
Sheriff
Pie
Posts: 48932
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic