Running ProM Tool on Mac: "Cannot Access Class" Error

Viewed 17

I am trying to install ProM Lite 1.3 on my Mac (M1 chip).

After downloading the files and trying to run the program from terminal, things load for a while and at a certain point, I receive the following error:

Exception in thread "main" java.lang.IllegalAccessError: class org.processmining.framework.util.OsUtil (in unnamed module @0xb1bc7ed) cannot access class sun.management.ManagementFactoryHelper (in module java.management) because module java.management does not export sun.management to unnamed module @0xb1bc7ed

I tried installing Temurin version of java as suggested in another post, but that did not seem to solve the issue.

The current version(s) of java on my machine are:

openjdk version "18.0.2.1" 2022-08-18
OpenJDK Runtime Environment Temurin-18.0.2.1+1 (build 18.0.2.1+1)
OpenJDK 64-Bit Server VM Temurin-18.0.2.1+1 (build 18.0.2.1+1, mixed mode)

I suspect the issue might be related to the version of java I am running, as the proM documentation requires Java 7 or higher (and is not well tested on Java >8). I'm not sure exactly how to run multiple versions of java at the same time though.

  1. Is this issues related to java version? If so, is there some way to tell more easily in the future?
  2. How can I manage multiple java versions at the same time?
1 Answers

After some more searching and problem solving, the issue WAS java version. I found a solution to managing multiple versions of java that I figured I'd share here.

We can install different versions of java through home-brew and then manage them using a tool called jenv. With jenv, you can set the java version being used in the specific shell that is opened so you don't need to worry about changing global settings

All steps were created following instructions on Medium from Chamika Kasun

The code below is what I ran in terminal from the directory where my proM files were extracted. I'm using zsh shell, so this would need to be tweaked for bash.

# Install homebrew. Uncomment below if needed:
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# isntall jenv -> java version manager
brew install jenv

# update shell configuration to set java PATH to be manage by jenv.
# If using bash, use the commented lines below
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(jenv init -)"' >> ~/.zshrc

# echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bashrc
# echo 'eval "$(jenv init -)"' >> ~/.bashrc

# restart terminal for setting changes to take effect
source ~/.zshrc

# verify install worked correcty. Ignore warnings, see a "Jenv is correctly loaded" message
jenv doctor

# these commands are needed if you are using maven
# ensure that JAVA_HOME is correct
jenv enable-plugin export

# now install AdoptOpenJDK8, which works with proM
brew install AdoptOpenJDK/openjdk/adoptopenjdk8

# this will show you all of the versions of java you have installed
/usr/libexec/java_home -V

# now we add the java version you installed with brew in the jenv manager.
# this should work without edits if you are doing everything with defaults.
# otherwise use output from previous comment to update location
jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home

# check to see the versions are now in jenv
jenv versions

# set the version of java in the current SHELL to be adoptopenjdk8
jenv shell 1.8.0.292 

# confirm the current version in your shell
java -version

# now we can run the proM tool to see if it all worked!
sh ProMLite13.sh

# NOTE: You will need to run the code below everytime you want to start proM.
# You can also change the global version of java using: jenv global 1.8.0.292 
# jenv shell 1.8.0.292 
# sh ProMLite13.sh
Related