我在使用Mac上的VisualVM时遇到了一些麻烦。
每当我运行visualvm应用程序时(从安装的应用程序或通过转到/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/jvisualvm(unix可执行文件),它会打开终端,有一会儿,visualvm也会启动,然后在终端打印以下内容并且visualvm关闭
上次登录:12月7日星期二22:15:06 ttys000 Kingshuks-MacBook-Pro:~kingshuk $ /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/jvisualvm;出口; 登出 保存会话...... ...复制共享历史... ...保存历史...截断历史文件... ...完成。
[Process completed]
I have recently upgraded from Sierra to High Sierra. I think I have used visualvm before this upgrade, might be once or twice though.
Any help to resolve this issue would be great..!! Please let me know if any additional information is needed.
I tried to use
/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/jvisualvm -J-Dnetbeans.logger.console=true but got the following error. Guess this is because I don't have netbeans installed??
Last login: Sat Dec 9 16:21:57 on console
Kingshuks-MacBook-Pro:~ kingshuk$ /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/jvisualvm -J-Dnetbeans.logger.console=true
-bash: /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/jvisualvm: No such file or directory
Kingshuks-MacBook-Pro:~ kingshuk$ /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/jvisualvm -J-Dnetbeans.logger.console=true
-------------------------------------------------------------------------------
>Log Session: Saturday, December 9, 2017 4:41:03 PM EST
>System Info:
Product Version = Java VisualVM
Operating System = Mac OS X version 10.13.1 running on x86_64
Java; VM; Vendor = 1.8.0_152; Java HotSpot(TM) 64-Bit Server VM 25.152-b16; Oracle Corporation
Runtime = Java(TM) SE Runtime Environment 1.8.0_152-b16
Java Home = /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre
System Locale; Encoding = en_US (visualvm); UTF-8
Home Directory = /Users/kingshuk
Current Directory = /Users/kingshuk
User Directory = /Users/kingshuk/Library/Application Support/VisualVM/8u131
Cache Directory = /Users/kingshuk/Library/Caches/VisualVM/8u131
Installation = /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/visualvm
/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/profiler
/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform
Boot & Ext. Classpath = /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/classes:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/System/Library/Java/Extensions/MRJToolkit.jar
Application Classpath = /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/boot.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/org-openide-modules.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/org-openide-util-lookup.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/org-openide-util.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/locale/boot_ja.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/locale/boot_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/locale/org-openide-modules_ja.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/locale/org-openide-modules_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/locale/org-openide-util-lookup_ja.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/locale/org-openide-util-lookup_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/locale/org-openide-util_ja.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/locale/org-openide-util_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/tools.jar
Startup Classpath = /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/core/org-openide-filesystems.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/core/core.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/core/locale/core_ja.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/core/locale/org-openide-filesystems_ja.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/core/locale/org-openide-filesystems_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/core/locale/core_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/visualvm/core/com-sun-tools-visualvm-modules-startup.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/visualvm/core/locale/com-sun-tools-visualvm-modules-startup_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/visualvm/core/locale/core_visualvm.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/visualvm/core/locale/com-sun-tools-visu
alvm-modules-startup_ja.jar
-------------------------------------------------------------------------------
java.lang.NullPointerException
at java.awt.Window.init(Window.java:497)
at java.awt.Window.<init>(Window.java:537)
at java.awt.Frame.<init>(Frame.java:420)
at org.netbeans.core.startup.Splash.setRunning(Splash.java:119)
at org.netbeans.core.startup.Main.start(Main.java:257)
at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:84)
at java.lang.Thread.run(Thread.java:748)
Kingshuks-MacBook-Pro:~ kingshuk$
我还能注意到visualvm脚本调用了nbexec文件。当我尝试独立运行时,我在控制台上收到了以下错误。
Last login: Wed Dec 20 17:56:02 on ttys000
Kingshuks-MacBook-Pro:~ kingshuk$ /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/nbexec ; exit;
java.io.FileNotFoundException: /var/cache/lastModified/all-checksum.txt (No such file or directory)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
at org.netbeans.Stamps.compareAndUpdateFile(Stamps.java:444)
at org.netbeans.Stamps.stamp(Stamps.java:331)
at org.netbeans.Stamps.moduleJARs(Stamps.java:282)
at org.netbeans.Stamps.file(Stamps.java:168)
at org.netbeans.Stamps.asByteBuffer(Stamps.java:173)
at org.netbeans.Stamps.asStream(Stamps.java:129)
at org.netbeans.Stamps.checkPopulateCache(Stamps.java:540)
at org.netbeans.Stamps.file(Stamps.java:160)
at org.netbeans.Stamps.asByteBuffer(Stamps.java:173)
at org.netbeans.Stamps.asByteBuffer(Stamps.java:153)
at org.netbeans.Archive.<init>(Archive.java:81)
at org.netbeans.JarClassLoader.initializeCache(JarClassLoader.java:68)
at org.netbeans.MainImpl$BootClassLoader.run(MainImpl.java:298)
at org.netbeans.CLIHandler.initialize(CLIHandler.java:559)
at org.netbeans.CLIHandler.initialize(CLIHandler.java:345)
at org.netbeans.MainImpl.execute(MainImpl.java:154)
at org.netbeans.MainImpl.main(MainImpl.java:46)
at org.netbeans.Main.main(Main.java:44)
谢谢.. !!