Setting the path variable for Java
I had installed
on a Windows 10 system as part of the installation of the
integrated development environment (IDE), which did not add the
directory where the java.exe and javac.exe executable files were installed.
I could temporarily add the directory where Eclipse installed those files
to the path
Running java from an Eclipse installation from the command line
I didn't want to continue to have to do that every time I wanted to compile
a Java program at a command prompt or run one from
. So I added the path to the executable files to the
system-wide path environment variable so it would be permanent and apply
to all accounts on the system.
[ More Info ]
Setting JAVA_HOME for Gradle
While trying to set up
Gradle, a software develpment build automation tool, on a Microsoft Windows
10 system, when I ran the gradle.bat file in the gradle bin directory, I saw
the message below:
ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
I had installed Java with the
integrated development environment (IDE) previously and the java.exe
executable was installed beneath the
directory, so I created a JAVA_HOME
variable pointing to that directory that applied to all accounts on the
system. You can create a temporary JAVA_HOME environment variable for the
account under which you are currently logged in from a
interface (CLI) as noted at
Running java from an Eclipse
installation from the command line, but I wanted to create a permanent
environment variable so I typed
advanced system settings in
the Windows "Type here to search" field and then clicked on View
advanced system settings when I saw that listed.
[ More Info ]