Setting the Runtime Java Environment
The version of Java used to compile REEF is controlled in the Maven pom.xml file in the build plugins section under the maven-compiler-plugin artifact identifier. In order to run REEF applications, you must set the JAVA_HOME environment variable to the correct Java installation directory for your operating system and java version.
...
On a number of Linux distributions such as Ubuntu, the current active version of Java is controlled via links from /usr/bin set by the update-alternatives command; thus, the value of JAVA_HOME that causes REEF to use the Java version controlled by update-alternatives is given in the code block below. REEF will concatenate the appropriate path to find executable files.
Code Block |
---|
language | bash |
---|
title | bash script to set JAVA_HOME |
---|
|
...
...
You can change the active version of Java controlled by update-alternatives by entering the command below and selecting the desired version from the displayed list.
Code Block |
---|
language | bash |
---|
title | bash script to list all installed Java versions on Linux |
---|
|
update-alternatives --config java |
Test Environment Configuration
The REEF unit tests require a large number of simultaneously open files to successfully complete. This may or may not be allowed by your platform administrator.
Ubuntu
The default number of open files in an Ubuntu shell is 1024. You can verify this by typing the following command at the shell prompt.
Code Block |
---|
language | bash |
---|
firstline | 1 |
---|
title | Check the number of open files allowed for your current user |
---|
|
myuser@build> ulimit -n
1024 |
If you have sudo privileges, you can temporarily increase the number of open files by starting a shell as root, increasing the limit, and then starting a new shell with your login name.
Code Block |
---|
language | bash |
---|
title | Temporarily increase the number of open files |
---|
|
sudo bash
ulimit -n 128000
sudo -u myuser bash
mvn clean install |
A more permanent fix requires changing values in system files. If the following lines exist in the /etc/security/limits.conf file, update them to a size of at least 40960. If these line do not exist, add them to the end of the file.
Code Block |
---|
language | bash |
---|
title | Modify limits.conf to permanently increase the number of allowed open files for all users and root |
---|
|
* soft nofile 128000
* hard nofile 128000
root soft nofile 128000
root hard nofile 128000 |
If the following line does not exist in the /etc/pam.d/common-session file, add it.
Code Block |
---|
language | bash |
---|
title | Modify pam.d to permanently increase the number of allowed open files |
---|
|
session required pam_limits.so |
Reboot your machine.
Now type "ulimit -n" at the shell prompt and you should get return a value of 40960 which should be sufficient to run the REEF unit tests.
Compiling
Java build instructions
C# build instructions