Launching Java applications from web pages

Hi there,
Do you know how to launch Java applications (not applets) from web pages ? Thank you.
Berk Can Celebisoy

Do you know how to launch Java applications (not applets) from web pages ? Thank you.
you can setoff a java servlet from a webpage.Is that what you are talking about ??? activeateing a server side app ????

Similar Messages

  • Launching external applications from web start

    Hi!
    I am currently working on a management system and I need to launch other management systems from my Java Web Start application. The other systems are either based on web applications (URLs), telnet - needs to set up a telnet session, or running shell scripts or batch files.
    URLs are ok. I am using Desktop.browse in Java 1.6 or I can use BasicService.showDocument in javax.jnlp API.
    My application may run on both windows and linux (ie its launched from the browser). It interacts with a java app on a linux server over RMI.
    How can I lauch a telnet session from my client app?
    Do I have to include apache commons.net and create a telnet module in my app or can i lauch c:\windows\system32\telnet.exe in windows (if my app is lauched on win) and /usr/kerberos/bin/telnet (if my app is lauched in Linux)?
    How can I launch an external .exe application in window and how can I launch any shell script or program in Linux?
    (same as how do i lauch telnet)
    As long as the user is prompted I can see no risk of denying these kind of things so I hope and think that this should be possible!
    PS. I have managed to do it by using Runtime.exec() when running as a non JWS application, but I cannot do it when running as JWS:
    java.security.AccessControlException: access denied (java.io.FilePermission <<ALL FILES>> execute)I dont want to sign the application either. The reason for choosing webstart was to not have to renew certificates at our customers.
    Please help.
    Thanks for taking interest and reading this.. and I hope that someone has some helpful answers for me :)
    Edited by: Tomas_Andersen on Feb 5, 2008 6:34 AM

    Do you know how to launch Java applications (not applets) from web pages ? Thank you.
    you can setoff a java servlet from a webpage.Is that what you are talking about ??? activeateing a server side app ????

  • Running a Java application from web browser

    Hi,
    I'm not sure if this is the right place to put this, and it probably isn't, but I don't really know what else to do at the moment.
    I have a problem. I've written all these nice and pretty Java applications that do all this complicated junk that makes me proud. However...I have no idea how to actually run those applications.
    I've looked at guides on Java applets, Java Web Start, Java Server Pages, etc, and I still am not sure. JSP looked like the best option, until I figured out I can't use it with my web server. So, I've pretty much hit a wall here.
    If anyone could shed some light on this, I would be very appreciative. All I want is for a certain application to run when a user clicks a button on a simple HTML page. That's all I want...yet it seems so hard.
    Is there a simple way to do this, or do I need to use JWS or something and configure all these JARs and JNLP and classpaths and everything under the sun (no pun intended)?
    Again, I apologize if there is a better forum for this; I am just very confused right now and feel like I've hit a brick wall. If anyone can give me any advice, or point me in a good (easy) direction, I would truly be grateful.

    If anyone could shed some light on this, I would be
    very appreciative. All I want is for a certain
    application to run when a user clicks a button on a
    simple HTML page. That's all I want...yet it seems so
    hard. There's a lot of hidden details that make it so hard. What computer will run the application when the button is clicked? If the application will run on the client computer (within the web browser) there has to be a mechanism for allowing arbitrary code to be downloaded, verified and executed on any number of different target platforms. This is the problem that Java Applets address. Mostly this is a security issue, since a simple HTML page being able to run arbitary code without user interaction or approval is going to cause the world to be overrun by computer virii. There's also the multi-platform issue, but in many cases that can be avoided by requiring the client to use a single platform (the MS approach).
    If the application will run on the server, then the client code is much less difficult, as only a basic web browser is needed, and the server code is complicated, since it needs to keep track of multiple clients at the same time and process data in a request-response fashion.
    From the end-user's point-of-view, it certainly is simple though. Press the button and voila!
    "Any technology which is distinguishable from magic is insufficiently advanced"
    Brian

  • (how) can I access Java APIs from web-page-hosted JavaScript?

    Can I access Java APIs from a web-page via JavaScript if I have a JRE installed on the client machine? And if so, how?
    Thanks in advance for your time and consideration.

    John L. wrote:
    Can I access Java APIs from a web-page via JavaScript if I have a JRE installed on the client machine? And if so, how?As far as I can remember that was actually possible in the very first versions of Netscape because Netscape really wanted to pretend Javascript and Java were meant to be used together. But they soon removed that functionality. Can you guess why?
    Because people were using the File/IO classes to easily steal or remove files on the harddrive, among other such niceties. You do NOT want to have such control from a web application. People will abuse it.

  • Reverse-Engineer Java Class Files ---- Launch Java Application From Icon

    hi,
    is there a way to prevent java class files from being interpreted back into java source files (jad.exe does exactly that) ?
    i have a batch file to compile my java application and another to run the application. the application is run by invoking the batch file from dos window.
    i'd like to be able to double-click on some icon to launch the application.
    how do i accomplish this?
    thank you.

    s there a way to prevent java class
    files from being interpreted back into
    java source files (jad.exe does exactly that) ?There are two ways to prevent that:
    1. Use an obfuscator. Look at this page for
    explanation of what is that, and then search google
    "java obfuscator" for products.
    http://www.devx.com/tips/Tip/13580
    2. Compile your application to native code (google
    for "excelsior jet" or "gcj"). Look at this page for
    more details:
    http://www.excelsior-usa.com/jetprotection.html
    i'd like to be able to double-click on some
    icon to launch the application.
    how do i accomplish this?Do you want to do that on your computer only, or you
    need a solution to make the clickable icon on
    computers of your end-users?
    Denis.thanks to all,
    i'll see suggest sites for more details on obfuscator.
    I'd like to have the application doulbe-clickable on end-users' computers.

  • Launching Java Application From A Java Application

    Hello,
    I am building a compiler and would like to have run feature. The problem is I can not seem to figure out the righ syntax to run and application from my java application.
    Here is the code I am using to run an application:
    public void RunClass()
    try
    Runtime rtr=Runtime.getRuntime();
    Process pr = rtr.exec("java " + CurrentDirectory + FileNoExt);
    String line;
    BufferedReader rerr = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
    if((line = rerr.readLine()) == null) { CompileMessageArea.setText("Program Running\n"); }
    while ((line = rerr.readLine()) != null) { CompileMessageArea.append(line +"\n"); }
    rerr.close();
    catch(Exception re) { re.printStackTrace(); }
    The following is an example of what the above would send to the:
    java c:\MyJava\Programs\test
    If you try to type something like that in a DOS prompt it will not work. You must first change to that directory, but I am hoping there is an easy way to change the syntax. On the other hand if you want to compile a program you can type:
    javac c:\MyJava\Programs\test.java
    and it will work just fine. This is kind of funny and I use this syntax for my compiler in my program. You would think that the same syntax would work the same for both compiling and running but it does not. So, I know that if I just know what the correct syntax that dos would except for running an application it would work.
    So, if you have the answer for me PLEASE LET ME KNOW.
    It is easily testable by keying it into the dos prompt.
    Sincerely,
    Eric Kohr

    If you want to do it that way you need to use the environment parameter of the exec() method. Use it to set your classpath to the directory that's need for the java application you are about to run... for instance.
    String[] env = new String[] {"CLASSPATH=c:\classes"}
    String command = "java somePackage.someProgram";
    Runtime.getRuntime().exec( env, command);Where your program is in the file "c:\classes\somePackage\someProgram"
    your mileage may vary :)
    You can also reflectively load classes into the running VM and invoke their main methods. This give you the ablility to control them a bit more.

  • How to open a java application from a web page?

    Friends
    I am in a situation to open a java application from a web page. I wrote a applet and placed a button on it. Onclicking of that button i con't open my java application. plz help me to open a userdefined application from web page.
    Ramesh
    e-Brahma technologies

    http://java.sun.com/products/javawebstart/index.jsp

  • Calling a java application from j2ee web application

    Hi,
    I have a j2ee application in which i am making a call to a jar file which is a java application.
    Runtime a4 = Runtime.getRuntime();
    Runtime a = Runtime.getRuntime();
    String cmd[] = new String[14];
    cmd[0] = "cmd";
    cmd[1] = "/c";
    cmd[2] = "start";
    cmd[3] = "javaw";
    cmd[4] = "-jar";
    cmd[5] = CATALINA_HOME+"\\webapps\\AveksaTesting\\AveksaTestingJava\\dist\\AveksaTestingJava.jar";
    cmd[6] = SERVER_TESTS;
    cmd[7] = COLLECTOR_TESTS;
    cmd[8] = SYSTEM_TESTS;
    cmd[9] = CREATE_ORACLE;
    cmd[10] = DB_NAME;
    cmd[11] = DB_DUMP;
    cmd[12] = email;
    cmd[13] = isMIGRATE;
    try{
    java.lang.Process p = a.exec(cmd);
    Now in the called java application, i am first shutting down the tomcat server by calling shutdown.bat script and then starting it using startup.bat. But the problem i am facing is when i restart the server from java application, it says address already in use(i.e. port 8445 on which tomcat is runninng).
    Id i just call the java application and do the same operation it works fine. I guess when i am calling java from j2ee application, j2ee still has some threads holding java and not shutting down tomcat properly.
    Can anyone suggest me what can be done in this case. I have to call a java application from j2ee and restart the tomcat server many times.
    Thanks in advance
    -Vikram

    Annoyingly crossposted.
    http://forum.java.sun.com/thread.jspa?threadID=730657

  • Calling Java application from servlet

    Hi !
    I'm trying to run a Java application from within a servlet with Tomcat 4. I'm using the Runtime.getRuntime ().exec () method. So the application is run in a different JVM as a subprocess of the servlet. I use ObjectInputStream and ObjectOutputStream and a serializable object to enable communication between the servlet and the application.
    I tested the application and the serializable object with another Java application that works as the caller and it works fine. However, replacing the caller application with the servlet I get a StreamCorruptedException. The structure of the caller application and the servlet is the same.
    My questions are:
    - Is there something I should configure in Tomcat to create a subprocess ?
    - What is the cause of the StreamCorruptedException ? How do I get it with the servlet and not with the application ?
    - Should I use an environment with the call to Runtime.getRuntime ().exec () ? How do I use it ?
    - Is the called application forced to run in my servlet's context ?
    - Is there a better way to do this ?
    Thanks to all

    Here's my code:
    1. The serializable object:
    // Object Obj
    import java.io.*;
    public class Obj implements Serializable
    public int n;
    public Obj ()
    n = 0;
    public Obj (int n)
    this.n = n;
    public String toString ()
    return getClass ().getName () + " -> (n = " + n + ")";
    2. The application Sub (subprogram)
    // Application Sub
    import java.io.*;
    public class Sub
    private static File f;
    private static FileWriter fw;
    public static void main (String [] args)
    throws IOException, InterruptedException, ClassNotFoundException
    ObjectInputStream ois;
    ObjectOutputStream oos;
    Obj obj;
    ois = new ObjectInputStream (System.in);
    obj = (Obj) ois.readObject ();
    f = new File ("Sub.txt");
    fw = new FileWriter (f);
    fw.write (obj.toString ());
    fw.close ();
    oos = new ObjectOutputStream (System.out);
    oos.writeObject (obj);
    ois.close ();
    oos.close ();
    3. The application AMain (caller application)
    // Application AMain
    import java.io.*;
    class AMain
    private static File f;
    private static FileWriter fw;
    public static void main (String [] args)
    throws IOException, ClassNotFoundException
    Runtime r;
    Process p;
    ObjectInputStream ois;
    ObjectOutputStream oos;
    Obj obj, obj2;
    r = Runtime.getRuntime ();
    p = r.exec ("java Sub");
    oos = new ObjectOutputStream (p.getOutputStream ());
    obj = new Obj (5);
    oos.writeObject (obj);
    oos.flush ();
    B.comunica (obj);
    System.out.println ("AMain sends to Sub: " + obj.toString ());
    try
    p.waitFor ();
    catch (InterruptedException e)
    System.out.println ("Subprogram was interrupted");
    System.out.println (e.toString ());
    ois = new ObjectInputStream (p.getInputStream ());
    System.out.print ("Sub sends to AMain: ");
    obj2 = (Obj) ois.readObject ();
    System.out.println (" " + obj2.toString ());
    oos.close ();
    ois.close ();
    p.destroy ();
    4. The servlet SMain (the calling servlet)
    // Servlet SMain
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    public class SMain extends HttpServlet
    public void doPost (HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    Runtime r;
    Process p;
    ObjectInputStream ois;
    ObjectOutputStream oos;
    Obj obj, obj2;
    int state, i;
    res.setContentType ("text/html");
    ServletOutputStream out = res.getOutputStream ();
    out.println ("<html>");
    out.println ("<head><title>Sub</title></head>");
    out.println ("<body>");
    out.println ("Invoking subprogram...");
    out.println ("<br>");
    try
    r = Runtime.getRuntime();
    p = r.exec ("java -cp .;c:\\Programs\\Apache~1.0\\webapps\\SMain\\WEB-INF\\classes Sub");
    out.println ("...invoked<br>");
    oos = new ObjectOutputStream (p.getOutputStream ());
    obj = new Obj (5);
    oos.writeObject (obj);
    oos.flush ();
    out.println ("<br>SMain sends to Sub: " + obj.toString () + "<br>");
    try
    p.waitFor ();
    catch (InterruptedException e)
    out.println ("<br>Subprogram was interrupted<br>");
    out.println ("<br>" + e.toString () + "<br>");
    state = p.exitValue ();
    out.println ("<br>Subprogram state: " + state + "<br>");
    ois = new ObjectInputStream (p.getInputStream ());
    out.print ("<br>Sub sends to SMain: ");
    obj2 = (Obj) ois.readObject ();
    p.destroy ();
    catch (SecurityException e)
    out.println ("<br>SecurityException<br>");
    out.println ("<br>" + e.toString () + "<br>");
    catch (IOException e)
    out.println ("<br>IOException<br>");
    out.println ("<br>" + e.toString () + "<br>");
    catch (Exception e)
    out.println ("<br>Exception<br>");
    out.println ("<br>" + e.toString () + "<br>");
    out.println ("</body>");
    out.println ("</html>");
    So, as you can see, both application AMain and servlet SMain invoke application Sub and pass it the serializable object Obj. Oddly enough, application AMain works fine whereas servlet SMain throws a StreamCorruptedException exception.
    johnpoole said:
    �It's hard to guess what would cause the exception without seeing code, but the interaction between the processes would differ from that between two applications, because the servlet process is started with a different class loader. I'm not sure which one the jvm started by the call would use.�
    How can I enforce that a System classloader be used in the call to Runtime.getRuntime ().exec () ? (I mean by System classloader a classloader equals to the one applications are launched from console).
    johnpoole said
    �Is there a reason why you aren't starting the second process manually and then connecting to it on a port?�
    The idea is providing a Web interface for an application running in the server. The servlet is used to restrict access to this application but once access is granted (passing the servlet) the application should not be constrained.

  • CS6: DistributedCOM Error id: 10016 when open pdf from web page in Win8.1

    For example here below I've got the issue: 
    http://modemwifi.it/wp-content/uploads/asus-dsl-n55u.pdf
    Adobe Acrobat X pro V 10.1.8:
    DistributedCOM Error id: 10016 when open pdf from web page.
    Nome registro: System
    Origine:       Microsoft-Windows-DistributedCOM
    Data:          04/11/2013 19:09:19
    ID evento:     10016
    Categoria attività:Nessuna
    Livello:       Errore
    Parole chiave: Classico
    Utente:        PC-PIERO\Piero
    Computer:      Pc-Piero
    Descrizione:
    Le impostazioni delle autorizzazioni impostazioni predefinite del computer non concedono l'autorizzazione di Attivazione in Locale per l'applicazione server COM con CLSID
    {B801CA65-A1FC-11D0-85AD-444553540000}
    e APPID
    {2EAF0840-690A-101B-9CA8-9240CE2738AE}
    all'utente Pc-Piero\SID Piero (S-1-5-21-3453328585-262132574-2759341577-1001) dall'indirizzo LocalHost (tramite LRPC) in esecuzione nel SID del contenitore di applicazioni Non disponibile (S-1-15-2-1430448594-2639229838-973813799-439329657-1197984847-4069167804-1277922394). Per modificare tale autorizzazione di sicurezza, è possibile utilizzare lo strumento amministrativo Servizi componenti.
    XML evento:
    < Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Microsoft-Windows-DistributedCOM" Guid="{1B562E86-B7AA-4131-BADC-B6F3A001407E}" EventSourceName="DCOM" />
        <EventID Qualifiers="0">10016</EventID>
        <Version>0</Version>
        <Level>2</Level>
        <Task>0</Task>
        <Opcode>0</Opcode>
        <Keywords>0x8080000000000000</Keywords>
        <TimeCreated SystemTime="2013-11-04T18:09:19.468877700Z" />
        <EventRecordID>14806</EventRecordID>
        <Correlation />
        <Execution ProcessID="768" ThreadID="776" />
        <Channel>System</Channel>
        <Computer>Pc-Piero</Computer>
        <Security UserID="S-1-5-21-3453328585-262132574-2759341577-1001" />
      </System>
      <EventData>
        <Data Name="param1">impostazioni predefinite del computer</Data>
        <Data Name="param2">Locale</Data>
        <Data Name="param3">Attivazione</Data>
        <Data Name="param4">{B801CA65-A1FC-11D0-85AD-444553540000}</Data>
        <Data Name="param5">{2EAF0840-690A-101B-9CA8-9240CE2738AE}</Data>
        <Data Name="param6">Pc-Piero</Data>
        <Data Name="param7">Piero</Data>
        <Data Name="param8">S-1-5-21-3453328585-262132574-2759341577-1001</Data>
        <Data Name="param9">LocalHost (tramite LRPC)</Data>
        <Data Name="param10">Non disponibile</Data>
        <Data Name="param11">S-1-15-2-1430448594-2639229838-973813799-439329657-1197984847-4069167804-1 277922394</Data>
      </EventData>
    < /Event>
    How can I solve this problem?
    Thanks

    // I got this from an Action (I�m using Struts)
    java.sql.Blob file=(java.sql.Blob)request.getAttribute("PDFfile");
    String filename=(String)request.getAttribute("filename");
    try{
      int iLength = (int)(file.length());
      response.setHeader("Content-type", "application/pdf");   
      response.setHeader("Content-Disposition", "inline; filename=\""+filename+"\"");
      response.setHeader("Expires","0");
      response.setHeader("Cache-Control","must-revalidate, post-check=0, pre-check=0");
      response.setHeader("Pragma","public");
      response.setContentLength(iLength);
      ServletOutputStream os = response.getOutputStream();
      InputStream in = null;
      in = file.getBinaryStream();
      byte buff[] = new byte[1024];
      while (true) {
          int i = in.read(buff);
          if (i<0) break;      
          os.write(buff,0,i); 
      os.flush();
      os.close();
    } catch(Exception ex){
       out.println("Error while reading file : " + ex.getMessage());
    }and now it�s running !!! I�m not using response.setContentType(...) and I do this in response.setHeader("Content-type", "application/pdf"). And I use response.setHeader("Content-Disposition", "inline; filename=\""+filename+"\"") instead of response.setHeader("Content-Disposition", "attachment; filename=\""+filename+"\"");

  • Calling Webdynpro Java Application from Webdynpro ABAP Application.

    Hi,
    We have developed one Application using Webdynpro Java and I m in need to call the Webdynpro Java application from Webdynpro ABAP.
    Require Suggestions to acheive this.
    Thanks In advance.
    Reg,
    Ajay.

    Dear Ajay,
    Assuming that both your applications WDA & WDJ are in the portal & you don't have to pass any parameters to the WDJ application.
    Write the following code on the action  where you would call the WDJ application.
      DATA:
            lr_compcontroller TYPE REF TO ig_componentcontroller,
            l_component TYPE REF TO if_wd_component ,
            lr_port_manager TYPE REF TO if_wd_portal_integration ,
            wa_navigation TYPE navigation.
      lr_compcontroller =   wd_this->get_componentcontroller_ctr( ).
      l_component = lr_compcontroller->wd_get_api( ).
      lr_port_manager = l_component->get_portal_manager( ) .
    * The value inserted into the navigation-target field can be found in the Portal
    * content administration tab of your portal. It is the ID or PCD Location field
      wa_navigation-target = pcd. " Please provide the PCD Location of the WDJ Application here.
      wa_navigation-mode   = '0'.  "0 = INTERNAL(same page) and 1 = EXTERNAL(new page).
      CALL METHOD lr_port_manager->navigate_absolute
        EXPORTING
          navigation_target = wa_navigation-target
          navigation_mode   = wa_navigation-mode.
    You can get the PCD from the Page properties of the WDJ application page in the Portal.
    Hope it helps!
    Warm regards,
    Upendra Agrawal

  • How to integrate webdynpro java application in HTML pages?

    hi EP GUrus
                i need to re design an Webdynpro java application into web home page. there is one home page designed is wd java . now i have to redesign the page and i have make some web content like training calender new schemes and all which they manually update daily
    thanks in advance
    johny

    hii  sir
               currently we have an application which is accessing through internet using url .that applicalion is wd java application which is need to redesign with dynamic contects

  • How to load java class from jsp page?

    hi all!
    Does anyone know how to load java class from jsp page?
    I try to load java class from jsp page.
    Is it possible to load java class fom jsp page?
    thanks and have a good day!

    What I mean is How to load/open java class file from jsp page?
    I think we can open Applet from jsp page by using
    <applet code=helloApplet.class width=100 height=100>
    </applet>
    but, how to open java class which is an application made by Frame?
    thanks and have a good day

  • Passing Parameter from Web Page to Form 6i

    Dear All,
    We are using 9i AS with Form 6i. I want to created a web page for user login and called my application By passing value
    window.open("http://hrtest/dev60cgi/ifcgi60.exe?form=login_form.fmx&width=1000&height=700&
    userid=logme/logme1@test","","width=1000,height=700,top=0,left=0,location=no,directories=no,
    status=no,menubar=no,toolbar=no,maximize=yes,resizable=yes")
    and it successfully run.
    I want to pass additional parameter to my login_form.fmx from web page like User Shift entered by user on logon ?
    Please help me out.
    Regards,
    Khurram

    I got the clue
    pass parameter in your UR
    as
    //hrtest/dev60cgi/ifcgi60.exe?form=LOGIN_FORM_Para.fmx&width=1000&height=700&userid=power/power1@hrtest&otherparams=PAKISTAN=ALLAH"
    Define a :PARAMETER.PAKISTAN on Form
    and write following trigger
    BEGIN
    if :PARAMETER.PAKISTAN = 'ALLAH' then
    message('ALLAH HO AKBAR');
    message('ALLAH HO AKBAR');
    message(:PARAMETER.PAKISTAN||' HO AKBAR');
    message(:PARAMETER.PAKISTAN||' HO AKBAR');
    else
    message('INSH'||:PARAMETER.PAKISTAN);
    message('INSH'||:PARAMETER.PAKISTAN);
    end if;
    END;
    Regards
    Khurram Altaf | Assistant Manager ERP
    Enterprise Resource Planning Department
    Kohinoor Textiles Mills Ltd
    Peshawar Road, Rawalpindi.
    +92.51.5473940-44 ext 250 | +92.333.5256626
    e-mail: [email protected] | web: www.kmlg.com

  • Launch Java App from Windows Desktop

    What's the best way to launch a Java application from a Windows XP desktop without the console showing?

    If your class Main.class is part of a package, you cannot invoke Main directly without providing the package. You may have to include the -classpath option (depending of the working directory). The default value for -classpath is "."
    You should try:
    javaw myPackage.Main
    (if the working directory is parent to directory 'myPackage')
    or
    javaw -classpath .;c:\xxx\xxx\. myPackage.Main
    "c:\xxx\xxx\" is your root package's parent directory. Note that you may have to double quote the specified path.
    For details:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/java.html

Maybe you are looking for