participate


Java Install / Autoupdate - Error: javac is not recognized as ...command
<<   Back to Forum  |   Give us Feedback
This topic has 13 replies on 1 page.
eabryan
Posts:4
Registered: 8/7/04
Error: javac is not recognized as ...command   
Aug 7, 2004 1:36 PM

 
Greetings,
I installed the J2 SDK and am following the tutorial for newbies (hello world). When attempting to execute in the DOS window I get the message,
"javac is not recognized as an internal or external command, operable or batch command". I have attempted to follow the instructions for setting the path. It was a bit vague for XP but I went through the control panel to system and found the environment variable button under 'Advanced' tab. What I added was the variable name 'javac' and the path, including the file name (c:\j2sdk\bin\javac.exe). Is this the correct format?

I can see the HelloWorldApp.java file. It appears correct. From within that directory I can type c:\j2sdk\bin\javac.exe HelloWorldApp.java and I do not get the error message but also do not get Hello World or anything else. It skips a line and returns the prompt. If I create an error in the HelloWorldApp.java file, I do get a compiler error message (syntax). Just to make sure, here is a copy/paste of the file:

class HelloWorldApp
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}

Miscellaneous 'stuff' which may or may not be important: I checked and have the latest MS Service Pack. I did change the name of the install directory from j2sdk1.4.2_05 to j2sdk. I do see javac.exe under the bin directory. I do not see any process which appears to be a Java-related running under tasks or applications in task manager.

Your help is appreciated!
 
eabryan
Posts:4
Registered: 8/7/04
Re: Error: javac is not recognized as ...command   
Aug 7, 2004 1:45 PM (reply 1 of 13)  (In reply to original post )

 
Just after posting I found the details for changing the path and that is set now. SORRY! It looks like I'm back to just now seeing any output.
 
eabryan
Posts:4
Registered: 8/7/04
Re: Error: javac is not recognized as ...command   
Aug 7, 2004 1:46 PM (reply 2 of 13)  (In reply to original post )

 
Just after posting I found the details for changing the path and that is set now. SORRY! It looks like I'm back to just not seeing any output.
 
eabryan
Posts:4
Registered: 8/7/04
Re: Error: javac is not recognized as ...command   
Aug 7, 2004 2:00 PM (reply 3 of 13)  (In reply to original post )

 
DUH! I got it now. Not seeing anything was a GOOD thing. Gee, I wish I could just erase this question entirely....

Thanks, anyway. (What a newbie!)
 
atmguy
Posts:4,695
Registered: 3/31/99
Re: Error: javac is not recognized as ...command   
Aug 7, 2004 2:33 PM (reply 4 of 13)  (In reply to #3 )

 
Well, congratulate yourself on learning by the most effective manner - sorting it out yourself. That's more than a lot of people are able to do.
 
josoma
Posts:2
Registered: 12/2/04
Re: Error: javac is not recognized as ...command   
Dec 2, 2004 9:21 PM (reply 5 of 13)  (In reply to #3 )

 
Yes, but those of us (like me) who are still newbies don't know how you fixed the issue. Please provide how you fixed it. Thanks.
 
ChuckBing
Posts:13,489
Registered: 4/7/01
Re: Error: javac is not recognized as ...command   
Dec 2, 2004 10:05 PM (reply 6 of 13)  (In reply to #5 )

 
Fixed the PATH environment variable. Go to where you downloaded Java, click on the Installation Instructions link, and read #5.
 
solstice
Posts:3
Registered: 3/9/05
Re: Error: javac is not recognized as ...command   
Mar 9, 2005 10:10 AM (reply 7 of 13)  (In reply to #6 )

 
In windows, just add the JRE to your PATH variable. For example:
set PATH=$PATH;C:\jws\bin\jdk1.5.0_01\bin
 
avisramu
Posts:1
Registered: 11/8/05
Re: Error: javac is not recognized as ...command   
Nov 8, 2005 12:15 AM (reply 8 of 13)  (In reply to #1 )

 
Re: Error: javac is not recognized as ...command
 
ozzytheKiLLeR32
Posts:1
Registered: 7/13/06
Re: Error: javac is not recognized as ...command   
Jul 13, 2006 8:29 AM (reply 9 of 13)  (In reply to #8 )

 
i have windows Xp and i am doin the Hello.java (aka HelloWorld program) it is not working
 
UjjwalaJain
Posts:1
Registered: 7/22/06
Re: Error: javac is not recognized as ...command   
Jul 22, 2006 1:42 PM (reply 10 of 13)  (In reply to #9 )

 
Go to C:\j2sdk1.4.2_12. In this Dir in README.htm you have instructions to set the path variables. You need to add a new environment variable named as PATH with value C:\J2SDK1.4.2_<version>\BIN

This will solve the problem
 
4736672
Posts:3
Registered: 10/7/04
Re: Error: javac is not recognized as ...command   
Apr 29, 2007 1:56 PM (reply 11 of 13)  (In reply to #10 )

 
Hi all,

JAVA_HOME = C:\jdk1.6.0_01 (for example)

Add your (%JAVA_HOME%\bin) as first value in SYSTEM PATH variable

It will work.

- sasi
 
ginapicc
Posts:5
Registered: 27/01/08
Re: Error: javac is not recognized as ...command   
Feb 11, 2008 7:53 PM (reply 12 of 13)  (In reply to #6 )

 
Thanks so much, Chuck!

I was having this problem and your response got me over the hump.
 
slinger3
Posts:1
Registered: 1/11/10
Re: Error: javac is not recognized as ...command   
Jan 11, 2010 4:48 PM (reply 13 of 13)  (In reply to original post )

 
Okay the Javac error is an old problem and should not be so hard to fix. This knowledgge should be spread far and wide. It comes from the set classpath issue.

This solution works only if you have downloaded the entire jdk-6u12-windows-i586-p download

THe problem is that you need to add a path to the path in your environment settings.

First gop to the Bin filwe in your java folder. You will see a path in y our address line. Copy this address.

Go to "My Computer" and select Properties. Frome there select advanced. Then go to the second lowser pane and select "Path" Choose edit,. Have a care hertre. The path ends with a / or a \ place a semicolon at the end of the statement. Copy into this line the address you copied. Then paste a semicolon to the end. Then look at the whole path and Make siure there are only the original and the new added with the new adddress ending with a semicolon.

Alterations can cauase a system shutdown.

I have done this and it solved my problem
 
This topic has 13 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 28
  • Guests : 133

About Sun forums
  • Oracle Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Oracle Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums