Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JNI error #85

Closed
amerolla opened this issue Aug 15, 2018 · 3 comments
Closed

JNI error #85

amerolla opened this issue Aug 15, 2018 · 3 comments

Comments

@amerolla
Copy link

I tried running:
java -cp aircompressor-0.12-SNAPSHOT-tests.jar io.airlift.compress.benchmark.CompressionBenchmark

Got the following error:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/openjdk/jmh/runner/options/Options
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:522)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:504)
Caused by: java.lang.ClassNotFoundException: org.openjdk.jmh.runner.options.Options
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

@amerolla
Copy link
Author

Is there a dependency I need to add to the pom.xml file?

@martint
Copy link
Member

martint commented Aug 15, 2018

You need to use mvn exec to run run from the CLI so that it adds all the dependencies to the classpath. E.g.:

mvn exec:exec -Dexec.classpathScope=test -Dexec.executable="$JAVA_HOME/bin/java" -Dexec.args="-XX:+UseG1GC -cp %classpath io.airlift.compress.benchmark.CompressionBenchmark -p algorithm=airlift_lz4 -i 20 -wi 20 -f 10"

The options after CompressionBenchmark are standard JMH args, so adjust as necessary to control parameters, warmup/measurement iterations, etc.

@martint martint closed this as completed Aug 15, 2018
@amerolla
Copy link
Author

amerolla commented Aug 15, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants