Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

javac and path  RSS feed

 
Wes Beeson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I've read like 15 posts with the same issue and have tried everything under the sun to get it to work but when I type javac -version into CMD i get the no javac found error.  Win 10.

This is what I have in variable value for Java_Home

C:\Program Files\Java\jdk1.8.0_121


%JAVA_HOME%\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\QuickTime\QTSystem\

Is what I have for the path.

If you need more info just let me know!
Please help! I can't even get past the Intro on this head first book!
 
John Joe
Ranch Hand
Posts: 358
2
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you installed JDK ?

You need to add the JDK bin to the system PATH too.

Example :


 
John Joe
Ranch Hand
Posts: 358
2
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javac.exe must be inside JDK (C:\Program Files\Java\jdk1.7.0_45\bin)
 
Campbell Ritchie
Sheriff
Posts: 55324
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have already set a JAVA_HOME variable, use
%JAVA_HOME%\bin;
as part of your PATH. Add that to the start of the PATH. There is more information in our FAQ.
 
Dave Tolls
Ranch Hand
Posts: 2818
30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The OP already has (see the start of the PATH listing).

Of course, if the SDK hasn't actually been installed in the first place that won't do anything.
 
Campbell Ritchie
Sheriff
Posts: 55324
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So he has. Apologies for not reading the post properly.
 
John Joe
Ranch Hand
Posts: 358
2
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe OP miss the javac.exe which normally inside the bin folder (\bin) ?
 
Dave Tolls
Ranch Hand
Posts: 2818
30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If they installed the SDK then javac would be in there.
I haven't heard of an installation that didn't have all the apps in the bin.
 
Campbell Ritchie
Sheriff
Posts: 55324
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could only have javac.exe in a different location if you specified that location as an option whilst installing Java®. It is quite possible to download a JRE by mistake, in which case java.exe will be there but not javac.exe.
Please feed the following two instructions to the command line and see what responses you get:-
java -version
javac -version
 
Dave Tolls
Ranch Hand
Posts: 2818
30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But that begs the question of where they got this from:
C:\Program Files\Java\jdk1.8.0_121

Seems a bit random.
 
Norm Radder
Ranch Foreman
Posts: 2212
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Open a command prompt and enter PATH to see what it contains.
 
Wes Beeson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was avoiding screen shots but it might help.
Capture3.PNG
[Thumbnail for Capture3.PNG]
Capture.PNG
[Thumbnail for Capture.PNG]
Capture1.PNG
[Thumbnail for Capture1.PNG]
 
fred rosenberger
lowercase baba
Bartender
Posts: 12527
48
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what happens if on the command line, you type the full path to it? i.e.:

"\Program Files\Java\jdk1.8.0_121\java.exe" -version

you have to use quotes since there is a space in "Program Files".
 
Campbell Ritchie
Sheriff
Posts: 55324
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fred rosenberger wrote:. . .
"\Program Files\Java\jdk1.8.0_121\java.exe" -version
. . .
Surely you want javac not java. And C:\ at the beginning of that instruction.
Please also show us what happens if you write
echo %PATH%
Has it got that Java installation folder in?

If none of those things produces a result, try reinstalling Java®.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16007
87
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you get from the command:

echo %JAVA_HOME%

It looks like the variable JAVA_HOME was not resolved, since in your PATH there is literally %JAVA_HOME% instead of the actual path to the JDK.
 
Campbell Ritchie
Sheriff
Posts: 55324
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wes Beeson wrote:. . . Java_Home

C:\Program Files\Java\jdk1.8.0_121


%JAVA_HOME%\bin; . . .

Is what I have for the path. . . .
I don't suppose the difference between UPPER_CASE and Book_Title_Case makes any difference, does it? Windows® is usually case‑insensitive. And also, why is the command line finding the correct java version and not javac? Don't actually know.
 
Norm Radder
Ranch Foreman
Posts: 2212
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why is the command line finding the correct java version and not javac? Don't actually know.

The JRE installation puts a path in the PATH variable:
Live;C:\ProgramData\Oracle\Java\javapath;C:

The JDK install does not add to the PATH

On my system the JRE install created/added this path to a link file:
C:\ProgramData\Oracle\Java\javapath\java.exe
 
Liutauras Vilda
Marshal
Posts: 4479
303
BSD
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Norm Radder wrote:On my system the JRE install created/added this path to a link file:
C:\ProgramData\Oracle\Java\javapath\java.exe
Probably more this C:\ProgramData\Oracle\Java\javapath.

@OP

1. open command prompt and issue instruction

2. restart command prompt
3. give a try

 
Norm Radder
Ranch Foreman
Posts: 2212
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably more this C:\ProgramData\Oracle\Java\javapath.

What I meant to say was the JRE install created a symlink file: java.exe and the folders it is in (C:\ProgramData\Oracle\Java\javapath) and placed the path to  that on the PATH.
 
Liutauras Vilda
Marshal
Posts: 4479
303
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for misreading your previous post. Understood now what you meant.
 
Wes Beeson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Liutauras Vilda wrote:
Norm Radder wrote:On my system the JRE install created/added this path to a link file:
C:\ProgramData\Oracle\Java\javapath\java.exe
Probably more this C:\ProgramData\Oracle\Java\javapath.

@OP

1. open command prompt and issue instruction

2. restart command prompt
3. give a try




It worked!! I had all but given up on this. Thank you!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!