This tutorial will explain how to set and change the path system variable for Java. This is designed to be easy as possible with simple steps. If you have any questions regarding this tutorial, please leave a reply to this thread or send me a PM and I will try to answer it.
Now to the tutorial!:
STEP 1: Downloading Java
-Skip this if you already have the latest version of Java-
1. Before doing anything with Java, you will need to download it (if you haven't done so already.)
2. Go to http://java.com/en/ and click on the red button "Free Java Download"
3. Once you do that, you should see
Congratulations!
You have the recommended Java installed
or
Download Java for Windows
Note: The operating system should be the one you have, if not click on "see on downloads here"
4. Once you download the right version of java, make sure you let Java download itself in its default directory, unless you know what you are doing.
5. Once done with that, you will need to download Java Development Kit (JDK). Click here.
6. Make sure you download the latest version of JDK also. Let it save in it's default directory as well.
STEP 2: Setting the paths.
-Make sure you have completed step 1 before starting this-
1. Find the area which you downloaded the 2 Java files. The default location should be in C:\Program Files\Java for Windows. Sorry I don't know for Macs yet.
2. To set your paths now, find computer (or My Computer) and right click it.
3. In the contect menu, you should see properties. Click on it.
4. Click on Advanced System Settings in the top left.
5. You should see a box and in the bottom of it click on Enviornment Variables.
6. Now under System Variable, you should see one that says PATH.
7. Edit it. Don't change the title but change the location. Go to C:\Program Files\Java and open up the JDK folder.
8. Inside, there is a bin folder. Open that. Now left click the address bar so you can get the location of the bin folder.
9. Place that into the variable value.
10. Now you are done.
NOTE: If you want to create more than one PATH variable, create them under User Variables. Name the variable PATH and find the folder you want.
For something like MCP, it requires that JDK and JRE are Java paths. To do that, just create a user based variable, and name it PATH. Then go to the bin folder of JRE and add the location of it and that to the variable value.
Here are some videos to help you understand it better: (None of these are made by me!)
I would greatly appreciate it if someone told me how to set paths for Macs!
Also if you have questions or want me to change something just leave a reply.
Here are some quick steps:
Setting Path on Windows
For Windows XP:
1.Start -> Control Panel -> System -> Advanced
2.Click on Environment Variables, under System Variables, find PATH, and click on it.
3.In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
4.Close the window.
5.Reopen Command prompt window, and run your java code.
For Windows Vista:
1.Right click “My Computer” icon
2.Choose “Properties” from context menu
3.Click “Advanced” tab (“Advanced system settings” link in Vista)
4.In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
5.Reopen Command prompt window, and run your java code.
Setting Path on Solaris and Linux
To find out if the java executable is in your PATH, execute:
% java -version
This will print the version of the java executable, if it can find it. If you get error java: Command not found. Then path is not properly set.
To find out which java executable the first one found in your PATH, execute:
% which java
Below are the steps to set the PATH permanently
For bash Shell:
1.Edit the startup file (~/ .bashrc)
2.Modify PATH variable:
PATH=/usr/local/jdk1.6.0/bin
3.export PATH
4.Save and close the file
5.Open new Terminal window
6.Verify the PATH is set properly
% java -version
For C Shell (csh):
1.Edit startup file (~/ .cshrc)
2.Set Path
set path=(/usr/local/jdk1.6.0/bin )
3.Save and Close the file
4.Open new Terminal window
5.Verify the PATH is set properly
% java -version
Did you create 2 variables, one for JDK and one for JRE? Make sure you created them in the user created variables. Oh also make sure that you give the address of the BIN folder for both.
I'm sorry if this is a noob thing, but when i open up my Java file, there is no JDK file at all. I searched my entire computer for one and it doesn't exist at all. The only thing that is in there is jre6 and jre7. Help? I just want to be able to use a bukkit server! oh and i already reinstalled java twice making sure it was for my operating system and everything.
Now to the tutorial!:
STEP 1: Downloading Java
-Skip this if you already have the latest version of Java-
1. Before doing anything with Java, you will need to download it (if you haven't done so already.)
2. Go to http://java.com/en/ and click on the red button "Free Java Download"
3. Once you do that, you should see
or
Note: The operating system should be the one you have, if not click on "see on downloads here"
4. Once you download the right version of java, make sure you let Java download itself in its default directory, unless you know what you are doing.
5. Once done with that, you will need to download Java Development Kit (JDK). Click here.
6. Make sure you download the latest version of JDK also. Let it save in it's default directory as well.
STEP 2: Setting the paths.
-Make sure you have completed step 1 before starting this-
1. Find the area which you downloaded the 2 Java files. The default location should be in C:\Program Files\Java for Windows. Sorry I don't know for Macs yet.
2. To set your paths now, find computer (or My Computer) and right click it.
3. In the contect menu, you should see properties. Click on it.
4. Click on Advanced System Settings in the top left.
5. You should see a box and in the bottom of it click on Enviornment Variables.
6. Now under System Variable, you should see one that says PATH.
7. Edit it. Don't change the title but change the location. Go to C:\Program Files\Java and open up the JDK folder.
8. Inside, there is a bin folder. Open that. Now left click the address bar so you can get the location of the bin folder.
9. Place that into the variable value.
10. Now you are done.
NOTE: If you want to create more than one PATH variable, create them under User Variables. Name the variable PATH and find the folder you want.
For something like MCP, it requires that JDK and JRE are Java paths. To do that, just create a user based variable, and name it PATH. Then go to the bin folder of JRE and add the location of it and that to the variable value.
Here are some videos to help you understand it better: (None of these are made by me!)
I would greatly appreciate it if someone told me how to set paths for Macs!
Also if you have questions or want me to change something just leave a reply.
Here are some quick steps:
Setting Path on Windows
For Windows XP:
1.Start -> Control Panel -> System -> Advanced
2.Click on Environment Variables, under System Variables, find PATH, and click on it.
3.In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
4.Close the window.
5.Reopen Command prompt window, and run your java code.
For Windows Vista:
1.Right click “My Computer” icon
2.Choose “Properties” from context menu
3.Click “Advanced” tab (“Advanced system settings” link in Vista)
4.In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
5.Reopen Command prompt window, and run your java code.
Setting Path on Solaris and Linux
To find out if the java executable is in your PATH, execute:
% java -version
This will print the version of the java executable, if it can find it. If you get error java: Command not found. Then path is not properly set.
To find out which java executable the first one found in your PATH, execute:
% which java
Below are the steps to set the PATH permanently
For bash Shell:
1.Edit the startup file (~/ .bashrc)
2.Modify PATH variable:
PATH=/usr/local/jdk1.6.0/bin
3.export PATH
4.Save and close the file
5.Open new Terminal window
6.Verify the PATH is set properly
% java -version
For C Shell (csh):
1.Edit startup file (~/ .cshrc)
2.Set Path
set path=(/usr/local/jdk1.6.0/bin )
3.Save and Close the file
4.Open new Terminal window
5.Verify the PATH is set properly
% java -version
Not sure what you mean. Could you rephrase it?