简体   繁体   中英

Get rid of Java Deployment Toolkit when running applets

I would like to get rid of Java Deployment Toolkit when running applets. Actually my customer doesn't want to click activate in applet before it start running. It happens if the JRE has installed the DT, this is not my case, so I can't reproduce locally.

I am running my applet using the deployJava.js.

Is there a way to disable the Deployment Toolkit directly in my code? I don't to instruct my users to disable/remove DT from their browser.

deployJava.js is the Deployment Toolkit. As far as I know, it is never installed in a browser. It is web content, and a page containing an applet will normally include the Deployment Toolkit with <script src="https://www.java.com/js/deployJava.js"></script> (or it can point to a bundled copy, such as <script src="deployJava.js"></script> ).

You can place an applet in a page without using the Deployment Toolkit, by doing away with deployJava.js altogether, and simply writing HTML that embeds the applet:

<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
        codebase="http://java.sun.com/update/1.7.0/jinstall-7u67-windows-i586.cab"
        width=400 height=200>
    <param name="type" value="application/x-java-applet;version=1.7">
    <param name="archive" value="SimpleApplet.jar">
    <param name="code" value="com/example/SimpleApplet.class">

    <object codetype="application/x-java-applet;version=1.7"
            archive="SimpleApplet.jar"
            classid="java:com.example.SimpleApplet"
            width=400 height=200>

            Java plug-in not installed.
    </object>

</object>

The outer <object> renders in Internet Explorer. Browsers which don't know how to render an <object> element will fall back to rendering its nested content, which in this case is the inner <object> element. See the documentation of <object> for more information.

If your applet is using a JNLP file, specify it in both <object> elements:

<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
        codebase="http://java.sun.com/update/1.7.0/jinstall-7u67-windows-i586.cab"
        width=400 height=200>
    <param name="type" value="application/x-java-applet;version=1.7">
    <param name="archive" value="SimpleApplet.jar">
    <param name="code" value="com/example/SimpleApplet.class">
    <param name="jnlp_href" value="SimpleApplet.jnlp">

    <object codetype="application/x-java-applet;version=1.7"
            archive="SimpleApplet.jar"
            classid="java:com.example.SimpleApplet"
            width=400 height=200>
        <param name="jnlp_href" value="SimpleApplet.jnlp">

        Java plug-in not installed.
    </object>

</object>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM