Results 1 to 2 of 2
Thread: Cloud not find the main class
- 05-07-2011, 08:31 PM #1
Member
- Join Date
- May 2011
- Posts
- 1
- Rep Power
- 0
Cloud not find the main class
I am tryin to build a simple java program as mentioned below :
public class Hi
{
public static void main (String a[])
{
System.out.println("Hi babe!!");
}
}
the notepad file is however is saved as name of the Class me using here.
I however compiled it with no error.
But When i try to execute the Class file
i getting this error :confused:
1) Is there any sort or version difference with the JDK i downloaded i.e. 1.6
2)There is another question when i try to use
set path = "C:\ program file\java\jdk1.6\bin"
How can i conclude that the path is set?
I mean there could be possibility that i can try to compile the java file
But that is not happening:( .
3)if the path is set completly can my java file in D: be compiled ?
- 05-07-2011, 11:18 PM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,561
- Rep Power
- 11
It's hard to answer your questions as they stand. Could you post
(1) The exact full path of the Hi.java file. And verify that the file really is Hi.java and not anything else. (WindowsExplorer is pretty useless for this: check the name from the command line with the dir command.)
(2) The exact commands you are using to compile and run the program.
------------------
Versions should not be a big problem here.
Generally you set the PATH once and for all (rather than "set path = etc" every time you compile). There are instructions for doing this in the JDK Installation Notes (scroll down to "How do I set the PATH permanently?")
If this is your first time compiling a Java program I strongly suggest to work through the "Hello World" page of Oracle's Tutorial. If you follow those steps exactly and encounter a problem others, here, will know exactly what the context is.
Similar Threads
-
Could not find main class
By Karenthian in forum New To JavaReplies: 7Last Post: 03-30-2011, 03:02 PM -
Could not find main class
By yetty4ever in forum New To JavaReplies: 7Last Post: 02-16-2011, 07:38 PM -
Could Not Find Main Class (AGAIN!)
By illjavathat in forum New To JavaReplies: 54Last Post: 10-22-2010, 03:22 AM -
couldn't find main class
By demonoid in forum New To JavaReplies: 6Last Post: 10-10-2010, 02:44 AM -
JVM Could not find main class
By banduskank in forum Advanced JavaReplies: 2Last Post: 06-24-2008, 08:05 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks