7 Replies - 3902 Views - Last Post: 12 October 2010 - 07:35 AM Rate Topic: -----

#1 Dean_Grobler  Icon User is offline

  • D.I.C Regular

Reputation: 39
  • View blog
  • Posts: 390
  • Joined: 15-January 10

javac command in cmd prompt not working

Posted 12 October 2010 - 01:51 AM

Hello,

I've been struggling with this comandline for quite a while.. I set up my CLASSPATH perfectly. When I type "java -version" it works perfectly, when I type "java myClass" the program runs beautifuly. but when I try compliting .java files, it says something bout "javac" does not exist or something..

But why? If all the other stuff working, why doesn't javac work?
Any ideas?
Is This A Good Question/Topic? 0
  • +

Replies To: javac command in cmd prompt not working

#2 aniri  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 54
  • View blog
  • Posts: 657
  • Joined: 24-November 09

Re: javac command in cmd prompt not working

Posted 12 October 2010 - 02:01 AM

have you set the path to the javac.exe in your "path" environment variable?
Was This Post Helpful? 0
  • +
  • -

#3 Dean_Grobler  Icon User is offline

  • D.I.C Regular

Reputation: 39
  • View blog
  • Posts: 390
  • Joined: 15-January 10

Re: javac command in cmd prompt not working

Posted 12 October 2010 - 02:12 AM

uhmmm :blush:

Do you have to add that seperately also? I just add the path to the bin directory in my CLASSPATH. So in my CLASSPATH I'll just put a ";" in there and add the path to the javac.exe? Where would the javac.exe be located?

Thank you so much!
Was This Post Helpful? 0
  • +
  • -

#4 Nikhil_07n  Icon User is offline

  • The cheese stands alone..
  • member icon

Reputation: 49
  • View blog
  • Posts: 2,489
  • Joined: 09-January 09

Re: javac command in cmd prompt not working

Posted 12 October 2010 - 02:23 AM

By default, Java gets installed in the Program files folder in your System volume.
Usually, javac.exe is located in C:\Program Files\Java\jdk1.6.0_20\bin where 1.6.0_20 is the version.

Bottom line : Locate the installation, copy the address of 'bin' folder. Add ;<Address> to the path environment variable.

This post has been edited by Nikhil_07n: 12 October 2010 - 02:23 AM

Was This Post Helpful? 0
  • +
  • -

#5 s243a  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 137
  • Joined: 17-March 10

Re: javac command in cmd prompt not working

Posted 12 October 2010 - 02:27 AM

View PostDean_Grobler, on 12 October 2010 - 01:12 AM, said:

uhmmm :blush:

Do you have to add that seperately also? I just add the path to the bin directory in my CLASSPATH. So in my CLASSPATH I'll just put a ";" in there and add the path to the javac.exe? Where would the javac.exe be located?

Thank you so much!

On my system it is installed here:
C:\Program Files (x86)\Java\jdk1.6.0_21\bin

Make sure you jave sdk (AKA jdk) installed as apposed to just the runtime environment. What operating system are you using?
Was This Post Helpful? 0
  • +
  • -

#6 Dean_Grobler  Icon User is offline

  • D.I.C Regular

Reputation: 39
  • View blog
  • Posts: 390
  • Joined: 15-January 10

Re: javac command in cmd prompt not working

Posted 12 October 2010 - 02:34 AM

That's exactly what I did man, but javac not working. I have added the path to the bin directory in my enviroment variables...

I'm using Windows 7 hey...
Was This Post Helpful? 0
  • +
  • -

#7 Nikhil_07n  Icon User is offline

  • The cheese stands alone..
  • member icon

Reputation: 49
  • View blog
  • Posts: 2,489
  • Joined: 09-January 09

Re: javac command in cmd prompt not working

Posted 12 October 2010 - 06:11 AM

Check if the file javac.exe is in the bin folder or not. If not, reinstall jdk.

This post has been edited by Nikhil_07n: 12 October 2010 - 06:12 AM

Was This Post Helpful? 0
  • +
  • -

#8 guido-granobles  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 171
  • View blog
  • Posts: 617
  • Joined: 02-December 09

Re: javac command in cmd prompt not working

Posted 12 October 2010 - 07:35 AM

Are you sure that you have the Jdk instead of the JRE?
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1