• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

environment variable - correct setup is not working

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much. That's working now.
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 3742
16
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You also need to change the title of this thraed to environment variable - incorrect setup is not working
 
reply
    Bookmark Topic Watch Topic
  • New Topic