Running a java profiler -
i trying run java based java profiler find out uses resources on java application on dedicated machine. profiler trying use called warmroast.
i following error running.
java -jar warmroast.jar exception in thread "main" java.lang.noclassdeffounderror: com/sun/tools/attach/attachnotsupportedexception @ java.lang.class.getdeclaredmethods0(native method) @ java.lang.class.privategetdeclaredmethods(unknown source) @ java.lang.class.getmethod0(unknown source) @ java.lang.class.getmethod(unknown source) @ sun.launcher.launcherhelper.validatemainclass(unknown source) @ sun.launcher.launcherhelper.checkandloadmain(unknown source) caused by: java.lang.classnotfoundexception: com.sun.tools.attach.attachnotsupportedexception @ java.net.urlclassloader$1.run(unknown source) @ java.net.urlclassloader$1.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ sun.misc.launcher$appclassloader.loadclass(unknown source) @ java.lang.classloader.loadclass(unknown source) ... 6 more
i think error caused running file jre instead of jdk.
i have installed java-1.7.0-openjdk-1.7.0.55-2.4.7.1.el6_5.x86 yum package.
[root@ ~]# java -version java version "1.7.0_55" openjdk runtime environment (rhel-2.4.7.1.el6_5-x86_64 u55-b13) openjdk 64-bit server vm (build 24.51-b03, mixed mode)
i think fix problem, need run jar file using jdk. there kind of jdk path jdk bin file? if so, in centos? i've googled while , came dozens of wrong paths. feel stupid because think jre part of jdk , jdk using compiling stuff , don't think can run files jdk... ... ...
the class not found in tools.jar
in jdk. library not automatically on class path, if use jdk instead of jre.
according documentation, on linux warmroast should started follows (replace path_to_jdk
path jdk):
java -djava.library.path=path_to_jdk/jre/bin -cp path_to_jdk/lib/tools.jar:warmroast-1.0.0-snapshot.jar com.sk89q.warmroast.warmroast --thread "server thread"
here, tools.jar
manually added classpath.
Comments
Post a Comment