javac is not recognized as an internal or external commandFirst time JAVA user needs help
16 Replies - 54604 Views - Last Post: 22 January 2010 - 06:17 AM
#1
javac is not recognized as an internal or external command
Posted 24 January 2009 - 10:00 AM
I just started a beginner's class for JAVA and the book doesn't explain much. My first assignment asks me to write my first JAVA program. I used notepad and saved it as MyFirstProgram.java. It then tells me to go to the operating system's command prompt and change my current directory or folder to the one that contains the JAVA program I just created. Then asks me to compile the program by typing javac MyFirstProgram.java. It tells me that javac is not recognized as an internal or external command, operable program or batch.
I have MyFirstProgram.java saved in my desktop and what appears on the command prompt is: C:\Users\Jay>javac MyFirstProgram.java
What am I doing wrong? any help for a noob will be appreciatted. Thank You!
Replies To: javac is not recognized as an internal or external command
#2
Re: javac is not recognized as an internal or external command
Posted 24 January 2009 - 10:02 AM
#3
Re: javac is not recognized as an internal or external command
Posted 24 January 2009 - 10:22 AM
#4
Re: javac is not recognized as an internal or external command
Posted 24 January 2009 - 11:56 AM
mostyfriedman, on 24 Jan, 2009 - 09:02 AM, said:
Do I need to have the Java Virtual Machine or will it conflict with JDK?
BigAnt, on 24 Jan, 2009 - 09:22 AM, said:
I'm sorry but, I'm a very beginner. How do I modify the class path?
#5
Re: javac is not recognized as an internal or external command
Posted 24 January 2009 - 11:58 AM
villalandron, on 24 Jan, 2009 - 10:56 AM, said:
mostyfriedman, on 24 Jan, 2009 - 09:02 AM, said:
Do I need to have the Java Virtual Machine or will it conflict with JDK?
BigAnt, on 24 Jan, 2009 - 09:22 AM, said:
I'm sorry but, I'm a very beginner. How do I modify the class path?
The class path in windows can be modified by right clicking on my computer and clicking properties, then click on advanced and environment variables. Then in the bottom square you will need to find PATH and add ; and then the path to the files. This is of course on windows XP
#6
Re: javac is not recognized as an internal or external command
Posted 24 January 2009 - 12:10 PM
markhazlett9, on 24 Jan, 2009 - 10:58 AM, said:
villalandron, on 24 Jan, 2009 - 10:56 AM, said:
mostyfriedman, on 24 Jan, 2009 - 09:02 AM, said:
Do I need to have the Java Virtual Machine or will it conflict with JDK?
BigAnt, on 24 Jan, 2009 - 09:22 AM, said:
I'm sorry but, I'm a very beginner. How do I modify the class path?
The class path in windows can be modified by right clicking on my computer and clicking properties, then click on advanced and environment variables. Then in the bottom square you will need to find PATH and add ; and then the path to the files. This is of course on windows XP
I hope I am not being too much of a pain in the butt. I have vista but figured out how to modify. I don't think I am doing this right though. Here is what I did. I created a new path and named it path2, the value that I put is as follows: C://programfiles/java/javac.exe. Still not working. Any ideas? Thank you in advance.
#7
Re: javac is not recognized as an internal or external command
Posted 24 January 2009 - 01:12 PM
ie if your path to your java bin was: C:\Program Files\Java\jdk1.6.0_02\bin This is what you would add to the end of the path, preceded by a semicolon.
#8
Re: javac is not recognized as an internal or external command
Posted 24 January 2009 - 01:14 PM
#9
Re: javac is not recognized as an internal or external command
Posted 24 January 2009 - 01:25 PM
villalandron, on 24 Jan, 2009 - 11:10 AM, said:
markhazlett9, on 24 Jan, 2009 - 10:58 AM, said:
villalandron, on 24 Jan, 2009 - 10:56 AM, said:
mostyfriedman, on 24 Jan, 2009 - 09:02 AM, said:
Do I need to have the Java Virtual Machine or will it conflict with JDK?
BigAnt, on 24 Jan, 2009 - 09:22 AM, said:
I'm sorry but, I'm a very beginner. How do I modify the class path?
The class path in windows can be modified by right clicking on my computer and clicking properties, then click on advanced and environment variables. Then in the bottom square you will need to find PATH and add ; and then the path to the files. This is of course on windows XP
I hope I am not being too much of a pain in the butt. I have vista but figured out how to modify. I don't think I am doing this right though. Here is what I did. I created a new path and named it path2, the value that I put is as follows: C://programfiles/java/javac.exe. Still not working. Any ideas? Thank you in advance.
My bad, sorry couldn't help you there, haven't done too much work on vista....
#10
Re: javac is not recognized as an internal or external command
Posted 25 January 2009 - 12:17 AM
append at the end od that path variable.the full path where ur javac and java is
#11
Re: javac is not recognized as an internal or external command
Posted 25 January 2009 - 09:30 AM
BigAnt, on 24 Jan, 2009 - 12:12 PM, said:
ie if your path to your java bin was: C:\Program Files\Java\jdk1.6.0_02\bin This is what you would add to the end of the path, preceded by a semicolon.
I think I edited the path properly because after I type
javac MyFirstProgram.java it pauses for a while and then it comes back to C:\Users\Jay. After that, I am trying to do things by my book, it tells me to type java MyFirstProgram and I should be able to see Hello World! display. Instead, I get Exeption in thread 'main' java.lang.NoClassFound Error: MyFirstProgram
Thanks for any help
#12
Re: javac is not recognized as an internal or external command
Posted 25 January 2009 - 11:33 AM
#13
Re: javac is not recognized as an internal or external command
Posted 21 January 2010 - 04:11 PM
Thanks!
#14
Re: javac is not recognized as an internal or external command
Posted 21 January 2010 - 04:14 PM
You should have just created your own
#15
Re: javac is not recognized as an internal or external command
Posted 21 January 2010 - 04:19 PM
skailey, on 21 Jan, 2010 - 05:11 PM, said:
Thanks!
Mind showing us your path?
|
|

New Topic/Question
Reply




MultiQuote










|