![]() ![]() The value needed is the value of the property, which is available from inside a java executable if you know what you're doing. You're going to have to either scroll or, on linux-based systems, redirect error output to a file and then grep through that.Īre You, or Do You Know, a Friendly Java Programmer? ![]() Note that java dumps this listing to stderr rather than stdout, so the usual pipe through more will not have the desired effect. ![]() Scroll through the output to find the line (about a dozen lines from the beginning of the listing) containing " ", and use the value part of that line. % java -XshowSettings:properties -version If the answer is 1.7 or later, then this command will dump several dozen lines of property settings to your screen: To see your Java version (Windows or Linux), do: If your Java version is fairly recent, there's a useful command option that lists out a whole bunch of system property settings, including the value of, which is what we need. If you don't have this command handy, you can create one yourself using the code near the bottom of this page, under Sample Perl Script: java_home. Just do this from the command line:Īnd use the result. If so, then the Apple system programmers may have done you a favor and provided a handy little command called " java_home" that returns the value you need. ![]() So if JAVA_HOME isn't already set, your next task is to find the directory to which you need to set it. For linux users, it is almost certainly not the same directory that you get if you do " which java" from the command line, because that would be too easy. The JAVA_HOME environment variable needs to point to the installation directory on your system that contains the bin/ directory where the java executable physically resides, and the lib/ directory which contains the core java libraries and properties files. If the answer is a directory path, you're good to go. To check, on the Windows command line do: Sometimes your JAVA_HOME environment variable will already be set for other reasons. 2.4 Are You Ready to Do It the Hard Way?.2.3 Are You, or Do You Know, a Friendly Java Programmer?. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |