PDA

View Full Version : Installing Java


sopadecheche
06-29-2005, 01:57 AM
Hello gurus! I am beginning to learn how to program in Java. I downloaded the software, but I cannot run the part of the tutorial called "HelloWorldApp.java" . The prompt cannot recognize 'javac.' More specificially, it says, " 'javac' is not recognized as an internal or external command, operable program or batch files." I added C:\j2sdk1.4.2_<version>\bin to the PATH files. I don't know what else to do. I just really really want to start programming in Java, but I cannot even get it to start! I used to program in java before, and so I know I can do it, but I cannot even get the software to start now. Does anyone have any hints for me?
Thanks!!

vantim
06-29-2005, 08:12 AM
Q. 'javac' is not recognized as an internal or external command, operable program or batch file.
A. When you try to run the Java compiler from the command prompt, you receive the previous message. This occurs when the Java bin directory is not part of the PATH variable. The PATH variable is an operating system environment variable which contains the directories of those programs that you will most likely run from the command prompt. The Java bin directory is a subdirectory within the Java SDK directory (the directory that contains the Java SDK) that contains all of the Java utilities, such as the compiler. The bin directory is called bin. For example, if the Java SDK is located in the directory,

c:\jdk1.2.2

Then the bin directory is called,

c:\jdk1.2.2\bin

To determine if the bin directory is part of the PATH variable, type the following at the prompt.

path

The contents of the PATH variable will appear.

Next, determine if the Java bin directory is within the contents of the PATH variable. If it is not there then you must add it using the following command.

set path=%path%;c:\jdk1.2.2\bin

Remember the actual location of the Java bin directory is dependent on where you have installed the Java SDK on your machine.

It should be noted that this PATH setting will only be available to the command prompt window in which you have typed the previous command. It will not be available to any other command prompt windows. To make the setting permanent, you must consult the documentation for your specific operating system. Also, if you are using a machine in a networked environment, you may not have a high enough access level for making the change permanent.