peer
peer

Reputation: 4679

-Djava.ext.dirs=[...]/Sdk/tools/lib:[...]/Sdk/tools/lib/x86_64 is not supported when starting monkeyrunner on linux

I want to run monkeyrunner but if I run mypath/Sdk/tools/bin/monkeyrunner I get:

-Djava.ext.dirs=mypath/Sdk/tools/lib:/mypath/Sdk/tools/lib/x86_64 is not supported.  Use -classpath instead.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

I found some questions like this but for MacOS and Windows but none for linux.

Upvotes: 0

Views: 609

Answers (1)

peer
peer

Reputation: 4679

Other questions suggest to install java 8. For me java -version showed that I was using corretto 11, so I installed corretto 8 as well (via .deb).

With find . -name '*corretto*' 2>/dev/null I found the executables as ./usr/lib/jvm/java-*-amazon-corretto/jre/bin/java. After setting

export JAVA_HOME='/usr/lib/jvm/java-1.8.0-amazon-corretto/jre'
export PATH=$JAVA_HOME/bin:$PATH

java -version shows corretto 11 and monkeyrunner can start up.

To fix the script I add those two lines before the call to java in the last line:

export JAVA_HOME='/usr/lib/jvm/java-1.8.0-amazon-corretto/jre'
export PATH=$JAVA_HOME/bin:$PATH
exec java -Xmx128M $os_opts $java_debug -Djava.ext.dirs="$frameworkdir:$swtpath" -Djava.library.path="$libdir" -Dcom.android.monkeyrunner.bindir="$progdir" -jar "$jarpath" "$@"

Upvotes: 0

Related Questions