Mirek Surma
Mirek Surma

Reputation: 148

How to set java path properly on windows 8 machine?

I feel really bad I need to ask here but I've struggled with this issue since morning :) All I need is to set java 6 jdk to path. I set this to path in system environmental props:

C:\Program Files\Java\jdk1.6.0_45\bin;C:\java\maven\apache-maven-3.2.5\bin

and this to JAVA_HOME:

C:\Program Files\Java\jdk1.6.0_45

However, java -version still prints out: java version "1.8.0_25". Thank you for any answer and have a nice rest of day :)

Upvotes: 1

Views: 6893

Answers (1)

Ankur Singhal
Ankur Singhal

Reputation: 26077

Windows 8

    Drag the Mouse pointer to the Right bottom corner of the screen
    Click on the Search icon and type: Control Panel
    Click on -> Control Panel -> System -> Advanced
    Click on Environment Variables, under System Variables, find PATH, and click on it.
    In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
    Close the window.
    Reopen Command prompt window, and run your java code.

refer here

Upvotes: 1

Related Questions