wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes javac compiler installation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "javac compiler installation" Watch "javac compiler installation" New topic
Author

javac compiler installation

Kvon Arya
Greenhorn

Joined: Jan 05, 2013
Posts: 2
I have downloaded and installed jdk-7u10-windows-i586 in C:\Java\jdk1.7.0_10 directory and then under windows XP at system property>advanced>environmental variables>system variables I added a new variable JAVA_HOME with value C:\Java\jdk1.7.0_10 and also added %JAVA_HOME%\bin; to the beginning of path.
Now at command prompt when I type javac -version it says "javac is not recognized as internal or external command " but when I type java -version it comes back wit "1.7.0_10'
Checking that your JDK is configured properly at "://www.coderanch.com/how-to/java/how-to-create-java-program " is telling me javac -version should return the version, why when I type javac it's not recognized???, it does not compile either.
trying to compile with java at C:\java\src>java MooseGreetings.java gives error "could not find or load class MooseGreetings.java" , I have made sure the file " MooseGreetings.java" exists under java/src , I created this sample program with a text editor that does not append extra extensions to file name. So I have 2 problems to start:
1. Javac is not recognized
2. sample program can not be found
Could anyone help me to start???
Marjorie Gyles
Ranch Hand

Joined: Nov 03, 2012
Posts: 42

All I did was add "C:\Java\jdk1.7.0_10\bin" to my path. Works like a charm.
Kvon Arya
Greenhorn

Joined: Jan 05, 2013
Posts: 2
Thanks, it worked, javac ran , compiled the sample program and created the *.class file.
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

And welcome to the Ranch, Kvon Arya!


The quieter you are, the more you are able to hear.
Ivan Jozsef Balazs
Rancher

Joined: May 22, 2012
Posts: 866
    
    5
Marjorie Gyles wrote:All I did was add "C:\Java\jdk1.7.0_10\bin" to my path.


I do not fiddle around with PATH but put wrapping starting scripts (javac15, java15, javac16, java16, javac17, java17 etc.) which set the PATH locally and temporarily. So several versions of Java can coexist on the same box.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37884
    
  22
You can write things like export PATH=~/java/jdk1.2.2_03/bin:$PATH (*nix) or set PATH="c:\Program Files\java\jdk1.2.2_03\bin;%PATH% (Windows®).
You ought to check the syntax because I am unsure about both instructions. Those will alter the path temporarily
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javac compiler installation
 
Similar Threads
How to point PATH envirnoment to /bin directory?
Save file without unwanted extensions
Compiling Java Programs Without JDK Installation ??
Java\bin PATH setup
Trouble installing JDK 7