The steps require the modification of system libraries (only in OSX) and system variables. Please proceed with care, it is suggested that you are familiar with this kind of tasks or ask for help. Configuration Overview
Quick Download – Recommended
Quick Download – Alfa Version*
* SupportingFragment-oriented programming
Important Note
If you are running a Windows machine you should use the same architecture type (32 o 64 bits) for the solver and Java. Only one solver version can be installed in a Windows OS.
Prerequisites:
- Java 1.8 (64 bits for SWI-Prolog 64bits, 32 bit for SWI-Prolog 32 bits)
- Solver for VariaMos 1.0.1.18 or newer (recommended)
- SWIProlog 7.6.3 (Win64) http://www.swi-prolog.org/download/stable/bin/swipl-w64-763.exe
- SWIProlog 7.6.3 (Win32) http://www.swi-prolog.org/download/stable/bin/swipl-w32-763.exe
- SWIProlog 7.6.3 (OSX 10.6) http://www.swi-prolog.org/download/stable/bin/SWI-Prolog-7.6.3.dmg
- Solver for VariaMos 1.0.1.17 or older
- SWIProlog 6.6.6 (Win32) http://www.swi-prolog.org/download/stable/bin/w32pl666.exe
- SWIProlog 6.6.6 (Win64) http://www.swi-prolog.org/download/stable/bin/w64pl666.exe
- SWIProlog 6.6.6 (OSX 10.6) http://www.swi-prolog.org/download/stable/bin/SWI-Prolog-6.6.6.dmg
- Ubuntu: the steps to configure jre and swipl are provided at the bottom for VariaMos 1.0.1.18 with SWIProlog 7.2.3.
VariaMos 1.0.1.18+ was tested and support SWIProlog 7.6.3+ (do not support SWIProlog 6.X or older). Also, VariaMos 1.0.1.20 supports SWIProlog 7.2.3 and 7.4.2.
VariaMos 1.0.1.17 and older versions were tested only with SWIProlog 6.6.6.
Configuration of Variables for Windows (32 and 64 bits):
-
- Verify the correct Java (JRE 8+ o JDK 8+) in the path (in a console run: java -version). If you have more than one java installed, look at the final considerations. The 64 bits version is compulsory if you installed the 64 bits solver (by default, the JRE installs the 32 bits version).
- Depending on your SO level of expertise, follow one of these alternatives:
-
- Modify system Variables (Only the first time):
- Configure the following system variables (add to any existing variable):
CLASSPATH=.;C:\Program Files\swipl\lib\jpl.jar;C:\Program Files\swipl\lib; Path=C:\Program Files\swipl\lib\jpl.jar;C:\Program Files\swipl\bin;
- Restart Windows (Only first time)
- Execute VariaMos with double click on the file (.jar).
- Configure the following system variables (add to any existing variable):
- Modify system Variables (Only the first time):
-
- Run VariaMos from a command line with the default Java (Same steps every time):
- Define variables for the command line instance or create a .bat file (including both scripts):
set CLASSPATH=.;C:\Program Files\swipl\lib\jpl.jar;C:\
Program Files\swipl\lib;%CLASSPATH% set Path=C:\Program Files\swipl\lib\jpl.jar;C:\ Program Files\swipl\bin;%Path% - Run VariaMos from the same command line:
java -jar variamos-Last.jar
- Define variables for the command line instance or create a .bat file (including both scripts):
- Run VariaMos from a command line with the default Java (Same steps every time):
-
- Run VariaMos from a command line with a custom Java (Same steps every time):
- Define variables for the command line instance or create a .bat file (including both scripts), please modify the path of the three variables with the java installation path (either jre or jdk are supported):
set CLASSPATH=.;C:\Program Files\swipl\lib\jpl.jar;C:\Program Files\swipl\lib;%CLASSPATH% set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_05 set JRE_HOME=C:\Program Files\Java\jdk1.8.0_05 set Path=C:\Program Files\swipl\lib\jpl.jar;C:\Program Files\swipl\bin;C:\Program Files\Java\jdk1.8.0_05\bin;%Path%
- Run VariaMos from the same command line window:
java -jar variamos-Last.jar
- Define variables for the command line instance or create a .bat file (including both scripts), please modify the path of the three variables with the java installation path (either jre or jdk are supported):
- Run VariaMos from a command line with a custom Java (Same steps every time):
- Verify if the folder exists. If it exists, skip the preconfiguration steps:
ls /usr/local/lib/
- Execute the following steps with a root user (“sudo su” or “su -“):
mkdir /usr/local/
mkdir /usr/local/lib/
export PATH=$PATH:/usr/local/lib/
Configuration of OSX 10.6 – 10.12.1 (MacOS) for VariaMos 1.0.1.18+ with SWI-Prolog 7.6.3 or 7.4.2:
-
- The following libraries must be copied* to the usr local lib (For the first time):
sudo cp /Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin15.6.0/* /usr/local/lib/
* To modify system libraries in newer versions of OSX you may require to restart the system in recovery mode and disable the System Integrity Protection (i.e. run “csrutil disable”).
- To run VariaMos, assuming it was saved on “user”/Downloads/, open a new terminal and paste the following commands (Same steps are required every time you run the tool):
cd cd Downloads/ export SWI_HOME_DIR=/Applications/SWI-Prolog.app/Contents/swipl export PATH=$PATH:$SWI_HOME_DIR/lib/:$SWI_HOME_DIR/lib/jpl.jar export CLASSPATH=$SWI_HOME_DIR/lib/:$SWI_HOME_DIR/lib/jpl.jar java -Djava.library.path=$SWI_HOME_DIR:$SWI_HOME_DIR/lib/x86_64-darwin15.6.0/ -jar variamos-Last.jar
- The following libraries must be copied* to the usr local lib (For the first time):
-
- The following libraries must be copied* to the usr local lib (For the first time):
sudo cp /Applications/SWI-Prolog.app/
Contents/swipl/lib/x86_64- darwin14.3.0/* /usr/local/lib/ * To modify system libraries in newer versions of OSX you may require to restart the system in recovery mode and disable the System Integrity Protection (i.e. run “csrutil disable”).
- To run VariaMos, assuming it was saved on “user”/Downloads/, open a new terminal and paste the following commands (Same steps are required every time you run the tool):
cd cd Downloads/ export SWI_HOME_DIR=/Applications/SWI
-Prolog.app/Contents/swipl export PATH=$PATH:$SWI_HOME_DIR/lib/: $SWI_HOME_DIR/lib/jpl.jar export CLASSPATH=$SWI_HOME_DIR/lib/:$ SWI_HOME_DIR/lib/jpl.jar java -Djava.library.path=$SWI_HOME_ DIR:$SWI_HOME_DIR/lib/x86_64- darwin14.3.0/ -jar variamos-1.0.1.19.jar
- The following libraries must be copied* to the usr local lib (For the first time):
-
- The following libraries must be copied to the usr local lib (For the first time):
sudo cp /Applications/SWI-Prolog.app/
Contents/swipl/lib/x86_64- darwin13.1.0/* /usr/local/lib/ - To run VariaMos, assuming it was saved on “user”/Downloads/, open a new terminal and paste the following commands (Same steps are required every time you run the tool):
cd cd Downloads/ export SWI_HOME_DIR=/Applications/SWI
-Prolog.app/Contents/swipl export PATH=$PATH:$SWI_HOME_DIR/lib/: $SWI_HOME_DIR/lib/jpl.jar export CLASSPATH=$SWI_HOME_DIR/lib/:$ SWI_HOME_DIR/lib/jpl.jar java -Djava.library.path=$SWI_HOME_ DIR:$SWI_HOME_DIR/lib/x86_64- darwin13.1.0/ -jar variamos-1.0.1.17.jar
- The following libraries must be copied to the usr local lib (For the first time):
Linux Debian: Prerequisite installation and variable configuration (tested on Ubuntu 14.04 LTS 01/16 in VariaMos 1.0.1.18+, no longer working with VariaMos 1.0.1.17 or older)
-
- Install java jre:
sudo apt-get update
sudo apt-get install default-jre - Install swi-prolog and swi-prolog-java (Instructions from http://www.swi-prolog.org/build/Debian.html):
sudo apt-add-repository ppa:swi-prolog/stable sudo apt-get update sudo apt-get install swi-prolog sudo apt-get install swi-prolog-java
- Note: to use VariaMos 1.0.1.17 or older with SWI-Prolog 6.6.6 the ppa must be modified manually (https://launchpad.net/~swi-prolog/+archive/ubuntu/stable)
- Execute VariaMos (Follow the same steps every time you run the tool):
cd Downloads/ export SWI_HOME_DIR=/usr/lib/swi-prolog export PATH=$PATH:$SWI_HOME_DIR/lib/:
$SWI_HOME_DIR/lib/jpl.jar java -jar variamos-1.0.1.19.jar
- Install java jre:
Final considerations:
- Starting from 1.0 Beta 3, VariaMos verifies the solver configuration (i.e. compatible solver installed and variables configured) and notifies if an error is found (i.e. it is not possible to execute a solver query). This verification is executed when the application starts.
- If you obtain an error like the following trying to run VariaMos, it is possible you do not have the appropriate java installed (i.e. your java version is too old) or the path is not configured to use the correct java version.
java.lang.UnsupportedClassVersionError: XXXX : Unsupported major.minor version XX.X at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(Unknown Source)
- To use VariaMos with a non-default Java version you can either follow the mentioned steps for Windows or:
- Start VariaMos from the bin folder of the correct Java installation using the full path.
- Modify the path for the current console instance (using set Path=… or export PATH=…). Finally, execute VariaMos from the console.
- Example:
C: cd C:\Program Files\Java\jre8\bin java -jar c:/Users/<<myself>>/Downloads/variamos-1.0.1.19.jar