Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDK 7u3 : problem checking configured properly

 
Steven Desair
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having problems checking whether my JDK is configured properly. I found this discussion (http://www.coderanch.com/t/525422/java/java/Issues-checking-JDK-configured-properly) but I've started a new thread because I believe that it might have something to do with JDK 7 vs JDK 6.

This is what I've done so far.

-downloaded jdk-7u3-windows-x64 (which is around 90 mb);
-system variables: JAVA_HOME C:\Java\jre7 & Path %JAVA_HOME%\bin; placed at the beginning of the Variable value field ;

when in command prompt:
javac -version: gives error "'javac' is not recognized as an internal or external command, operable program or batch file "

java -version:
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b05)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)

in C:\Java\jre7\bin:

There is no javac.exe. This will probably be the problem, but I don't understand why it isn't there. I've downloaded SDK (double checked this).

Is this a problem which occurs because of my choice of JDK 7. Should I try to download JDK 6 instead?

Many thanks in advance,

Steven
 
Campbell Ritchie
Sheriff
Pie
Posts: 49382
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Did you install into C:\Java? The default location is C:\Program Files\Java\jdk1.7.0_03\bin. Look in there to see whether the javac.exe file exists. In which case your JAVA_HOME variable should read more like C:\Program Files\Java\jdk1.7.0_03
Have a look at our FAQ which has a bit about JAVA_HOME in.
 
Steven Desair
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your quick response (and the welcome ;) )

I've went through the FAQ step by step, but hit a wall when trying to check my configuration.I did decide to install it to c:\Java\.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49382
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean c:\Java or c:\java\jdk7 or c:\java\jdk1.7.0_03? Look in those locations, find the bin folder and look inside that. You should have over 40 files in the bin folder: like this
appletviewer java jconsole jrunscript native2ascii schemagen xjc
apt javac jcontrol jsadebugd orbd serialver
ControlPanel javadoc jdb jstack pack200 servertool
extcheck javah jhat jstat policytool tnameserv
idlj javap jinfo jstatd rmic unpack200
jar java-rmi.cgi jmap jvisualvm rmid wsgen
jarsigner javaws jps keytool rmiregistry wsimport
That’s on a Linux® box, so the names are missing the .exe extensions, but you should have more or less the same files. If you find those files, all you have to do is to set your PATH to include them; you are doing it by using the JAVA_HOME variable. If you don’t find them, try a search for them by name, particularly javac.exe. If you still can’t find them, it is probably quicker to reinstall Java™.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49382
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to reopen your command prompt before the new PATH takes effect, but after these many hours you have probably done that already.
 
Joanne Neal
Rancher
Posts: 3742
16
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Steven Desair wrote:Thanks for your quick response (and the welcome ;) )

I've went through the FAQ step by step, but hit a wall when trying to check my configuration.I did decide to install it to c:\Java\.

It appears to be the JRE that you've installed in c:\java. Where did you install the JDK ? The JRE does not include javac.exe but does include java.exe. The JDK includes both.
 
Steven Desair
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Success !

C:\Users\Steven>javac -version
javac 1.6.0_31

Instead of the JDK 7, I installed JDK 6 which does to what is expected.

Many thanks for the replies and the guidelines,

Steven
 
Campbell Ritchie
Sheriff
Pie
Posts: 49382
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what went wrong with your Java7 installation?
 
Steven Desair
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have no clue.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15356
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you install the JRE instead of the JDK (that's what it looks like in your first post)? The JRE does not include the Java compiler (javac).
 
Campbell Ritchie
Sheriff
Pie
Posts: 49382
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you still have the jdk...exe file, you can reinstall it in a couple of minutes. If you allow it its default location, you can add what I said yesterday to your PATH. Remember the new Java™ installation belongs at the start of the PATH, any previous installations which you added yourself should be deleted, and you have to re-open the command prompt before you feel its benefits.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49382
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It might be that you have simply set your PATH wrongly; maybe it will all work if you change jre7 to jdk7... in the JAVA_HOME you quoted. And, of course, re-open the command line. Using JAVA_HOME like that obviates the necessity to delete anything from your PATH when you install a newer version.
 
Steven Desair
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for all the tips.

I'm sure I've downloaded the JDK package. It seems that it only installed the JRE (if that is possible).

For now, I'm happy with the working JDK 6.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic