Change default java installation
        Posted  
        
            by 
                user1501700
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by user1501700
        
        
        
        Published on 2012-07-04T13:25:03Z
        Indexed on 
            2012/07/04
            15:16 UTC
        
        
        Read the original article
        Hit count: 322
        
java
I have many Java versions installed on a Windows 7 machine. Some of them are 32 bits, some are 64 bits. Now as default it starts one of those last versions (1.7 64 bits). How do I tell my Windows 7 machine to use another version of Java? One of the reasons is that I'm developing a JNI project from Microsoft Visual Studio C++ - it uses also java 1.7 64 bits.
Best regards, Andrej
I have set:
User variable: JAVA_HOME=C:\j2sdk1.4.2_04 PATH=%JAVA_HOME%\bin;%PATH%
and system variable: JAVA_HOME=C:\j2sdk1.4.2_04 PATH=...a_lot_of_paths...;%JAVA_HOME%\bin;%PATH%
I had no idea which is better to set - for user or system settings. Done both.
System restart.
And...it didn't helped :( When I run "java -version" from cmd i have java 1.7, but not java 1.4 like defined in PATH.
after run C:>where java I got two results:
C:\Windows\System32\java.exe C:\j2sdk1.4.2_04\bin\java.exe
Who let Java go to my windows directory ???!!!
How to deal with that?
© Stack Overflow or respective owner