using:vscode:installing_java

Installing Java

The extension uses the official TLA<sup>+</sup> tools to support such features as PlusCal-to-TLA+ translation, module parsing, model checking etc. These tools need JVM (Java Virtual Machine) to run, and the extension doesn’t come with a JVM onboard. Thus, it requires a JVM to be installed on the user’s computer.

Attention! At the moment, the TLA+ tools can be used with Java 8, yet it’s strongly recommended to use Java 11 or higher.

The simplest way to check if you already have a JVM installed is to run the following command in the command line:

java --version

If there’s a JVM on your computer, and it’s properly configured, you’ll see the information about its version. Version 1.8 is what we call Java 8 here.

BTW, the extension performs this check for you from time to time and warns you if something goes wrong.

If there’s no JVM on your computer, you can download and install one of the distributions. The most popular among them are:

  • AdoptOpenJDK — the TLA<html></html>+<html></html> Toolbox uses this one.
  • GraalVM — a JVM with a brand-new compiler, works faster in most cases.
  • Amazon Corretto — the JVM distribution from Amazon.

Sometimes, you may not want to use the extension with your globally enabled JVM (the one that is executed when you execute the java command in the command line). In such cases you need to tell the extension where to find the JVM you want to use.

To do this, open the Settings panel, find the TLA+ group of setting, and provide the home directory of your JVM in the Java: Home setting. Be careful, the JVM home directory is the directory where the whole JVM resides, not the full path to the java executable.

  • using/vscode/installing_java.txt
  • Last modified: 2024/10/25 18:58
  • by fponzi