Eclipse Java Version Incompatible with Polyspace Plug-in

Issue

After installing the Polyspace® plug-in for Eclipse™, when you open the Eclipse or Eclipse-based IDE, you see this error message:

Java 7 required, but the current java version is 1.6. 
You must install Java 7 before using Polyspace plug in.

You see this message even if you install Java® 7 or higher.

Cause

Despite installing Java 7 or higher, the Eclipse or Eclipse-based IDE still uses an older version.

Solution

Make sure that the Eclipse or Eclipse-based IDE uses the compatible Java version.

  1. Open the executable_name.ini file that occurs in the root of your Eclipse installation folder.

    If you are running Eclipse, the file is eclipse.ini.

  2. In the file, just before the line -vmargs, enter:

    -vm
    java_install\bin\javaw.exe
    Here, java_install is the Java installation folder.

    For instance, your product installation comes with the required Java version for certain platforms. You can force the Eclipse or Eclipse-based IDE to use this version. In your .ini file, enter the following just before the line -vmargs:

    -vm 
    polyspaceroot\sys\java\jre\arch\jre\bin\javaw.exe
    Here, polyspaceroot is your product installation folder, for instance, C:\Program Files\Polyspace\R2019a\ and arch is win32 or win64 depending on the product platform. Note that -vm and the path to javaw.exe must be on separate lines.