Changing Java Version for a Specific Program

前端 未结 3 1206
挽巷
挽巷 2021-01-24 23:25

If I have more than one version of Java installed can I specify the version I want to kick a program off with via batch file, or do I have to change my environment variable? If

3条回答
  •  青春惊慌失措
    2021-01-25 00:07

    You batch file is ok.

    You can use SET command on a terminal to set your JAVA_HOME and also add it to your path variable and that's enough to run an app with the jdk you want.

    Remember that if you set it through terminal the variable will work on that terminal and last during that terminal is open.

    If you want to cover the scope for you SO you need to set in windows variables:

    enter image description here

    For linux you need to use export command the variables

提交回复
热议问题