如何在Windows 8机器上正确设置java路径?

时间:2015-01-20 08:22:19

标签: java windows-8 path

我感觉非常糟糕,我需要在这里问一下,但我从早上起就遇到了这个问题:) 我只需要将java 6 jdk设置为path。我将此设置为系统环境道具中的路径:

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

和JAVA_HOME:

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

然而,java -version仍打印出:java版“1.8.0_25”。 谢谢你的任何答复,并在一天中休息一下:)

1 个答案:

答案 0 :(得分:1)

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.

参考here