javascript to execute java program

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • moongeegee

    javascript to execute java program

    I have compile my java program as myjava.class. And I can run as "java
    myjava" without any program.
    As now, I need to execute myjava.class in javascript. Please shed a
    light how to execut "java myjava" in
    my javascript. Thanks a million.
  • Sister Ray

    #2
    Re: javascript to execute java program

    Javascripts runs in the browser you won't be able to do that. You
    can't call programs in the server on in the client computer from
    javascript.


    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: javascript to execute java program

      Sister Ray wrote:
      Javascripts runs in the browser you won't be able to do that. You
      can't call programs in the server on in the client computer from
      javascript.
      Utter nonsense.

      1. Neither programming language, including ECMAScript implementations
      like JavaScript, is restricted to the client or the server.

      2. If the Java program is an applet, LiveConnect/XPConnect can be used
      to access it from JavaScript.

      3. If the Java program is a servlet, a HTTP request can trigger it.
      HTTP requests can be initiated with JavaScript using an
      external API (e.g., DOM or XHR).


      PointedEars
      --
      Prototype.js was written by people who don't know javascript for people
      who don't know javascript. People who don't know javascript are not
      the best source of advice on designing systems that use javascript.
      -- Richard Cornford, cljs, <f806at$ail$1$8 300dec7@news.de mon.co.uk>

      Comment

      • moongeegee

        #4
        Re: javascript to execute java program

        On Sep 29, 3:41 pm, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
        wrote:
        Sister Ray wrote:
        Javascripts runs in the browser you won't be able to do that. You
        can't call programs in the server on in the client computer from
        javascript.
        >
        Utter nonsense.
        >
        1. Neither programming language, including ECMAScript implementations
           like JavaScript, is restricted to the client or the server.
        >
        2. If the Java program is an applet, LiveConnect/XPConnect can be used
           to access it from JavaScript.
        >
        3. If the Java program is a servlet, a HTTP request can trigger it.
           HTTP requests can be initiated with JavaScript using an
           external API (e.g., DOM or XHR).
        >
        PointedEars
        --
        Prototype.js was written by people who don't know javascript for people
        who don't know javascript. People who don't know javascript are not
        the best source of advice on designing systems that use javascript.
          -- Richard Cornford, cljs, <f806at$ail$1$8 300d...@news.de mon.co.uk>
        would you please give me some example how to execute the myjava.class
        via javascript.
        I have tried so many differnt, it doesn't seem working.
        Thanks so much.

        Comment

        • Thomas 'PointedEars' Lahn

          #5
          Re: javascript to execute java program

          moongeegee wrote:
          Thomas 'PointedEars' Lahn wrote:
          >1. Neither programming language, including ECMAScript implementations
          > like JavaScript, is restricted to the client or the server.
          >>
          >2. If the Java program is an applet, LiveConnect/XPConnect can be used
          > to access it from JavaScript.
          >>
          >3. If the Java program is a servlet, a HTTP request can trigger it.
          > HTTP requests can be initiated with JavaScript using an
          > external API (e.g., DOM or XHR).
          >[snipped quoted signature]
          >
          would you please give me some example how to execute the myjava.class
          via javascript.
          That depends on where it runs and what the type of program it is.
          I have tried so many differnt, it doesn't seem working.
          <http://jibbering.com/faq/#FAQ2_3>
          Thanks so much.
          You are welcome.


          PointedEars
          --
          var bugRiddenCrashP ronePieceOfJunk = (
          navigator.userA gent.indexOf('M SIE 5') != -1
          && navigator.userA gent.indexOf('M ac') != -1
          ) // Plone, register_functi on.js:16

          Comment

          • Tom Cole

            #6
            Re: javascript to execute java program

            On Sep 30, 2:32 am, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
            wrote:
            moongeegee wrote:
            Thomas 'PointedEars' Lahn wrote:
            1. Neither programming language, including ECMAScript implementations
               like JavaScript, is restricted to the client or the server.
            >
            2. If the Java program is an applet, LiveConnect/XPConnect can be used
               to access it from JavaScript.
            >
            3. If the Java program is a servlet, a HTTP request can trigger it.
               HTTP requests can be initiated with JavaScript using an
               external API (e.g., DOM or XHR).
            [snipped quoted signature]
            >
            would you please give me some example how to execute the myjava.class
            via javascript.
            >
            That depends on where it runs and what the type of program it is.
            >
            I have tried so many differnt, it doesn't seem working.
            >
            <http://jibbering.com/faq/#FAQ2_3>
            >
            Thanks so much.
            >
            You are welcome.
            >
            PointedEars
            --
            var bugRiddenCrashP ronePieceOfJunk = (
                navigator.userA gent.indexOf('M SIE 5') != -1
                && navigator.userA gent.indexOf('M ac') != -1
            )  // Plone, register_functi on.js:16
            If he's executing the program via the java command, then it's actually
            some sort of either desktop or headless application, and neither a
            servlet nor an applet. The other question remains "Where does this
            application lie?". Is it on the server or the client?

            If it's on the client, then I know of no way to execute a java
            application via javascript. For you gurus out there who want to chime
            in, it would be just like running any other application installed on
            the client pc....

            If the java application is on the server, then you will have to write
            a servlet that executes the java application, and have the javascript
            call the servlet to ask it to do so.

            Comment

            • Thomas 'PointedEars' Lahn

              #7
              Re: javascript to execute java program

              Tom Cole wrote:
              Thomas 'PointedEars' Lahn wrote:
              >moongeegee wrote:
              >>Thomas 'PointedEars' Lahn wrote:
              >>>1. Neither programming language, including ECMAScript implementations
              >>> like JavaScript, is restricted to the client or the server.
              >>>2. If the Java program is an applet, LiveConnect/XPConnect can be used
              >>> to access it from JavaScript.
              >>>3. If the Java program is a servlet, a HTTP request can trigger it.
              >>> HTTP requests can be initiated with JavaScript using an
              >>> external API (e.g., DOM or XHR).
              >>>[snipped quoted signature]
              >>would you please give me some example how to execute the myjava.class
              >>via javascript.
              >That depends on where it runs and what the type of program it is.
              >>
              >>I have tried so many differnt, it doesn't seem working.
              ><http://jibbering.com/faq/#FAQ2_3>
              >[...]
              >
              If he's executing the program via the java command, then it's actually
              some sort of either desktop or headless application, and neither a
              servlet nor an applet.
              ACK, I overlooked the second sentence, probably due bad writing.
              The other question remains "Where does this
              application lie?". Is it on the server or the client?
              >
              If it's on the client, then I know of no way to execute a java
              application via javascript. For you gurus out there who want to chime
              in, it would be just like running any other application installed on
              the client pc....
              There is a way, just not an interoperable one.
              If the java application is on the server, then you will have to write
              a servlet that executes the java application, and have the javascript
              call the servlet to ask it to do so.
              Correct if you mean "HTTP request" by "call" (why are you reiterating what
              was just said?). Another possibility that comes to mind are XML-RPCs.

              Please trim your quotes as recommended in the FAQ (see above).


              PointedEars
              --
              Use any version of Microsoft Frontpage to create your site.
              (This won't prevent people from viewing your source, but no one
              will want to steal it.)
              -- from <http://www.vortex-webdesign.com/help/hidesource.htm>

              Comment

              Working...