I've run java programs in Command Prompt before and it worked,
but today I tried and it's saying:

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

I am running Windows Vista and have four (4) files under Java:
jdk1.6.0_23
jdk1.6.0_24
jre1.6.0
jre6

Umm, help?

Thanks,

- WolfShield

Ahh your environment variables need to be set up.

This is what you need to do:
1. First you need find the jdk1.6.0_24 folder as this is the latest version, the inside the jdk1.6.0_24 folder find a folder called "bin", open this folder and you will see a load of files including the "javac.exe" right click on any of these files and click on properties.
2. Now you will see a windows menu pop up, find the label where it says "Location", once you find it copy what it says for the location as this is the path you need to input into the environment variables.
3. Once you copy the path, click on the Start button, then click on Control Panel.
4. In the Control Panel search box type "environment" and wait for the results, you should see something like "Edit the system environment variables", click on this and if you are prompted for admin permission accept it so you can move on.
5. Now you will see a set up menu pop up, in the bottom right corner you will see a button called "Environment Variables" click on this.
6. You will now see the environment variables menu, here there will be two types of sub menus where one is labeled "User variabls for <YOUR USERNAME>" and the other one is "System Variables" all you need to do is in the system variables click the "New" button.
7. Once you click the new button type in the following details:
Variable Name: Java
Variable Value: <Paste the path you copied earlier from the Java folder, it should look something like this C:\Program Files\Java\jdk1.6.0_24\bin>
8. You should be done, let me know if you need anymore help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.