Javac help.

Status
Not open for further replies.
Resolved!

For anyone else having problems, the way I did it is to right-click on My Computer, then >properties >advanced system settings >environment variables, then copy the filepath of the bin. file in the JRE folder to the variable called "path" in the System Variables window. (WINDOWS 7)

Thanks for your help guys.
 
For anyone in the future..

Installing Java - Windows and Mac users only

1. You will need to first get a Java Development Kit ( JDK ) from Sun Micro-systems. You want to select the option for "JDK 6 Update XX" ( the one that is not bundled with anything ) and accept the license agreement on the next page. XX is the update number, and you generally want the most recent update. Windows Users: Selecting Offline installation will download an executable file that you will have to click on. Selecting on line installation will download the installation materials from the web. I didn't see a difference. Maybe you will? Mac Users: For the JDK, you will need to install Xcode. You can find more details here .

2. You will now need to install the JDK. Windows Users: double click on the JDK you downloaded and it will auto-install. Go with the defaults.

Windows Users Only - More JDK installation

Windows users will now need to add the new jdk path to their PATH variable to use it. The PATH variable under windows is a list of directories where valid commands lie. We need to edit this variable to allow the use of the Java JDK.

1. First, find out the path to the java executables. Ssearch your computer for a directory that contains java.exe and javac.exe ( typically, this will be under C:\Program Files\Java\bin or something like that ). Remember this value.

2. The PATH system variable is a list of directories where valid commands hang out. When you type a command at the command prompt, all the directories in the PATH variable are checked to see if they contain the command you typed. We want to add the directory where javac.exe and java.exe hang out to the PATH variable. This way, when we type javac at the command prompt, it will know where to find javac.exe.

1. First, you need to find out where javac.exe and java.exe are. Either do a search, or browse your C:\Program Files for it. Traditionally, they can be found in C:\Program Files\Java\jdk1.6.0_XX\bin. XX is the update number of your jdk. Though recently I saw one JDK install to C:\Sun\SDK\jdk\bin. Once you find this folder, write down the location.
2. Right click on the my computer icon and select properties.
3. In the box that opens, click the "Advanced" tab.
4. At the bottom left of the tab, you should see a button labeled Environment Variables.
5. In the box that opens, look for the variable called path or PATH in the system variables section.
6. highlight this variable and select edit.
7. You should get a box that lists the variable name and the current value of the variable. It may say something like this.... C:\WINDOWS\System32;C:\WINDOWS Your is likely to have more than just this. The ; here is used to separate the different directories.
8. What you want to do is add the directory discovered in Step 1 above to the path. So go to the end of the Variable Value box and add that directory. So, assuming the traditional location, you would add... ;C:\Program Files\Java\jdk1.6.0_XX\bin (again, XX is the update number) Notice the ; in front of the C. This is how the path variable separates out the directories. So, given the example in Step 7, your new Variable Value would be.... C:\WINDOWS\System32;C:\WINDOWS;C:\Program Files\Java\jdk1.6.0_XX\bin (where XX is your update number).

Again, note, that you need add whatever path you found on your machine. It could be different than the example I have. Also note, there should be no space between a ; and C.

Again, you are likely to have more directories in your path.

Paulo would like to remind you to make certain you spell everything perfectly and that you pay attention to which letters are upper case vs. which letters are lower case.
9. 8) You should now be ready to compile and execute java programs!!!!! Go ahead and test this now. If when you execute, you get the error java.lang.noClassDefFound ( or something similar ), then do the following....


These were written up by my java instructor and are good IMO.
 
Status
Not open for further replies.
Back
Top Bottom