This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hello everyone.. i really could use someones help right now... im new to java programing and i bought this really cool book called "head first java" its really good so far, and directed me here... but i need to put in my PATH the /bin of the java directory so i can begin java programing!!! i can't wait! so please do you think someone could give a new guy some help on the subject??? PLEASE!!! [ May 06, 2007: Message edited by: Bear Bibeault ]
How many times does your Java installation appear in your PATH? If you have more than one Java installation, your computer will pick whichever appears first in the list. And make sure you put c:\Program Files\Java\jdk1.6.0_01\bin; in the PATH, not the CLASSPATH. As Ulf Dittmer says, you will have to close and reopen your command prompt before these changes take effect. [ April 29, 2007: Message edited by: Campbell Ritchie ]
Originally posted by Ryan Medrano: naw!!! ive tried that!!!
Yep, we know the feeling.
What is this <version> doing in your .... what is this ?
You do not type: And from the rest of your questions it looks like you are taking things slightly too literally - just be patient, we all have had to deal with this problem.
Should not be on the end of what you are typing in.
You normally type in:
Or something that ends up looking like that ~ just look at the folder names where the Java executable is located, do a file / properties on a program in the java bin directory and copy the " path " directly from the small window the system displays to give you the information.
How many paths should i have?
One or more, you have one thing the system calls path, it contains one or more places to look ~ called search paths. These look exactly like, and in fact are, the same exact names as the folder names leading up to where some or another program is located.
In this case, the java compiler.
i have path, and classpath
classpath is not really needed just to get a first run of the compiler to start giving you some information.
Joined: Apr 29, 2007
OK I'VE DONE EVERYTHING YOU'VE SAID... BUT LIKE I DELETED JAVA 5 BECAUSE I UPGRADED TO JAVA 6... AND I EVEN WENT TO CONTROL PANNE/ADD REMOVE FILES AND DELETED ALL JAVA 5 BUT WHEN I GOTO COMMAND PROMT I TYPE IN PATH... AND IT SAYS I STILL GOT JAVA 5!?? AND I LOOK IN ALL MY EVIROMENT VARIABLES.. AND NOTHING IS IN THERE CALLED JAVA 5... WHAT SHOULD I DO?
PLEASE CONTINUE TO HELP!!! I REALLY WANT THIS TO WORK!
Joined: Apr 29, 2007
Also ... my path varaiable when in command promt when i type it is... Path = C:\windows\system32;C:\program files\java\jdk1.6.0_<version>\bin;C:\windows\command;"c:\program files\java\jdk1.5.0_<version>\bin
see.. the thing i dont get is... torwards the end it was the "c:\program files\java\jdk1.5.0_<version>\bin.... why is the " there? i dont even have java 1.5.0 on my computer!!! and when i type in " % javac" in the command line in command promt it says '%' is not reconized as an internal or exteranl command of operable program or batch file...hmmm.... what am i doing wrong?
So there are two problems here. First, you really have "<version>" in the PATH, when you should have replaced that by the actual version number.
And you still have the PATH to JDK 5, which you should remove. The reason it's still there is that the path doesn't get changed if you uninstall a JDK - you have to that manually.
when i type in "% javac" in the command line
I think Nicholas is right thet you're taking instructions a bit too literal. The "%" indicates the command line prompt, which is not part of the command. So once the path is correct, you would type "javac".
What you have set in your PATH variable does not always reflect what is actually installed on your computer. the PATH variable is nothing more than a list of directories for the operating system to look for executable files.
you can delete the producet and the directories, but still have them listed in your PATH. All that happens is the OS says "I need to look here - oh, that doesn't exist, so I'll look in the next place".
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Joined: Oct 13, 2005
Do you really have jdk1.6.0_05 in your PATH? Is that the name of the folder you have got your Java installation in? I thought it only goes as far as 1.6.0_01 to date. Please check carefully that the path of whichever file you have your JDK installation in is spelt correctly in the PATH environment variable.
Joined: Oct 13, 2005
. . . and if java -version returns a sensible number you might have a JRE (Java Runtime Environment) installed elsewhere which you are finding. Unfortunately a JRE isn't much use to you here.
ok i was trying to follow up all your answers but this is how mine is
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\WBEM;C:\Program Files\Panda Software\Panda Antivirus Platinum\;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Common Files\Ulead Systems\MPEG; then i added this C:\j2sdk1.4.0\bin\;.;
is this correct or i should write another path, thanks in advance.
TO PEACE AND PROSPERITY FOR THE WORLD AND THE WORLD TO COME.
Joined: Oct 13, 2005
Welcome to the Ranch.
Are you really still using Java 1.4.0? It was replaced by Java 5 in 2004. If you really have your Java in a folder called C:\j2sdk1.4.0\bin, yes, then that is what you ought to add. If it doesn't work, change C:\j2sdk1.4.0\bin\ to C:\j2sdk1.4.0\bin. More details here; look for no 4. Remember to open a new command prompt window after setting the PATH.
You can remove the .; if you wish. Does your SQL Server really have two Ns in binn?
The .; ought to be in the CLASSPATH environment variable, which can be set in a fashion very similar to the PATH. You may find it already has .; in somewhere; a CLASSPATH is usually set up correctly by default.
Additional: Close your command prompt, reopen it, and type "java -version" and javac -version". If you get a sensible response to both those commands, you probably have your PATH set up correctly. [/edit] [ May 03, 2007: Message edited by: Campbell Ritchie ]
Joined: Sep 17, 2006
Originally posted by Ryan Medrano: ... WHAT SHOULD I DO? ....
That's what you should do. :roll:
I am no stranger to being straightforward (at Javaranch or anyplace else for that matter).
Scrolling down the list of respondents, I notice many heavyweights and can glance at their efforts to help you and tell you are getting top-tier assistance. The problem likely seems intractable, and it sounds like you have got things fouled up ~ impatience is only likely to further compound the damage already done if it does not fix it within one or two rounds.
All caps is generally ignored, unless there are exceptional matters involved; but this is beginner and we all have been there, done that.