Enjoy life!
Ziyang Zhang wrote:...I found if I set JAVA_HOME as “User Parameter” and set path as “System Parameter” (I use JAVA_HOME when setting path). This will not work, which means % JAVA_HOME % in path could not be interpreted. WHY? If I set both JAVA_HOME and path as “System Parameter”, it works...
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
marc weber wrote:
Ziyang Zhang wrote:...I found if I set JAVA_HOME as “User Parameter” and set path as “System Parameter” (I use JAVA_HOME when setting path). This will not work, which means % JAVA_HOME % in path could not be interpreted. WHY? If I set both JAVA_HOME and path as “System Parameter”, it works...
As Tom pointed out, a system parameter is always available, regardless of what user account is logged in. In contrast, a user parameter is only available if that particular account is being used.
With that in mind, if PATH is updated as a sytem parameter (available to all accounts) but it includes JAVA_HOME, which is defined as a user parameter (only available to one account)... Do you see the problem?
Enjoy life!
Tom Reilly wrote:I assume you are referring to the Windows OS. User Parameter is used for the current user only. System Parameter is used for all users, which means it works for those applications that are run as system services. I always use System Parameter and never have to worry about the things you are worrying about.
Enjoy life!
Ziyang Zhang wrote:
Tom Reilly wrote:I assume you are referring to the Windows OS. User Parameter is used for the current user only. System Parameter is used for all users, which means it works for those applications that are run as system services. I always use System Parameter and never have to worry about the things you are worrying about.
Thanks a lot!!! Do you have any idea why java -version works all the time no matter if I install jdk or not?
SCJP 1.6(91%), SCWCD 1.5(100%), SCBCD in progress
Gaurav Sagar wrote:
Ziyang Zhang wrote:
Tom Reilly wrote:I assume you are referring to the Windows OS. User Parameter is used for the current user only. System Parameter is used for all users, which means it works for those applications that are run as system services. I always use System Parameter and never have to worry about the things you are worrying about.
Thanks a lot!!! Do you have any idea why java -version works all the time no matter if I install jdk or not?
java -version works because that is an executable always present in the jre (Java Run time Environment) which is shipped to you when you buy your windows OS. When you install the JDK then JRE is also installed(if you don't have a JRE or your JRE previously installed is of an older version).
So, to check the proper installation of your JDK i.e. after you have set the path, then simply enter the javac -version onto your command prompt. This would tell you the version of javac installed onto your system. It's far better to use then getting confused by the java -version(Highly Recommended).
Enjoy life!
Space seems cool in the movies, but once you get out there, it is super boring. Now for a fascinating tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|