error message: 'javac' is not recognized as an internal or external command

Hi All,

I have recently decided to begin learning java in preaparation for a new job. Unfortunately... I keep receiving the error message:

'javac' is not recognized as an internal or external command, operable program, or batch file

From what I have learnt... I realise that the javac file cannot be located and it is for this reason the class file cannot be created. However both my class path and my path have been set correctly. My path file has the direct link to the directory where the javac.exe file is located. I have tried:

C:\Program Files\Java\jdk1.6.0_02\bin

C:\Program Files\Java\jdk1.6.0_02\bin\javac

C:\Program Files\Java\jdk1.6.0_02\bin\javac.exe

I have even went as far as trying with a semi colon at the end and without as well as opening a fresh command window upon each attempt. In addition to this, I specifically directed the directory within my command window as instructed by the Sun java documentation, for example:

C:\jdk6\bin\javac HelloWorldApp.java

This also did not work.

Any help would be greatly appreciated, this is my first post and my start date is looming closer and closer.

Jimbo.

[1199 byte] By [JimmySmith07a] at [2007-11-27 10:36:38]
# 1

Classpath is irrelevant here.

No, your PATH is *not* set correctly.

Go here and scroll down to "Updating the path variable".

http://java.sun.com/javase/6/webnotes/install/jdk/install-windows.html

Note that after updating the PATH variable through the control panel, you'll have to open a new cmd.exe. It doesn't propagate to any currently running ones.

jverda at 2007-7-28 18:42:33 > top of Java-index,Java Essentials,New To Java...
# 2

Adding semicolon at the end of the classpath only applies to Windows XP operating system. To set classpath there, you add first semicolon at the end of the previous paths. Then add the path of your JDK.

jmBuffera at 2007-7-28 18:42:33 > top of Java-index,Java Essentials,New To Java...
# 3

> Adding semicolon at the end of the classpath only

> applies to Windows XP operating system. To set

> classpath there, you add first semicolon at the end

> of the previous paths. Then add the path of your JDK.

Path. Not classpath.

jverda at 2007-7-28 18:42:33 > top of Java-index,Java Essentials,New To Java...
# 4

try this:

what you have to do is to set your path environment to the location of the javac.. ex. if your javac is located at c:\program files\java6.0\bin then.. try to type this at the command prompt

path=%path%;c:\program files\java6.0\bin;

%path% is use in order to make no changes on the default path set by windows..

this is use in order for you to access all of the java utilities (javac.exe, java.exe, javadoc.exe etc.) whenever you are in a different directory..

after that you can now just locate ur .java file then type

javac example.java or

javac \location_of_file\example.java

just make sure you type correctly the location of the javac on the path environment or else you'll get the same error again.. :)

strider_hiryu007a at 2007-7-28 18:42:33 > top of Java-index,Java Essentials,New To Java...
# 5

Hi,

Thanks for the advise. All seemed to work until I received the following error message, something I have not seen before:

HelloUser.java:9: reached end of file while parsing

}

1 error

Please can you clarify what this means.

Much appreciated

Jimbo

JimmySmith07a at 2007-7-28 18:42:33 > top of Java-index,Java Essentials,New To Java...
# 6

> ...

> HelloUser.java:9: reached end of file while parsing

> }

> 1 error

>

> Please can you clarify what this means.

>

> Much appreciated

>

> Jimbo

Impossible to say without more details.

prometheuzza at 2007-7-28 18:42:33 > top of Java-index,Java Essentials,New To Java...
# 7

> > ...

> > HelloUser.java:9: reached end of file while parsing

>

> > }

> > 1 error

> >

> > Please can you clarify what this means.

> >

> > Much appreciated

> >

> > Jimbo

>

> Impossible to say without more details.

I guess the curly brackets don't match up (a forgotten right curly bracket

at the end of the file mayhap?)

kind regards,

Jos (The Human Parser ;-)

JosAHa at 2007-7-28 18:42:33 > top of Java-index,Java Essentials,New To Java...
# 8

> > ...

> > HelloUser.java:9: reached end of file while parsing

>

> > }

> > 1 error

> >

> > Please can you clarify what this means.

> >

> > Much appreciated

> >

> > Jimbo

>

> Impossible to say without more details.

Hi..

I have been continuoulsy recieving the message:

'javac' is not recognized as an internal or external command, operable program, or batch file

I am aware that this problem is regarding my path variable, after setting me path correctly, I still recieve this message. My path is set too..

C:\Program Files\Java\jdk1.6.0_02\bin;

