Running a Java application from a web page?

Hi
Could anyone please tell me how do i launch a java application (which is not an applet) by clicking a button on a web page?
Does the application have to be converted to .exe? And if so how do i do it?
The application is on my PC not on a server.
Thanking u in advance for ur help.

Hi dins19
Java WebStart is a pretty good technology for that purpose. Installing and launching a Java application on a local machine has always been a burdensome task. JWS really remedies that. The cool thing about JWS is that it works for both web and client applications. The technology introduces a new file format called jnlp which tells a program called "Java Web Start Application Manager" where the resources, typically a single jar file, are located. Check out
http://java.sun.com/products/javawebstart/
for a nifty demo.
Hope this has been of some help.
Morten Hjerl-Hansen

Similar Messages

  • 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

  • Is it possible to run a java application within a web browser?

    Hello everyone here! I have a question about running a java application within a web browser and I would appreciate it very much if anyone here can give me some answers.
    I have a standalone java application written with AWT. Basically this free application lets users to select spectral lines from a big file based on some criteria and plot those selected lines. Yes, it is a very simple application. Now I want to run this application within a web browser so that users don't need to download the application from the ftp site and thus don't need to install in their machine. Is it possible to run this application within browser? If yes, can we get the same plotting function as we run the application separately and where should I start out?
    Thanks in advance!
    kuilian

    Please see the signed applet discussion group for details of how to avoid the applet security restrictions. You can sign the applet, or use the policy file containing {AllPermission} for testing purposes (though not suitable for widespread deployment).
    Regards
    Matthew

  • Running a Java application from a Swing GUI

    Hi,
    I was wondering if there is a simple way to run a Java application from a GUI built with Swing. I would presume there would be, because the Swing GUI is a Java application itself, technically.
    So, I want a user to click a button on my GUI, and then have another Java application, which is in the same package with the same classpaths and stuff, run.
    Is there a simple way to do this? Do any tutorials exist on this? If someone could give me any advice, or even a simple "yes this is possible, and it is simple" or "this is possible, but difficult" or "no this is not possible" answer, I would appreciate it. If anyone needs more information, I'll be happy to provide it.
    Thanks,
    Dan

    I don't know if it is possible to run the main method from another Java app by simply calling it...
    But you could just copy and paste the stuff from your main method into a new static method called something like runDBQuery and have all the execution run from there.
    How does that sound? Is it possible?
    What I'm suggeting is:
    Original
    public class DBQuery{
    public static void methodA(){
    public static void doQuery(){
    methodA();
    public static void main(String[] args){
    // Your method calls
    //Your initializing
    doQuery();
    }Revised:
    public class DBQuery{
    public static void methodA(){
    public static void doQuery(){
    methodA();
    public static void doMyQuery(){
    // Your method calls
    //Your initializing
    doQuery();
    // No main needed!!
    //public static void main(String[] args){
    // Your method calls
    //doQuery();
    //}

  • Running a java program from a .asp page

    i'm looking for someone in the community that knows how to run a java program
    on a web server ( not an applet) from a asp page. The server as IIS 5 and the jre1.3.1
    any help or tips would be welcomed

    The following site explains in detail how you have to do it. I have done it and it works fine.
    If u still have problems, contact me at [email protected]
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;q167941

  • Running a java application from a java application

    hello ,
    please who knows how i can run a java application 'B' from inside another java application 'A' and get the error messages (if any) from the application 'B'

    how are you executing application B from application A? Please explain the java code you are using?

  • 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

  • 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

  • Passing username and password to Forms Application from a web page

    Hi,
    I have a web application where the user needs to login and browse some web pages.One of the links on this page
    calls a forms application. How do I pass the userid and password from the web application to the forms application
    so that the user doesnot need to login once again.
    Thanks,
    Vikram

    I have one problem with that. The password of the user
    should not show up in the URL or the user should not be
    allowed to view the password by clicking on
    "View Source" on the browser.
    How can I call the forms application in such a way so that the user password doesnot show up?
    Thanks for your reply.
    -Vik

  • Error when running "Run as" Java application from NWDS

    Dear All,
    I am trying to run the following .java proggie...
    Thanks for that. By the way, I am now trying to compile the following .java program.....
    Created on 01-Oct-2007
    To change the template for this generated file go to
    Window>Preferences>Java>Code Generation>Code and Comments
    @author chris.jackson
    To change the template for this generated type comment go to
    Window>Preferences>Java>Code Generation>Code and Comments
    import com.sap.lcr.api.cimclient.CIMClient;
    import com.sap.lcr.api.cimclient.CIMClientHandle;
    import com.sap.lcr.api.cimclient.CIMOMClient;
    import com.sap.lcr.api.cimclient.ClientFactory;
    import com.sap.lcr.api.sapmodel.SAP_AppServJCODestination;
    import com.sap.lcr.api.sapmodel.SAP_JCODestination;
    import com.sap.lcr.api.sapmodel.SAP_JCODestinationAccessor;
    import com.sap.lcr.api.sapmodel.SAP_MsgServJCODestination;
    import com.sap.mw.jco.JCO;
    import com.tssap.dtr.client.lib.protocol.URL;
    public class sldpoke {
    public void main() {
    ClientFactory factory = ClientFactory.newInstance();
    try {
    final URL url = new URL("http://ex1d002a.eu.unilever.com:58300/sld/cimom");
    String sldUsername = "cjacks01";
    String sldPassword = "password";
    CIMOMClient cimomClient = factory.createClient (url, sldUsername, sldPassword);
    CIMClient cc = new CIMClient(cimomClient);
    CIMClientHandle cch = (CIMClientHandle) cc;
    SAP_JCODestinationAccessor jcoAccessor = new SAP_JCODestinationAccessor(cc);
    SAP_JCODestination[] jcoDestinations = jcoAccessor.enumerateSAP_JCODestinationInstances();
    JCO.Client jcoClient = null;
    String user = null;
    String pwd = null;
    // iterate over all destinations
    for (int i = 0; i < jcoDestinations.length; i++)
    SAP_JCODestination jcoDestination = jcoDestinations;
    user = jcoDestination.getLogonUser();
    pwd = jcoDestination.getLogonPwd();
    if (jcoDestination instanceof SAP_AppServJCODestination)
    SAP_AppServJCODestination jcoDest = (SAP_AppServJCODestination) jcoDestination;
    jcoClient = JCO.createClient(jcoDest.getLogonBCClient(),
    user,
    pwd,
    jcoDest.getLogonLanguage(),
    jcoDest.getAppServHost(),
    jcoDest.getAppServNumber());
    else if (jcoDestination instanceof SAP_MsgServJCODestination)
    SAP_MsgServJCODestination jcoDest = (SAP_MsgServJCODestination) jcoDestination;
    jcoClient = JCO.createClient(jcoDest.getLogonBCClient(),
    user,
    pwd,
    jcoDest.getLogonLanguage(),
    jcoDest.getMsgServHost(),
    jcoDest.getSAPSystemName(),
    jcoDest.getLogonGroup());
    } catch (Exception e) {
    and I am getting the message "The selection does not contain a main type". The class contains a 'main' function so I am at a loss as to what the problem is. Any ideas how I progress?
    Kind Regards
    Chris Jackson.

    Hi! Jakson,
       to run a Stand-alone Java application, we must have one main() method like...
    public static void main(String args[]){ }
    i can't see this main() method on your appliation.
    regards,
    Mithileshwar

  • Problem Running a java applet from an HTML page

    I can run my applet at the command prompt with:
    appletviewer coffee.html
    But when I try and open the Coffee.html by opening
    the page in Internet Explorer I get the following message:
    Can't find Database driver class: java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver
    Code: createcoffees.java
    import java.applet.*;
    import java.sql.*;
    public class CreateCoffees extends Applet{
         public void init() {
              Statement stmt;
              Connection con;
              try {Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              } catch(java.lang.ClassNotFoundException e) {
                   System.err.print("ClassNotFoundException: ");
                   System.err.println(e.getMessage());
              try {con = DriverManager.getConnection("jdbc:odbc:hq","afm", "afm");
                   stmt = con.createStatement();                                   
                          stmt.executeQuery("SELECT * FROM RM");
                   stmt.close();
                   con.close();
              } catch(SQLException ex) {
                   System.err.println("SQLException: " + ex.getMessage());
    }

    Is your jdbc-odbc driver properly loaded? Its very clear that its a class not found exception which is thrown by this:
    try {Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    } catch(java.lang.ClassNotFoundException e) {
    System.err.print("ClassNotFoundException: ");
    System.err.println(e.getMessage());

  • Running a java application from different directory

    I have the file in my
    c:/Folder/Program.java
    I want to compile and run it from D:/ (drive)i.e from different directory.
    Thanks in advance,
    Praveen.

    javac -cp c:\Folder c:\Folder\Program.java
    java -cp c:\Folder Program

  • 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.

  • Disable Java Security Warning: Allow access to the following application from this web site?

    Dear all,
    When I open web intelligence with BI launchpad, this warning has been shown:
    "The web site is requesting access and control of the Java application shown above. Allow access only if you trust the web site and know that the application is intended to run on this site.
    Allow access to the following application from this web site?"
    and it has just three button of "Yes", "No" and "Help".
    I go to Java Control Panel and Security tab, then set security level on the "Medium" and add my site in the Exception Site List but this warning is shown each time I open web intelligence.
    I have searched the internet very much but I haven't found any solutions for disabling of it. How can I disable this security warning?
    Java version 7 update 67
    windows XP
    SAP BusinessObject BI Platform 4.1 Support Pack 4 Patch 2
    best regards,

    Hello,
    We have the same issue with BI4.1 SP3 FP3.
    Can anyone help us ?
    Nawale.

  • How to gather a set of floating point numbers from a web page form?

    I am pretty new to Java and I am working on a project to apply Benfords law to find the probability of digits submitted by the user. My first step is to gather set of floating point numbers from a web page. How do I go about doing this? Any suggestion or a proper site where I can learn this stuff will be highly appreciated.

    I am using NetBeans IDE 5.5.1 and for this project. I have realized that the first question was not well phrased.
    I created a web project with 2 jsp files and a class file in it. When my jsp file runs I ask the user to enter a number for finding the probablility based on Benfords law.
    This is what I got so far:
    This is input.jsp
    <h1></h1>
    Please enter a number to be checked
    <form action="result.jsp" method="post">
    <input type="number" name="number" >
    <input type="submit" value="Check number">
    </form>
    </body>
    </html>
    This is result.jsp
    String number=request.getParameter("number");

Maybe you are looking for

  • My iCal on my computer can ot access my iCloud calendar

    whe my iCal calendar on my computer attempts to get info from the cloud I get a msg. that it can not be done.  I need to check email address and password. I have deleted accounts and re started accounts with email addresses and the password but it do

  • Mail - RSS feed

    Is there a way to prevent getting constant RSS message from Apple? There seems to be no option to check for RSS "Never" or remove messages "Immediately"

  • Mac Mini Intel Snow leopard often dies during sleep. What to do next?

    During sleep the screen goes blank on a light grey color and I can only shut down using the power button. I am using an apple blue tooth keyboard and a logitech USB remote mouse. I have run Disk Repair w Utilities and also the MUG has tried Disk Warr

  • Forms 1Og and  Mainframe Db2 tables

    We are in the process of Migrating from Forms 6i to 10g We are facing the an issue while compiling forms which have statments like Insert/Update/select from DB2 tables. In the Oracle 10g DB we have configured these as public synonyms and when we are

  • Can't buy HD movies in iTunes from Mac Mini

    I wanted to buy a movie for my Disney Anywhere collection. I only want HD. I bought one a couple of weeks ago, no problem. Now when I try to, it goes the purchase process, but then before I actually pay, I get a prompt that I can't play HD on my Mini