This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Hey All, Sorry to be such a pain, but in desperate measures, I am back because I HAVE to get this to work.
I simply cannot get the classpath to work. I have moved j2sdk1.4.2_06 to C:\Temp and at the dos prompt it keeps telling me that 'javac' is not recognized. I then dl The Java 2 SDK in hopes that I hadn't dl the correct version of java. (i am desperate) I have been to Microsoft's site and I have read the links you guys have put up. Thank you by the way... I have Here's about all that the C:\ prompt will let me do. when the window opens, i get C:\Documents and Settings\My Name. I then type cd C:\Temp and it does. (now both versions of the java program is in the Temp folder) I then type set classpath= I then try to compile using javac. nothing happens. i feel like a retard!! lol I read fully the post of Jackii Jonsen, and followed it, but still nothing happened. (http://www.coderanch.com/t/398201/java/java/having-trouble-running-Java) please help... thanks for your patience.. Moxyi3
Joined: Jan 11, 2005
it keeps telling me it is not recognized or not an internal command. i have even typed 'javac' after bin, but nothing happens that way either. ??? C:\Temp\Sun\AppServer\jdk\bin
so i guess, the question is why wouldn't this work??? thanks, moxyi3
please take a look at our naming policy and adjust your display name in your profile. Thanks!
And for getting more answers to your questions, you might want to use more expressive subject lines.
Anyway, have fun at the Ranch!
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
When beginning to learn Java, typically CLASSPATH should not be set to any value at all. The problem you are encountering is becuase the PATH variable is not set correctly. Your operating system uses PATH to find programs that it can run. In this case, the OS needs to know where to locate javac and java. As indicated by Ioan above, you need to make sure PATH include your JDK installation directory.
On the other hand, Java uses CLASSPATH to locate .class files when you run the program you wrote. If CLASSPATH is not set, then Java will only look in the current directory for .class files. When you are starting this is typically what you want, so you should probably not set the CLASSPATH variable.