Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4000128
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:44:35+00:00 2026-05-20T07:44:35+00:00

I have a code/class/script in JAVA that I want to be executed when someone

  • 0

I have a code/class/script in JAVA that I want to be executed when someone clicks on a button/anything that I will handle. What should be the code in JavaScript to launch that class/code/script/compiled program installed on the client’s system?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:44:36+00:00Added an answer on May 20, 2026 at 7:44 am

    It depends on what you are trying to do with the program on the client-side. If you want to call other programs on the client’s machine, you will need a few things.

    1. A code-signing certificate from an SSL vendor.
    2. You need to create an class that extends Applet.
    3. For just about anything you want to do on that client machine you need a class that implements java.security.PrivilegedAction.
    4. You should really use the objet and embed tags instead of applet now.
    5. Add the attributes to both the object and embed tags that allow scripting from Javascript.

    Java code

    public class MyApplet extends Applet
    {
       public Object myScriptAction(String arg1, String arg2)
       {
           PrivilegedAction action = new MyAction();
           action.setXXXX();
           Object o = AccessController.doPrivileged(action);
           return o;
       }
    
       private class MyAction implements PrivilegedAction
       {
           public MyAction() {}
           ...
           public Object run()
           {
               // Do something here, Runtime.exec() or something else
               Runtime.getRuntime().exec(cmdarray, envarray, workingDir);
               return myobj;
           }
       }
    }
    

    HTML code with tags removed

        object name="myapplet" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="1" height="1"
        param name="name" value="myapplet"
        param name="code" value="com.example.MyApplet"
        param name="codebase" value="<c:out value="/path/to/applet/"
        param name="archive" value="myapplet.jar"
        param name="scriptable" value="true"
        param name="mayscript" value="true"
        comment
            embed
                type="application/x-java-applet;version=1.5"
                code="com.example.MyApplet"
                java_codebase="/path/to/applet/"
                archive="myapplet.jar"
                name="myapplet"
                width="1"
                height="1"
                mayscript="true"
                scriptable="false"
                pluginspage="http://java.sun.com/products/plugin/index.html#download"
                noembed
                        Java not supported.
                noembed
            embed
         comment
    object
    

    The key is the mayscript and scriptable attributes that allow Javascript to call an applet.

    You then use jarsigner to sign the myapplet.jar with the code-signing cert you get.

    See this guide from Sun on mixed-browser Java plugin support.

    http://java.sun.com/j2se/1.5.0/docs/guide/plugin/developer_guide/using_tags.html#mixed

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a problem with my script i have a method that return a
I have to compare files with java with a CRC32 code provided by a
I have the following method_missing code implemented in a model: # class Thought def
I have a GWT application that includes an embedded applet. I would like to
I am trying to write a little script myself to compute all of the
I'm trying to embed groovy in java application and got a weird problem. Let's
I am using a findbugs in an ANT script and I can't figure out
I am trying to use ProGuard with Android. I have found several ProGuard scrips
First, some basic details: I'm using Visual Studio 2008 Team Edition I'm using C#
My app uses Struts2 MVC, Spring JDBC Template with Eclipse IDE and Tomcat. Whenever

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.