2.4.5 Set System Environment Variables
In order to ease the installation process we recommend you set the following environment variables. The commands given throughout the document are based on the following environment variables defined on your machine.
Environment Variables
JAVA_HOME=the location of your Java JDK directory
JBOSS_HOME=the location of your Wildfly directory
ANT_HOME=the location of your Ant directory
PATH=add the path for your Java's bin folder and Ant bin folder.
export Your Java, Wildfly and Ant Home Directories
Note |
Changes to the system PATH variable are not necessary for servers running Windows. JAVA_HOME, JBOSS_HOME and ANT_HOME still need to be set. Also the need to export the new variables is only required on Linux machines; it is not applicable to Windows. |
Example Settings for Linux Machine
Environment Variables
JAVA_HOME=/usr/java/default
JBOSS_HOME=/opt/wildfly-17.0.1.final
ANT_HOME=/opt/apache-ant-1.9.6
PATH=$PATH:$ANT_HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export JBOSS_HOME
export ANT_HOME
Please proceed to the section called Set Variables on Linux Machine if you are unfamiliar with how to set the above system variables on your Linux server.
Example Settings for Windows Server
Environment Variables
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121
JBOSS_HOME=c:\opt\wildfly-17.0.1.final
ANT_HOME=c:\opt\apache-ant-1.9.6
PATH=%PATH:%ANT_HOME\bin:%JAVA_HOME\bin
Please proceed to the section called Set Variables on Windows Machine if you are unfamiliar with how to set the above system variables on your Windows server.
2.4.5.1 Set System Variables on a Linux Machine
The following steps will walk you through adding System Environment Variables to a machine running Linux.
- Open the terminal (shell) on your server.
- Enter the following command(s) to define and export your JAVA_HOME variable.
Set Variables Command
JAVA_HOME=/opt/java/jdk1.6.0
export JAVA_HOME
Warning |
|
- Enter the following command(s) to define and export your JBOSS_HOME variable.
Set Variables Command
JBOSS_HOME=/opt/jboss-as-7.1.1.Final
export JBOSS_HOME
- Enter the following command(s) to define and export your ANT_HOME
Set Variables Command
ANT_HOME=/opt/apache-ant-1.8.2
export ANT_HOME
- Enter the following to update your PATH variable
Set Variables Command
PATH=$PATH:$ANT_HOME/bin:$JAVA_HOME/bin
Note |
You do not need to export PATH because it has already been exported. If for some reason your PATH has never been exported then you will need to do it now. Simply adding variables to the PATH does not require you to export it again. |
2.5.4.2 Set System Variables on a Windows Machine
The following steps will walk you through adding System Environment Variables to a machine running Windows.
- Click on Start button located on your windows taskbar. The start menu will open.
- Right click on My Computer to display a popup menu.
- Select Properties. The Systems window will open displaying basic information about your computer.
- Click on the Advanced System Settings link located on the left hand side of the window.
- The Systems Properties window will open to the Advanced tab
- Click on the Environment Variables button to open the Environment Variables window.
- Click on the New button to open the New System Variable window.
- Enter the following for your JAVA_HOME variable
Variable Name: JAVA_HOME
Variable value: C:\Program Files\Java\jdk1.7.0_40
Warning |
|
- Click on the OK button to save the new entry and return to the Environment Variables window.
- Click on the New button to add your JBOSS_HOME variable.
Variable Name: JBOSS_HOME
Variable value: C:\opt\jboss-as-7.1.1.Final
- Click on the OK button to save the new entry and return to the Environment Variables window.
- Click on the New button to add your ANT_HOME variable.
Variable Name: ANT_HOME
Variable value: C:\opt\apache-ant-1.8.2
- Click on the OK button to save the new entry and return to the Environment Variables window.
- All of the variables you just entered should appear in the list of System Variables.
- Close the Environment Variables window, the System Properties window, and the Systems window.
Comments
0 comments
Please sign in to leave a comment.