• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

environment variable - correct setup is not working

 
Andrew Baba
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have changed Java environment variables good few times recently and I have never had problem like today. I have set up new Win 7 Proffesional 64-bit. I have installed JDK and I am stuck with variables.
Please have a look on pics. I also checked official oracle documentation for win7 and looks like I am doing everything OK.

1. Pic1 displays path on my hdd to my JDK


c:\program files\java\jdk1.7.0_03


2. Pic2 displays what I am going to edit


3. As a result still getting the same answer that javac is not recognised as an internal or external command.

Any ideas what am I doing wrong ?

I also tried to change name path using " ~ "sign to avoid empty spaces like C:\progra~1\... but this is not working either.
I tried close terminal, restart win, after each step.
I tried to change path to c:\program files\java\jdk1.7.0_03\bin

Is there any way to set this up through command line ?
 
Brian Burress
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You circle "JAVA_HOME" but then indicated you set the path. "JAVA_HOME" is frequently used by scripts, but does not work for a command line window. You want to make sure you are setting the "PATH" (path) environment variable to include the java bin directory. Take care not to delete or modify any of the current entries in the path variable or you may break something.

As a side comment, you do want to re-open the command line window when changing the path but you should not need to perform a restart of the entire system.
 
Andrew Baba
Greenhorn
Posts: 20
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much. That's working now.
 
Rob Spoor
Sheriff
Pie
Posts: 20661
65
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JAVA_HOME should not include the bin folder. That should be part of the PATH, but not JAVA_HOME. My own PATH includes %JAVA_HOME%\bin so I only need to change JAVA_HOME and the PATH will be automatically updated as well.
 
Brian Burress
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob,

Good suggestion on the %JAVA_HOME% use in the path. Also, thanks for pointing out that JAVA_HOME should not have the bin dir. I focused on answering the question and overlooked that aspect!
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15482
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, the value of JAVA_HOME should not have a semi-colon ; at the end. Just the name of the directory: C:\Program Files\Java\jdk1.7.0_03
 
Joanne Neal
Rancher
Posts: 3742
16
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You also need to change the title of this thraed to environment variable - incorrect setup is not working
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic