aspose file tools*
The moose likes Java in General and the fly likes Installing Java Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Installing Java Problem" Watch "Installing Java Problem" New topic
Author

Installing Java Problem

Willem Krayenhoff
Greenhorn

Joined: Aug 01, 2012
Posts: 2
Hi,

I was following http://www.coderanch.com/how-to/java/how-to-create-java-program#SettingJavahomeAndPath

I got to this part:

Checking that your JDK is configured properly

Open the command prompt, go to a directory different from your JDK install directory, and type "javac -version". This should display the version of your SDK. Make sure it is correct. If an error like "Command not found" is displayed, make sure you have correctly set your PATH.


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

I have attached screen clippings of the directory structure and how I configured the path and JAVA_HOME variables.

thanks for your help!



[Java Directory Structure.PNG]

[Path and JAVA_HOME.PNG]

Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3967
    
  17

Your JAVA_HOME is pointing to C:\Program Files\Java\jre7\. A JRE is the runtime only, and doesn't have the compiler. You need to either specifically add C:\Program Files\Java\jdk1.7.0_05\bin to the PATH variable, or you need to change JAVA_HOME to C:\Program Files\Java\jdk1.7.0_05.

Then make sure you close the command prompt and re-open it.


Steve
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3967
    
  17

And welcome to the Ranch!
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19552
    
  16

Steve Luke wrote:or you need to change JAVA_HOME to C:\Program Files\Java\jdk1.7.0_05.

That's the only proper solution. JAVA_HOME should never point to a JRE.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Willem Krayenhoff
Greenhorn

Joined: Aug 01, 2012
Posts: 2
It's working now - thank you very much! Seems obvious now, but I wasn't seeing it before.
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 860

And you should never install to "Program Files"!!

The space there causes all sorts of grief unless JAVA_HOME is in quotes.

WP
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Installing Java Problem
 
Similar Threads
Installing Java and setting up variables path
compiling servlet
Running code
Error: Cannot find symbol during Importing package
Cannot run program from another directory other than c:\Sun\SDK\jdk\bin