我有一个Ubuntu的服务器虚拟机( myapp01
),并有一个Java应用程序部署在那里。 该应用程序一直充当靠不住的,我想用JVisualVM来分析它。 要做到这一点,我需要我的Windows 7主机上安装X-Windows,然后得到了Ubuntu VM出口其X11连接到我的主机,当我告诉它在虚拟机上运行JVisualVM。
于是我开始点击这里下载Xming的:
http://sourceforge.net/projects/xming/files/Xming/6.9.0.31/Xming-6-9-0-31-setup.exe/download
我使用的所有默认/推荐的安装选项,包括使用普通PuTTY会话,并允许公共和专用网络接入。 安装的Xming后,我发起并证实这是在我的Windows主机上运行。 然后我打开了Cygwin和SSHed到Ubuntu的服务器:
$ ssh myuser@myapp01
myuser@myapp01's password:
Welcome to Ubuntu 12.04.4 LTS (GNU/Linux 3.5.0-23-generic x86_64)
* Documentation: https://help.ubuntu.com/
System information as of Tue Jun 10 21:26:15 EDT 2014
System load: 0.0 Processes: 82
Usage of /: 22.5% of 11.81GB Users logged in: 0
Memory usage: 30% IP address for eth0: 10.10.41.108
Swap usage: 0%
Graph this data and manage this system at:
https://landscape.canonical.com/
38 packages can be updated.
30 updates are security updates.
Last login: Tue Jun 10 15:03:35 2014 from 10.10.101.96
我则显示输出到这似乎是我的主机的IP:
myuser@myapp01:~$ export DISPLAY=10.10.101.96
然后我尝试运行JVisualVM:
myuser@myapp01:~$ cd $JAVA_HOME
myuser@myapp01:/usr/lib/jvm/java-7-oracle-amd64$ ls
bin COPYRIGHT db include jre lib LICENSE man README.html release src.zip THIRDPARTYLICENSEREADME-JAVAFX.txt THIRDPARTYLICENSEREADME.txt
myuser@myapp01:/usr/lib/jvm/java-7-oracle-amd64$ cd bin/
myuser@myapp01:/usr/lib/jvm/java-7-oracle-amd64/bin$ ./jvisualvm
Error: Can't connect to X11 window server using '10.10.101.96' as the value of the DISPLAY variable.
See the /home/myuser/.visualvm/7u14/var/log/messages.log for details.
myuser@myapp01:/usr/lib/jvm/java-7-oracle-amd64/bin$ vim /home/myuser/.visualvm/7u14/var/log/messages.log
内部/home/myuser/.visualvm/7u14/var/log/messages.log
:
java.lang.InternalError: Can't connect to X11 window server using '10.10.101.96' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:110)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:102)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:81)
at org.netbeans.core.startup.Main.start(Main.java:200)
at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:84)
at java.lang.Thread.run(Thread.java:745)
想法? 我VPNed中,这可能会影响什么? 难道我的Xming不知何故错误地配置? 是我export DISPLAY
命令错了吗?