Table of Contents

Java 8 installation

fc-21.12.2022

Capsis needs Java 8 (also known as 1.8) to be installed on your machine (Windows, Linux or MacOSX). There are several Java 8 versions available, they are all more or less equivalent, see the various options below and choose one.

Notes:

Installation procedure

Check if Java 8 is already the default version on your machine

There is a simple way to check if Java is installed on your machine and which version, this needs to open a Terminal and type a command in it.

For help with the Terminal, see theses sections in the FAQ for Windows, Linux and MacOSX.

To check which Java is installed to run Capsis, type the following command in your terminal:

java -version

If java is not found or if it is not version 8, see the Java 8 installation section.

If you are a Capsis modellers, to develop in Capsis, you also need a Java compiler, you can check if it is available by typing this command in the terminal:

javac -version

If javac is not found or if it is not version 8, Java 8 installation section.

An example of checking how java and javac are installed under a Linux terminal:

coligny@marvin-13:~$ java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

coligny@marvin-13:~$ javac -version
javac 1.8.0_101

coligny@marvin-13:~$ 

Both commands answer Java 1.8, Java 8 installation is correct, you may leave this page.

Download and install a Java 8 version

There are several possible options to get Java 8 (with or without registration needed), choose one and you will have to select these options:

OpenJDK 8 from Adoptium (also named Eclipse Temurin) (no registration, Windows, Linux and MacOSX available)

IBM Semeru Open Edition JDK 8 from the IBM page (no registration, Windows, Linux and MacOSX available)

Oracle JDK 8 from the Oracle page or from the Oracle java 1.8 download archives (needs registration, Windows, Linux and MacOSX available)

After installation, you must tell your operating system to use this version.

Tell your operating system to use the Java 8 version

Several versions of Java may be installed on your computer, but one only is the default version for your Operating System. There may be several ways to specify this default version is Java 8, here we propose to adapt the PATH environment variable.

The bin/ folder containing java (and javac if you installed a JDK) must be added at the top of the list of folders in the PATH environment variable.

On Windows

  • From the Windows Control Panel, open the System configuration panel (E.g. Click Start > Settings > Control Panel > System)
  • In the System configuration panel, choose Advanced > Environment Variables
  • In the PATH system variable (not in PATH user variable), add the location of the bin/ folder of the installed JDK in first position (you may search this directory in a file manager and copy / paste the path). Example folder: C:\Program Files\Java\jdk1.8.0_261\bin
  • Do not forget bin\ at the end

On Linux

  • The path to the location of the bin/ folder of the installed JDK must be added in first position of the PATH variable. All folder names in the PATH variable must be separated by a ':'.
  • Do not forget bin/ at the end
  • Example of /etc/environment after such an update:

Setting jdk1.8.0_261 as the default Java in /etc/environment

On MacOSX

Note: this procedure for MacOSX must be checked

  • Here, we will adapt the JAVA_HOME system variable instead of the PATH
  • Open a Terminal and check which versions of Java are available
$ cd /usr/libexec

$ ./java_home -V
14.0.1 (x86_64) "Oracle Corporation" - "Java SE 14.0.1" /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home
1.8.202.08 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
  • Change the system default Java version to Java 8 by editing ~/.bash_profile
$ cat ~/.bash_profile
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`

For all systems

To check your new java configuration, open a new Terminal (it will see the configuration changes) and see the first section.