LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1472|回复: 6

如何在浏览器之外运行 VNC Viewer Java Applet ?(已解决)

[复制链接]
发表于 2010-11-1 15:35:20 | 显示全部楼层 |阅读模式
  虽然在 Firefox 里可以通过 Java 插件运行 VNC Viewer, 但我突然想:为何一定要在浏览器里运行?在外部直接运行是否可行?我试着这么做。

  VNC Server 的地址为 192.168.200.129, 通过 http://192.168.200.129:5800 访问其 HTML 页面,得到如下的脚本。

<HTML>
  <HEAD><TITLE>TightVNC desktop [winxppro]</TITLE></HEAD>
  <BODY>
    <APPLET ARCHIVE="VncViewer.jar" CODE=VncViewer WIDTH=1 HEIGHT=1>
      <ARAM NAME="ORT" VALUE="5900">
      <ARAM NAME="Open new window" VALUE="YES">

    </APPLET><BR>
    <A HREF="http://www.tightvnc.com/">www.TightVNC.com</A>
  </BODY>
</HTML>


  再通过 http://192.168.200.129:5800/VncViewer.jar 将 Java Applet 下载下来。然后再用 java -jar VncViewer.jar 试图运行它,报错 :"HOST parameter not specified". 根据这一信息,加上一些参数,比如 java -jar VncViewer.jar 192.168.200.129 5800 或者  java -jar VncViewer.jar 192.168.200.129 5900 或者 java -jar VncViewer.jar HOST=192.168.200.129 等等,都没有效果。

  总觉得应该有办法,不过由于我对 Java 一窍不通,特地请熟悉 Java 的热心人士帮忙看看。
发表于 2010-11-1 16:30:12 | 显示全部楼层
man appletviewer
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-11-1 17:22:38 | 显示全部楼层
Post by liuex;2118049
man appletviewer


好东西,虽然还是没有运行起来,但非常感谢您提供的信息。
回复 支持 反对

使用道具 举报

发表于 2010-11-1 19:53:03 | 显示全部楼层
为什么不直接装个真正的vncviewer?
比如:
gvncviewer - VNC viewer using gtk-vnc
gtkvncviewer - Small GNOME VNC client
xtightvncviewer - virtual network computing client software for X
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-11-2 09:27:20 | 显示全部楼层
Post by lastart;2118060
为什么不直接装个真正的vncviewer?
比如:
gvncviewer - VNC viewer using gtk-vnc
gtkvncviewer - Small GNOME VNC client
xtightvncviewer - virtual network computing client software for X



并非我要用 VNC Viewer, 而是想了解一下 Java Applet 的基本运行机制。
回复 支持 反对

使用道具 举报

发表于 2010-11-2 19:31:36 | 显示全部楼层
java  -classpath pathto\tightvnc-java VncViewer HOST 192.168.200.129 PORT 5900

there is a readme in  doc of  tightvnc-java.deb

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3. Running the viewer as a standalone application.

     Finally, the Java viewer can be executed locally on the client machine,
     but this method requires installation of either JRE (Java Runtime
     Environment) or JDK (Java Development Kit). If all the .class files are
     in the current directory, the Java viewer can be executed like this,
     from the command line:

         java VncViewer HOST vnchost PORT 5900

     The parameters HOST and PORT are required, but there is a number of
     optional parameters as well (see the Parameters section below).
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-11-2 21:28:16 | 显示全部楼层
Post by ccwufu;2118177
java  -classpath pathto\tightvnc-java VncViewer HOST 192.168.200.129 PORT 5900

there is a readme in  doc of  tightvnc-java.deb

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3. Running the viewer as a standalone application.

     Finally, the Java viewer can be executed locally on the client machine,
     but this method requires installation of either JRE (Java Runtime
     Environment) or JDK (Java Development Kit). If all the .class files are
     in the current directory, the Java viewer can be executed like this,
     from the command line:

         java VncViewer HOST vnchost PORT 5900

     The parameters HOST and PORT are required, but there is a number of
     optional parameters as well (see the Parameters section below).






多谢高人指点!居然在那里隐藏着文档,这样试了一下

java -jar VncViewer.jar HOST 192.168.200.129 PORT 5900

果然成功!

再次感谢!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表