javac is not recognized as internal or external command....

  • (2 Pages)
  • +
  • 1
  • 2

16 Replies - 1844 Views - Last Post: 04 December 2015 - 10:09 AM

#1 X.chan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 02-October 15

javac is not recognized as internal or external command....

Posted 28 November 2015 - 11:01 AM

hello programmers,

I need your help in this problem,
I know that there is a way to compile any Java program using the terminal window (cmd)
but when i try to do that, cmd show me that " javac is not recognized as internal or external command, operable program or batch file".

I try to know what the problem is, and watch many youtube videos to fix that.
then, I think the problem that i have no javac.exe in JDK folder :dozingoff:

could anyone tell me how to get that file (javac.exe)?
If that is not the problem, can anyone guess what it is ? -__-"
should i reinstall java again or ... ? :dontgetit:

thank you very much <3

Is This A Good Question/Topic? 0
  • +

Replies To: javac is not recognized as internal or external command....

#2 NormR  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 644
  • View blog
  • Posts: 4,844
  • Joined: 25-December 13

Re: javac is not recognized as internal or external command....

Posted 28 November 2015 - 11:34 AM

Quote

i have no javac.exe in JDK folder

How did you install the JDK? It should have a javac.exe file in its bin folder.

How are you trying to execute the javac command? What is the command line you use?

I use the full path to the javac file for compiling:
C:\Program Files\Java\jdk1.8.0_60\bin\javac.exe -cp . -Xlint TestCode21.java
Was This Post Helpful? 0
  • +
  • -

#3 X.chan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 02-October 15

Re: javac is not recognized as internal or external command....

Posted 28 November 2015 - 11:59 AM

View PostNormR, on 28 November 2015 - 11:34 AM, said:

Quote

i have no javac.exe in JDK folder

How did you install the JDK? It should have a javac.exe file in its bin folder.

How are you trying to execute the javac command? What is the command line you use?

I use the full path to the javac file for compiling:
C:\Program Files\Java\jdk1.8.0_60\bin\javac.exe -cp . -Xlint TestCode21.java


