Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Execute jar file from javascript or HTML

  1. #1
    Junior Member
    Join Date
    Jul 2017
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Execute jar file from javascript or HTML

    Hi

    I need to call jar file from javascript or HTML,just a helloworld program for sample.how to do this.I have tried APPLET Tag and OBJECT Tag, but i am getting error

    <applet id="appletToTest" width=500 height=500 code="com.sample.SampleApplet" archive="JavaApplication6.jar">

    </applet>

    In the script i used the below code.
    <script language="javascript">

    var greeting = appletToTest.getGreeting();
    alert(greeting)
    <script>
    Getting the error as 'appletToTest is not defined'.Same error getting for OBJECT Tag.Please guide me where i am wrong.

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Execute jar file from javascript or HTML

    Access to applets have been removed from most browsers now because of security concerns.

    I just found that MS's Internet Explorer on Win10 will execute applets
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. how to get normal html javascript function value to java code
    By Sri Ram in forum What's Wrong With My Code?
    Replies: 1
    Last Post: September 15th, 2014, 06:30 AM
  2. JEditorPane doesn't load html file when jar executable run
    By dancaer69 in forum What's Wrong With My Code?
    Replies: 8
    Last Post: November 12th, 2013, 10:46 AM
  3. How do I make an image in javascript or html
    By ouchimdead in forum Other Programming Languages
    Replies: 1
    Last Post: October 15th, 2013, 09:29 PM
  4. How to execute an executable JAR from within Java program?
    By Hawke in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: July 8th, 2013, 02:41 PM
  5. [SOLVED] .jar file won't execute
    By pajfilms in forum What's Wrong With My Code?
    Replies: 27
    Last Post: August 3rd, 2011, 07:43 PM