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

Report missing tools.jar in build and run script instead of failing with NoClassDefFoundError #37

Open
veastark opened this issue Jun 26, 2016 · 3 comments

Comments

@veastark
Copy link

Hello,

After succesfully creating flamegraphs a few days ago I tried it again today and only get this error:

Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools/attach/AgentInitializationException 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:544) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526) Caused by: java.lang.ClassNotFoundException: com.sun.tools.attach.AgentInitializationException at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 7 more

I haven't changed anything on the machine. Is there a solution to this or a way to get more error information?

@jrudolph
Copy link
Member

Hi @veastark, sorry for not answering any sooner. Is this still a problem? It looks like tools.jar is missing from the classpath which can happen if you run with a JRE or with unusual paths.

@SerCeMan
Copy link

SerCeMan commented Nov 11, 2016

@veastark try to check that your JAVA_HOME (or /usr/lib/jvm/default_java folder) points to a right folder

@jrudolph
Copy link
Member

Let's keep this ticket as a request to enhance the script to check whether the tools.jar exists at the expected location and otherwise fail with a better error message.

@jrudolph jrudolph changed the title NoClassDefFoundError Report missing tools.jar in build and run script instead of failing with NoClassDefFoundError Dec 17, 2016
iori-yja added a commit to iori-yja/perf-map-agent that referenced this issue Jun 14, 2018
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

3 participants