We'll explain here how to set up JAVA_HOME
and PATH
variables on Windows.
- Open
Search
and type "advanced system settings" and hitEnter
. - Find the
Advanced
tab and click on theEnvironment Variables
. - In the
System variables
section click onNew
if you want to setJAVA_HOME
system wide. To setJAVA_HOME
for a single user click onNew
underUser variables
. - In the opened modal window for
Variable name
typeJAVA_HOME
and for theVariable value
set the path to the JDK installation. Click OK once you're done. - Click OK and click Apply to apply the changes.
If you have downloaded and installed the SDK using our Windows installer your PATH
variable is already set up.
Open a terminal and run the following commands. Typos are a big problem here so copy/paste one line at a time if possible. None of these should produce any output on success:
echo 'export JAVA_HOME="$(/usr/libexec/java_home)"' >> ~/.zprofile
echo 'export JAVA_HOME="$(/usr/libexec/java_home)"' >> ~/.bash_profile
echo 'export PATH="$HOME/.daml/bin:$PATH"' >> ~/.zprofile
echo 'export PATH="$HOME/.daml/bin:$PATH"' >> ~/.bash_profile
This will update the configuration for future, newly opened terminals, but will not affect any exsting one. To test the configuration of JAVA_HOME
, open a new terminal and run:
echo $JAVA_HOME
You should see the path to the JDK installation, which is something like /Library/Java/JavaVirtualMachines/jdk_version_number/Contents/Home
.
Next, please verify the PATH
variable by running:
daml version
You should see a the header SDK versions:
followed by a list of installed (or available) SDK versions (possibly a list of just one if you just installed).
If you do not see the expected outputs, please contact us on the Daml forum and we will be happy to help.
We'll explain here how to set up JAVA_HOME
and PATH
variables on Linux for bash
.
Java should be installed typically in a folder like /usr/lib/jvm/java-version
. Before running the following command make sure to change the java-version
with the actual folder found on your computer:
echo "export JAVA_HOME=/usr/lib/jvm/java-version" >> ~/.bash_profile
The installer will ask you and set the PATH
variable for you. If you want to set the PATH
variable manually instead, run the following command:
echo 'export PATH="$HOME/.daml/bin:$PATH"' >> ~/.bash_profile
In order for the changes to take effect you will need to restart your computer. After the restart, please follow the instructions below to verify that everything was set up correctly.
Please verify the JAVA_HOME variable by running:
echo $JAVA_HOME
You should see the path you gave for the JDK installation, which is something like /usr/lib/jvm/java-version
.
Next, please verify the PATH variable by running:
echo $PATH
You should see a series of paths which includes the path to the SDK, which is something like /home/your_username/.daml/bin
.