Solved

'javac' is not recognized as an internal or external command,

Posted on 2012-03-27
7
443 Views
Last Modified: 2012-03-27
'javac' is not recognized as an internal or external command, operable program or batch file.

JAVA_HOME is set a C:\j2sdk1.4.2_01  (also tried with C:\j2sdk1.4.2_01\bin)

Is JAVA_HOME setting for use by Tomcat only? Java configuration has to be done elsewhere?


I searched for jkd and have the result in the attached image.


The above message comes up when I run:

C:>javac ClassName.Java

Question, What can I do to correct the problem?

Thank you.
JDK.bmp
0
Comment
Question by:Mike Eghtebas
  • 5
  • 2
7 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 37772551
JAVA_HOME isessentila for tomcat

in this case check your PATH, you need to have

JDK home folder/bin in your path
0
 
LVL 47

Expert Comment

by:for_yan
ID: 37772555
say

PATH=C:\j2sdk1.4.2_01\bin

then it shoudl work if you have JDK there of course
0
 
LVL 47

Expert Comment

by:for_yan
ID: 37772569
Your screenshot is not informative

got to C:\j2sdk1.4.2_01 folder and check if theis bin inside and inside bin there should be
java.exe javac.exe, etc, etc

Then put C:\j2sdk1.4.2_01\bin
in the PATH in the dos winodw before you try to run javac
and then it should run
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 47

Expert Comment

by:for_yan
ID: 37772581
Alternatively go to

control panel -- System -advanced(tab on tope)  - Environement Vraibales (bottom button) and modify value of PATH to include C:\j2sdk1.4.2_01\bin folder - better in the pbgining of your path

then save

and all dos windows which you open afterwtrads type PATH
and you'll see that path in there
0
 
LVL 33

Author Comment

by:Mike Eghtebas
ID: 37772696
So I need to add new variabel caled PATH, right?

I will add to top wndow as shown in the attached image.

The path in the lower window is disabled for me.

Thanks
Path-JDK.bmp
0
 
LVL 47

Accepted Solution

by:
for_yan earned 500 total points
ID: 37772710
Normally you want to edit the PATH variable.
If it is disabled - it means you don;'t have admin privileges and cannot modify it for th e whole system.
If so then just do it in every cmd dos window which you open

First specify PATH pointing to C:\j2sdk1.4.2_01\bin  and then launch javac

I'm not sure than changing in upper window will help
0
 
LVL 33

Author Closing Comment

by:Mike Eghtebas
ID: 37772815
Adding to the upper window seems to work. Meaning it compile and will test more later and report it back to you.

Thank you.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now