my dog learned polymorphism*
The moose likes Beginning Java and the fly likes I need help putting the /bin of my java directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "I need help putting the /bin of my java directory" Watch "I need help putting the /bin of my java directory" New topic
Author

I need help putting the /bin of my java directory

Ryan Medrano
Greenhorn

Joined: Apr 29, 2007
Posts: 11
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 ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41182
    
  45
Welcome to JavaRanch.

Which operating system are you using? If it's Windows, see here.

The Hello World section of the Sun Java Tutorial should help you get going. Actually, the complete tutorial (which you can download here) is a very good resource to go through.


Ping & DNS - my free Android networking tools app
Ryan Medrano
Greenhorn

Joined: Apr 29, 2007
Posts: 11
naw!!! ive tried that!!! for some reason it still doesn't find the C:\Program Files\Java\jdk1.6.0_<version>\bin path.... how many paths should i have? i have path, and classpath... please help me!!!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41182
    
  45
What is the value of your PATH variable? After changing it, did you log out? Sometimes that's required for changes in system variables to become effective; not sure if that would apply here.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38107
    
  22
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 ]
Nicholas Jordan
Ranch Hand

Joined: Sep 17, 2006
Posts: 1282
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.
Ryan Medrano
Greenhorn

Joined: Apr 29, 2007
Posts: 11
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!
Ryan Medrano
Greenhorn

Joined: Apr 29, 2007
Posts: 11
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?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41182
    
  45
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

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".
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
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


... and it should be something like
C:\windows\system32;C:\program files\java\jdk1.6.0_05\bin;C:\windows\command

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.

On Unix/Linux operating systems, the "DOS" prompt looks like '%' rather than like 'C:\>'. You want to type only 'javac' (without the quote marks)


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Hope you're getting things sorted out. See if this helps at this point.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11175
    
  16

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
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38107
    
  22
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.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38107
    
  22
. . . 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.
EDIN BASHIR
Greenhorn

Joined: May 02, 2007
Posts: 2
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.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38107
    
  22
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.

[edit]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 ]
Nicholas Jordan
Ranch Hand

Joined: Sep 17, 2006
Posts: 1282
Originally posted by Ryan Medrano:
... WHAT SHOULD I DO? ....


Quit hollering.  

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: I need help putting the /bin of my java directory
 
Similar Threads
jdk1.3.0_02 PATH????????????
Setting up JAVA
Something is wrong with my Java on LInux...
java -version
classpath problem