Solved

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

Posted on 2012-03-27
7
474 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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 34

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 34

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
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.

696 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