• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Environment variables

 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

I have both the java 6 and java 7 sdk and jre on my machine, which is Windows 7 ultimate(64bit). I am trying to get to run a web project that was based on java 6. As I was about to set the environment variables, I noticed that there already is a 'PATH' variable whose value is C:\Program Files(x86)\Java\jre7\bin. I was about to change this to point to jre6, when I realised that java is actually installed in the 'Program Files' and not the 'Program Files(x86)'. Why then does the value point to Program Files(x86)folder? Hope someone can help explain. Thanks.
 
Marshal
Posts: 80644
472
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Answer: don't know. That PATH entry was most probably installed by the Operating System and you would do well not to change it.

Why are you using Java6 whose support was terminated some time ago? You can alter the PATH for the lifetime of a terminal window with
set PATH="C:\Program Files\Java\jdk1.6.0_55\bin";%PATH% (Windows®)
export PATH=/home/java/jdk1.6.0_55/bin:$PATH (Unix/Linux)

That is probably the simplest way to change the version of Java®. But why do you need to change a version in the first place? A Java6 app will work happily on a Java8 runtime.
 
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
If you have 64-bit windows, then "C:\Program Files" is for 64-bit programs, and "C:\Program Files (x86)" is for 32-bit programs.

64-bit JDK versions will install themselves by default into "C:\Program Files", and 32-bit versions into "C:\Program Files (x86)".

You've probably had both 64-bit and 32-bit versions installed on your computer in the past.
 
reply
    Bookmark Topic Watch Topic
  • New Topic