Yes! and I am surprised too that JDK does not have javac.exe.
I originally found javac.exe out of JDK bin... this leads me to think that therein lies the problem..
i tried to cut javac file and paste in JDK file, but it is uselessss :(

+
well, i went to the environment variables and created a new variable called Path, then i put the peth of the JDK bin in Path's value.
isn't that correct ? :dontgetit:
Was This Post Helpful? 0
  • +
  • -

#4 NormR  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 644
  • View blog
  • Posts: 4,844
  • Joined: 25-December 13

Re: javac is not recognized as internal or external command....

Posted 28 November 2015 - 12:05 PM

Does your JDK folder contain a bin folder? Is there a javac.exe file in that folder?

Adding the path to the JDK's bin folder onto the PATH environment variable will allow you to use the commands in the bin folder without having to addon their paths.

This post has been edited by NormR: 28 November 2015 - 12:05 PM

Was This Post Helpful? 0
  • +
  • -

#5 X.chan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 02-October 15

Re: javac is not recognized as internal or external command....

Posted 28 November 2015 - 12:18 PM

Quote

Does your JDK folder contain a bin folder? Is there a javac.exe file in that folder?

Oh, sorry .. it is a little complicated, :unsure:
originally, NO !
But i found file without extension named "javac"out of the JDK's bin folder, i cut this file and pasted it in JDK's bin folder.
Was This Post Helpful? 0
  • +
  • -

#6 no2pencil  Icon User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6552
  • View blog
  • Posts: 30,682
  • Joined: 10-May 07

Re: javac is not recognized as internal or external command....

Posted 28 November 2015 - 12:20 PM

This isn't a Java problem, it is in your system/shell path setup. Moving to Computer Support -> Operating Systems -> Windows
Was This Post Helpful? 0
  • +
  • -

#7 NormR  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 644
  • View blog
  • Posts: 4,844
  • Joined: 25-December 13

Re: javac is not recognized as internal or external command....

Posted 28 November 2015 - 12:26 PM

Quote

file without extension named "javac"

That doesn't sound right. On a Windows OS the javac compiler file has an extension of .exe
Was This Post Helpful? 0
  • +
  • -

#8 X.chan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 02-October 15

Re: javac is not recognized as internal or external command....

Posted 28 November 2015 - 12:28 PM

Quote

his isn't a Java problem, it is in your system/shell path setup.


Could you please explain more around the problem? and how can i fix it ? >.<
Was This Post Helpful? 0
  • +
  • -

#9 X.chan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 02-October 15

Re: javac is not recognized as internal or external command....

Posted 28 November 2015 - 12:34 PM

Quote

That doesn't sound right. On a Windows OS the javac compiler file has an extension of .exe


OK. What do you recommend me to do ? :sad2:
Was This Post Helpful? 0
  • +
  • -

#10 NormR  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 644
  • View blog
  • Posts: 4,844
  • Joined: 25-December 13

Re: javac is not recognized as internal or external command....

Posted 28 November 2015 - 12:35 PM

I have no idea how the JDK could have been installed without a javac.exe file in the bin folder.

My only idea to fix it would be to re-install the JDK.
Was This Post Helpful? 0
  • +
  • -

#11 no2pencil  Icon User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6552
  • View blog
  • Posts: 30,682
  • Joined: 10-May 07

Re: javac is not recognized as internal or external command....

Posted 28 November 2015 - 12:41 PM

Open a command prompt & type echo %PATH%. Take note of where javac is, update your system path.

View PostNormR, on 28 November 2015 - 02:35 PM, said:

I have no idea how the JDK could have been installed without a javac.exe file in the bin folder.

My only idea to fix it would be to re-install the JDK.

Is it possible that the OP installed Java, & not an SDK with the compiler?

View PostX.chan, on 28 November 2015 - 01:59 PM, said:

well, i went to the environment variables and created a new variable called Path, then i put the peth of the JDK bin in Path's value.
isn't that correct ? :dontgetit:

Please note that your existing shell will not import the new settings. After changing the system path via the GUI interface you would need to close any existing cmd prompt Windows & open a new one.
Was This Post Helpful? 0
  • +
  • -

#12 X.chan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 02-October 15

Re: javac is not recognized as internal or external command....

Posted 28 November 2015 - 12:52 PM

Quote

Open a command prompt & type echo %PATH%. Take note of where javac is, update your system path.


Hmmm, i didn't find it.. =_="

Quote

Please note that your existing she'll will not import the new settings. After changing the system path via the GUI interface you would need to close any existing cmd prompt Windows & open a new one.

Yes, i didn't forget doing that ..
Was This Post Helpful? 0
  • +
  • -

#13 NormR  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 644
  • View blog
  • Posts: 4,844
  • Joined: 25-December 13

Re: javac is not recognized as internal or external command....

Posted 28 November 2015 - 01:33 PM

Open a command prompt window, change to the JDK's bin folder and enter the command: dir *exe
copy the contents of the window and paste it here.

Here's what I get:

Quote

C:\Program Files\Java\jdk1.8.0_60\bin>dir *.exe
Volume in drive C has no label.
Volume Serial Number is 94A6-33DC

Directory of C:\Program Files\Java\jdk1.8.0_60\bin

09/18/2015 07:58 PM 15,936 appletviewer.exe
09/18/2015 07:58 PM 16,448 extcheck.exe
09/18/2015 07:58 PM 16,448 idlj.exe
09/18/2015 07:58 PM 33,856 jabswitch.exe
09/18/2015 07:58 PM 15,936 jar.exe
09/18/2015 07:58 PM 16,448 jarsigner.exe
09/18/2015 07:58 PM 15,936 java-rmi.exe
09/18/2015 07:58 PM 206,912 java.exe
09/18/2015 07:58 PM 15,936 javac.exe
09/18/2015 07:58 PM 16,448 javadoc.exe
09/18/2015 07:58 PM 133,696 javafxpackager.exe
09/18/2015 07:58 PM 15,936 javah.exe
09/18/2015 07:58 PM 15,936 javap.exe
09/18/2015 07:58 PM 133,696 javapackager.exe
09/18/2015 07:58 PM 206,912 javaw.exe
09/18/2015 07:58 PM 322,112 javaws.exe
09/18/2015 07:58 PM 15,936 jcmd.exe
09/18/2015 07:58 PM 16,960 jconsole.exe
09/18/2015 07:58 PM 16,448 jdb.exe
09/18/2015 07:58 PM 15,936 jdeps.exe
09/18/2015 07:58 PM 15,936 jhat.exe
09/18/2015 07:58 PM 16,448 jinfo.exe
09/18/2015 07:58 PM 15,936 jjs.exe
09/18/2015 07:58 PM 16,448 jmap.exe
09/18/2015 07:58 PM 321,600 jmc.exe
09/18/2015 07:58 PM 15,936 jps.exe
09/18/2015 07:58 PM 16,448 jrunscript.exe
09/18/2015 07:58 PM 16,448 jsadebugd.exe
09/18/2015 07:58 PM 16,448 jstack.exe
09/18/2015 07:58 PM 15,936 jstat.exe
09/18/2015 07:58 PM 15,936 jstatd.exe
09/18/2015 07:58 PM 196,672 jvisualvm.exe
09/18/2015 07:58 PM 16,448 keytool.exe
09/18/2015 07:58 PM 16,448 kinit.exe
09/18/2015 07:58 PM 16,448 klist.exe
09/18/2015 07:58 PM 16,448 ktab.exe
09/18/2015 07:58 PM 16,448 native2ascii.exe
09/18/2015 07:58 PM 16,448 orbd.exe
09/18/2015 07:58 PM 16,448 pack200.exe
09/18/2015 07:58 PM 16,448 policytool.exe
09/18/2015 07:58 PM 15,936 rmic.exe
09/18/2015 07:58 PM 15,936 rmid.exe
09/18/2015 07:58 PM 16,448 rmiregistry.exe
09/18/2015 07:58 PM 16,448 schemagen.exe
09/18/2015 07:58 PM 16,448 serialver.exe
09/18/2015 07:58 PM 16,448 servertool.exe
09/18/2015 07:58 PM 16,448 tnameserv.exe
09/18/2015 07:58 PM 197,184 unpack200.exe
09/18/2015 07:58 PM 15,936 wsgen.exe
09/18/2015 07:58 PM 16,448 wsimport.exe
09/18/2015 07:58 PM 16,448 xjc.exe
51 File(s) 2,435,776 bytes
0 Dir(s) 96,723,623,936 bytes free

C:\Program Files\Java\jdk1.8.0_60\bin>

Was This Post Helpful? 0
  • +
  • -

#14 no2pencil  Icon User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6552
  • View blog
  • Posts: 30,682
  • Joined: 10-May 07

Re: javac is not recognized as internal or external command....

Posted 28 November 2015 - 08:26 PM

View PostX.chan, on 28 November 2015 - 02:52 PM, said:

Quote

Open a command prompt & type echo %PATH%. Take note of where javac is, update your system path.


Hmmm, i didn't find it.. =_="


View PostNormR, on 28 November 2015 - 03:33 PM, said:

Open a command prompt window, change to the JDK's bin folder and enter the command: dir *exe
copy the contents of the window and paste it here.

Here's what I get:

Quote

C:\Program Files\Java\jdk1.8.0_60\bin>dir *.exe
Volume in drive C has no label.
Volume Serial Number is 94A6-33DC

Directory of C:\Program Files\Java\jdk1.8.0_60\bin

...
09/18/2015 07:58 PM 15,936 javac.exe


These are conflicting statements. What is the output of echo %PATH%? I am willing to bet it doesn't contain " C:\Program Files\Java\jdk1.8.0_60\bin". If it is in fact missing, follow this tutorial.
Was This Post Helpful? 0
  • +
  • -

#15 X.chan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 02-October 15

Re: javac is not recognized as internal or external command....

Posted 04 December 2015 - 09:54 AM

OOH ! I found it in Program File folder. . It's entirely my fault . . I was searching in Program Files(x86) folder =((. .

I don't understand why there is a copy of Java there !

Anyway, thank you so much for your help, NormR & no2pencil. <333
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2