• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems compiling with DOS!

 
Waria Ahmed
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I�m trying to compile a file using DOS but I keep getting the error message �javac is not recognized as an internal or external command, operable program or batch file�

How do I get around to fixing this problem, I have installed JDK1.4, and followed the instructions, but maybe I haven�t set the class path right?

Any tips for a beginner?
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just right click on MyComputer goto Properties..Click the Advanced Tab..and click the Environment Variables button..Click New button under UserVariable option then set the name as JAVA_HOME and value as /home/where/your/jdk_is/..
Then try to compile the program..it works..If you still face then just navigate to your bin folder of jdk and try compile your program....
 
Rajkamal Pillai
Ranch Hand
Posts: 445
1
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The PATH environment variable needs to contain the Jdk/bin folder.

Cheers,
Raj.
 
Campbell Ritchie
Sheriff
Pie
Posts: 48938
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Very common problem; we have all had it.
Why are you using Java1.4.2, which was superseded nearly 4 years ago? Go back to the Sun website and download the latest stable version, which came out this week, and you will find it called JDK 6 update 7.
Install that as usual, and as you go, watch very closely for the name of the folder Windows installs it into. It says "Install into C:\Program Files\java\jdk1.6.0_07 or choose another folder" and most people use the default option, but remember the name of the folder.

Now navigate to this page in the Java Tutorials and you will see your problem at the top of the page. Read that. You see you have to update your PATH variable. On the page there is a link to the installation instructions. It says "update the PATH variable (optional)". Never mind about "optional"; do exactly what it says about updating PATH permanently. There is no need to do anything with the classpath.
Remember:
  • The PATH variable you want begins with C: (usually) and ends with bin (always).
  • The tiniest spelling error will stop it working.
  • Your computer will find the "javac.exe" program in the first Java folder it finds in the PATH, so it is best only to have one Java folder in the PATH.
  •  
    Marilyn de Queiroz
    Sheriff
    Posts: 9063
    12
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by Campbell Ritchie:
    Why are you using Java1.4.2, which was superseded nearly 4 years ago?

    I think you'd be surprised at how many companies are still using Java1.4.2.
     
    marc weber
    Sheriff
    Posts: 11343
    Java Mac Safari
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by Marilyn de Queiroz:
    ...I think you'd be surprised at how many companies are still using Java1.4.2.

    Or even earlier!
     
    Campbell Ritchie
    Sheriff
    Pie
    Posts: 48938
    60
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Yes, I'd forgotten there are still people on Java1.4.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic