你可以在Chrome上运行Java吗? JNLP?

时间:2017-06-13 21:08:07

标签: google-chrome jnlp tightvnc-jviewer

我正在建立一个网站,我需要有一个VNC查看器。我已经使用了Tight VNC,他们有一个Java Viewer。此代码可以作为applet运行,但现代浏览器(如Chrome和Firefox)不允许使用applet。还有另一种在Chrome上运行Java代码的方法吗?

我已经读过一些浏览器支持Java Web Start,但我认为Chrome不支持。如果Chrome确实可以帮助我将此applet转换为JNLP文件吗?

<applet archive="tightvnc-jviewer.jar"
    code="com.glavsoft.viewer.Viewer"
    width="1" height="1">
    <param name="Host" value="localhost"/>
    <!-- Host to connect. Default:  the host from which the applet was loaded. -->
    <param name="Port" value="5900"/>
    <!-- Port number to connect. Default: 5900 -->
    <!--param name="Password" value="" /--> <!-- Password to the server (not recommended to use this parameter here) -->
    <param name="OpenNewWindow" value="yes"/>
    <!-- yes/true or no/false. Default: yes/true -->
    <param name="ShowControls" value="yes"/>
    <!-- yes/true or no/false. Default: yes/true -->
    <param name="ViewOnly" value="no"/>
    <!-- yes/true or no/false. Default: no/false -->
    <param name="AllowClipboardTransfer" value="yes"/>
    <!-- yes/true or no/false. Default: yes/true -->
    <param name="RemoteCharset" value="standard"/>
    <!-- Charset encoding is used on remote system. Use this option to specify character encoding will be used for encoding clipboard text content to. Default value (when parameter is empty): local system default character encoding. Set the value to 'standard' for using 'Latin-1' charset which is only specified by rfb standard for clipboard transfers. -->

    <param name="ShareDesktop" value="yes"/>
    <!-- yes/true or no/false. Default: yes/true -->
    <param name="AllowCopyRect" value="yes"/>
    <!-- yes/true or no/false. Default: yes/true -->
    <param name="Encoding" value="Tight"/>
    <!-- Possible values: "Tight", "Hextile", "ZRLE", and "Raw". Default: Tight -->
    <param name="CompressionLevel" value=""/>
    <!-- 1-9 or empty. Empty means server default -->
    <param name="JpegImageQuality" value=""/>
    <!-- 1-9, Lossless or empty. When param is set to "Lossless" no jpeg compression used. Empty means server default -->
    <param name="LocalPointer" value="On"/>
    <!-- Possible values: on/yes/true (draw pointer locally), off/no/false (let server draw pointer), hide). Default: "On"-->
    <param name="ConvertToASCII" value="no"/>
    <!-- Whether to convert keyboard input to ASCII ignoring locale. Possible values: yes/true, no/false). Default: "No"-->

    <param name="Tunneling" value="auto"/>
    <!-- Tunneling. Possible values:
    auto - allow viewer to choose tunneling mode,
    none/no - no tunneling use,
    SSL - choose SSL tunneling when available.
    Default: "auto" -->

    <param name="colorDepth" value=""/>
    <!-- Reserved for future. Possible values: 6, 8, 16, 24, 32 (equals to 24). Only 24/32 is supported now -->
    <param name="ScalingFactor" value="100"/>
    <!-- Scale local representation of the remote desktop on startup. Default is 100 means 100% -->
    <!--param name="showConnectionDialog" value="yes" /-->
    <!-- Set to "No" if you want not to show initial connection dialog. Default: "Yes". -->
    <param name="AppletGoodbyeURL" value="about:blank"/>
    <!-- URL to be redirected on applet stopping. When blank or absent stop applet and do nothing. -->
    <!-- SSH tunneling options -->
    <param name="sshHost" value=""/>
    <!-- SSH host name. -->
    <param name="sshUser" value=""/>
    <!-- SSH port number. When empty, standard SSH port number (22) is used -->
    <param name="sshPort" value=""/>
    <!-- SSH user name. -->

</applet>

如果您需要.jar文件,可以在http://www.tightvnc.com/download.php

下载

如果无法从Chrome运行Java,有没有办法让我在Internet Explorer中创建一个能够将用户打开到该页面的链接?

2 个答案:

答案 0 :(得分:0)

Chrome和Firefox都不支持Java小程序。您必须切换到HTML5或flash。

答案 1 :(得分:0)

Chrome和Firefox不久前放弃了Java支持。 Edge开始时并不支持它。您可以从每个浏览器打开.jnlp文件(请参阅示例here),但这就像打开您从Internet上下载的任何可执行文件。查看上面的示例,看看它在每个浏览器中的行为。

  

如果无法从Chrome运行Java,有没有办法让我在Internet Explorer中创建一个能够将用户打开到该页面的链接?

不,你无法切换浏览器。这将是一个很大的安全风险,你会在macOS或linux上做什么?

关于迁移到webstart * racle提供了一些支持herehere