Difference between revisions of "Java Classpath Windows"

From Redbrick Wiki
Jump to navigation Jump to search
m
(Added images to page.)
 
Line 16: Line 16:
 
Now when you run javac it will check the C:\Program Files\Redbrick directory for any class or jar files and include them in your project.<br>
 
Now when you run javac it will check the C:\Program Files\Redbrick directory for any class or jar files and include them in your project.<br>
 
You will need to close and reopen any terminals you are currently using as it does not affect the current session.
 
You will need to close and reopen any terminals you are currently using as it does not affect the current session.
 +
 +
<u>Images</u>
 +
<gallery>
 +
Image:Java_Classpath_Img_1.png | Step 1
 +
Image:Java_Classpath_Img_2.png | Step 2
 +
Image:Java_Classpath_Img_2-1.png | Step 2.1
 +
Image:Java_Classpath_Img_3.png | Step 3
 +
Image:Java_Classpath_Img_3-1.png | Step 3.1
 +
Image:Java_Classpath_Img_4.png | Step 4
 +
Image:Java_Classpath_Img_6.png | Step 6
 +
Image:Java_Classpath_Img_7.png | Step 7
 +
</gallery>

Latest revision as of 19:28, 7 October 2011

The Java Classpath is a list of the directories and files on the disk that the java development kit will scan when compiling a program.
These directories and files contain classes that can then be used in your program.

This can be added or modified on Windows by following the following steps.

1) Open My Computer (Computer)
2) Right click and select properties.
3) Select Advanced Systems Settings from the left navigation bar.
4) Open the Advanced Tab of the Systems Properties Window.
5) Select Environment Variables.
6) If class path already exists select it and click edit otherwise click new.
7) Enter CLASSPATH as the variable name.
As the variable value enter the following: "C:\Program Files\Redbrick;C:\Program Files\Redbrick\*;."


Now when you run javac it will check the C:\Program Files\Redbrick directory for any class or jar files and include them in your project.
You will need to close and reopen any terminals you are currently using as it does not affect the current session.

Images