However this did not work, i took the advise of strider_hiryu007 and typed into the command window the following to locate my javac file from any directory:

path=%path%;c:\program files\java6.0\bin;

This worked fine, I retyped my command in a fresh cmd window: javac HelloUser.java.

This however produced the error message:

HelloUser.java:9: reached end of file while parsing

}

1 error

Please could you clarify and provide further advise on how to get past this. As far as ai am aware both my Path and class path variables have been set correctly.

thanks

Jimbo.

JimmySmith07a at 2007-7-28 18:42:33 > top of Java-index,Java Essentials,New To Java...
# 9

> ...

> I am aware that this problem is regarding my path

> variable, after setting me path correctly, I still

> recieve this message. My path is set too..

Did you try a re-boot?

prometheuzza at 2007-7-28 18:42:33 > top of Java-index,Java Essentials,New To Java...
# 10

> > ...

> > I am aware that this problem is regarding my path

> > variable, after setting me path correctly, I still

> > recieve this message. My path is set too..

>

> Did you try a re-boot?

Hi,

Just re-booted, the javac HelloUser.java command did nothing (double checked my Path also, it is correct) received the same message:

'javac' is not recognized as an internal or external command, operable program, or batch file

then tried again the command:

path=%path%;c:\program files\java6.0\bin;

and received the same error message:

HelloUser.java:9: reached end of file while parsing

}

1 error

Any clarification on this error message?

Thanks

Jimbo

JimmySmith07a at 2007-7-28 18:42:33 > top of Java-index,Java Essentials,New To Java...
# 11

> ...

> then tried again the command:

>

> path=%path%;c:\program files\java6.0\bin;

>

> and received the same error message:

>

> HelloUser.java:9: reached end of file while parsing

> }

> 1 error

>

> Any clarification on this error message?

>

> Thanks

>

> Jimbo

Reply #7.

prometheuzza at 2007-7-28 18:42:33 > top of Java-index,Java Essentials,New To Java...
# 12

> > ...

> > I am aware that this problem is regarding my path

> > variable, after setting me path correctly, I still

> > recieve this message. My path is set too..

>

> Did you try a re-boot?

Hi

Yeh tried to reboot, no change got the same message regarding the javac command not being recognised. I have also double checked my path variable to ensure it is correct.

Any other suggestions would be greatly appreciated from anyone

Thanks

Jimbo

JimmySmith07a at 2007-7-28 18:42:33 > top of Java-index,Java Essentials,New To Java...
# 13

> Yeh tried to reboot, no change got the same message

> regarding the javac command not being recognised. I

> have also double checked my path variable to ensure

> it is correct.

>

> Any other suggestions would be greatly appreciated

> from anyone

>

> Thanks

>

> Jimbo

There is no other suggestion. If you still get a "javac command not recognized" message when (trying to) execute javac, then you did not add it to the PATH properly. Period.

prometheuzza at 2007-7-28 18:42:33 > top of Java-index,Java Essentials,New To Java...
# 14

> > Yeh tried to reboot, no change got the same

> message

> > regarding the javac command not being recognised.

> I

> > have also double checked my path variable to

> ensure

> > it is correct.

> >

> > Any other suggestions would be greatly appreciated

> > from anyone

> >

> > Thanks

> >

> > Jimbo

>

> There is no other suggestion. If you still get a

> "javac command not recognized" message when

> (trying to) execute javac, then you did not add it to

> the PATH properly. Period.

Hi,

No doubt this is my error, I admit I am new to this, my path is (as copied from the path variable):

C:\Program Files\Java\jdk1.6.0_02\bin;

Ive ensure there is a semi colon after the previous variable and have also rebooted my system obviously using a fresh cmd window.

Am I missing something?

Regards

Jimbo

JimmySmith07a at 2007-7-28 18:42:33 > top of Java-index,Java Essentials,New To Java...
# 15

> ...

> C:\Program Files\Java\jdk1.6.0_02\bin;

>

> Ive ensure there is a semi colon after the previous

> variable and have also rebooted my system obviously

> using a fresh cmd window.

>

> Am I missing something?

>

> Regards

>

> Jimbo

Try: http://www.computerhope.com/issues/ch000549.htm

or Google for "windows how to set path":

http://www.google.com/search?hl=en&q=windows+how+set+path&btnG=Google+Search

Note that this (the PATH issue) has nothing to do with your curly bracket problem.

prometheuzza at 2007-7-28 18:42:39 > top of Java-index,Java Essentials,New To Java...