Launching a java application in another PC

Hello everybody
I want to know what to do if I want to launch a java application in a new PC which has anything installed in it.
Thanks

My problem is that if there is a new PC , nothing installed in it, can I launch a java application in it ?
My friend asked me if I can build an application in java which I can use in any PC and the application will do something like an installation. In fact he wants to know if java can build an installation like application which will install for example a software on a new PC.
I think I told you more clearly the situation.

Similar Messages

  • Launching a java application from another java application

    Hi,
    I'm facing an interesting challenge :-)
    Inside a Java application, I want to start another java application.
    Possible solutions in my list :
    1. Using jakarta commons launcher.
    2. Runtime.exec (make the code platform dependent).
    3. Starting the main method of the other app by create a new Thread inside the current app
    4. I know people did this by calling an ant target from the java application but I don't have
    any sample code, I appreciate any sample code for it.
    Thanks,
    Ali Salehi

    That is an iteresting challenge :)Don't be mean; he's polite, done some investigation and taken the trouble to be clear. The question, presumably, is "has anyone got a different solution or a preference as to which of these is the best?"
    In which case, my advice would be to say that invoking main in a separate thread is fundamentally different from Runtime.exec() because the former would run in the same JVM. Is this what you want? If one app has the other on its classpath then do they need to be separate apps? Could they be modules of a single app?

  • How to launch my java application in a web browser?

    Hi. I try to launch my java application, e.g. "HellowWorld.java", using web browser.
    1. How can I change my java application program to java applet in general way?
    I read "Java: An Introduction to Computer Science and Programming, Third Edition"
    by Walter Savitch and found page 803 - "Converting a Swing application to an applet".
    My question is how I can know which class should be removed or not such as using JApplet instead of JFrame. Are there general rules about this?
    2. I found "AWT only" tutorial had some example lauching application using "AppletButton".
    How can I use this method to launch "HelloWorld.class"?
    http://java.sun.com/docs/books/tutorial/information/download.html#OLDui
    (after extracting zip file) -> ../OLDui/layout/card.html
    3. (continued 2) Can I use above method to embed applet into web browser?
    For example, java Swing application -> applet using "AppletButton" -> web browser using "<applet></applet>" tag.
    I'd appreciate any partial anwers of these questions or other suggestions.
    Thanks.

    Thanks! Here is what I got from your help.
    * HelloWorldSwing.java is a 1.4 example that
    * requires no other files.
    import javax.swing.*;  
    import java.awt.*;                //for Container class    
    //  public class HelloWorldSwing {
       public class HelloWorldSwingToApplet extends JApplet {
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
    //    private static void createAndShowGUI() {
          private void createAndShowGUI() {
            //Make sure we have nice window decorations.
    //        JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
    //        JFrame frame = new JFrame("HelloWorldSwing");
    //        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         Container frameApplet = getContentPane();
            //Add the ubiquitous "Hello World" label.
            JLabel label = new JLabel("Hello World");
    //        frame.getContentPane().add(label);
         frameApplet.add(label);
            //Display the window.
    //        frame.pack();
    //        frame.setVisible(true);
          public void init() {
           createAndShowGUI();
    /*    public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }

  • Calling Java Application from another

    How can i call a Java Application from another java App.
    eg., If my Java application is called MyApp and i would like call another java application from within it.
    One way could be by using "System". I would like to know if there is any other method and is portable.
    Thanks in advance.

    hi,
    it works and not!
    if you start an other class with a command like this the 2nd prog/class terminates too if you terminate the caller-class!
    dear
    oliver scorp

  • Invoke one java application from another?

    Hello,
    Can anyone tell me how to Invoke one java application from another?
    Suppose I have a small java application say, Hello.java which has its own main() method and
    I also have another java application, say World.java which has its own main() method too.
    What I want to do is invoke or startup World.java from Hello.java.
    If possible kindly give code examples?

    main is just a normal method so Hello can invoke the main method of World just as it would invoke any other method.
    Kaj

  • How to launch a Java application by clicking an icon for the windows system

    Hi Deal All,
    I am new in this forum, I am used to be at Cryptography. Currently I have completed a Java project and I am intending to launch it from Windows.
    I will design an icon but how I can launch the java application by clicking the icon in Windows system.
    Great thanks for your guidence!
    Best,
    Your friend.

    Hi Deal All,
    I am new in this forum, I am used to be at
    Cryptography. Currently I have completed a Java
    project and I am intending to launch it from Windows.
    I will design an icon but how I can launch the java
    application by clicking the icon in Windows system.
    Great thanks for your guidence!
    Best,
    Your friend.Make the icon a shortcut with a target of something like "javaw.exe YouClass.class"

  • Executing Java Application in another machine

    Hi all,
    I am programming a Java application which will eventually run in a different machine. This application uses the Communications API, so I wonder if it is necessary that the destination machine has the javax.comm.property and win32com.dll files installed. In that respect, the target machine will have a certain version of JRE installed, in which folders should I install those files.
    Having said that, I would appreciate if someone could also enumerate good practices to ensure an application will successfully run on different machines
    Regards.

    My problem is that if there is a new PC , nothing installed in it, can I launch a java application in it ?
    My friend asked me if I can build an application in java which I can use in any PC and the application will do something like an installation. In fact he wants to know if java can build an installation like application which will install for example a software on a new PC.
    I think I told you more clearly the situation.

  • To launch a java application in Windows environment

    hello,
    I need to distribute one stand alone application, that I made using NetBeans, for sale it.
    I know that this is not a so simple problem, because delivering the program to one client you cannot simlpy say him to launch the jar file....
    I saw that, in the Windows environment, program like eclipse or netBeans run thruogth an .exe file, that I think is a program that its purpose is to define the java environment for the application in the particular host operative environment .
    Perhaps they are corporations like InstallShield (now Macrovision) that sale programs to solve this type of problems..., and I already used this type of programs to install some my
    applications that I coded in languages different than java.
    But before to look for one of them, I should like have more informations how this problem fits in java language, knowing that java is different to other languages because use JRE and have proper tools, how JWS and JNPL, that concern with this problem.
    ...Looking in the forum I had not much help..., but I saw that someone uses to write launchers program in different language, like C, as well I had not so much detailled instructions about how to do it.
    In order to solve my problem I should like have, from some one that already made it, some general information about how he realized the commercial installation of java applications in the most used Operatve Systems (particullary Windows), and possibly to have links to web sites for good explanations, including advantages to buy apposite commercials installation programs too.
    thank you very much
    tonyMrsangelo

    You can distribute it as an executable JAR so users will run it by double clicking. The would be required to have JRE installed.
    You can distribute it online via WebStart. Users need JRE but it's easier to manage updates and distribution of new versions.
    You can distribute it with AjaxSwing, a product that deploys Swing applications as AJAX websites so you don't need JRE at all.
    You can create EXE files using many of the products available. Google for it and you'll get lots of hits.

  • Cannot launch my java application

    Hi All. I have made a Java application using NetBeans.
    The application, with NetBeans works fine. It imports many jasperreports classes included in my project by setting in the project properties the Compiling source to the various jar archives:
    jasperreports.jar
    common-digester-1.7.jar
    common-collections-2.1.jar
    common-logging-1.0.2.jar
    common-beanutils-1.5.jar
    When I launch with NB it works as I designed it.
    And now comes the problem.
    With NB I build the project and it builds my PrintReport.jar.
    As I try to launch it with
    - java -jar PrintReport.jar
    it prompts this error:
    Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/jasperreports/engine/JRDataSource at printreport.PrintReport.main(PrintReport.java:45)
    that line is exactly where I create the instance of the class containing all JasperReports refs.
    Can anyone help me launch it correctly from command line?
    Thanks, Angyel

    I tried same thing but it is not working for me. It is not refering the Classpath which I specified in Mainfest file.
    Manifest-Version: 1.0
    Class-Path: jaxrpc.jar activation.jar axis.jar commons-logging-api.jar discovery.jar mail.jar saaj.jar soap.jar wsdl.jar
    Main-Class: Uploader
    Ant-Version: Apache Ant 1.6.2
    Created-By: 1.5.0_05 (Sun Microsystems Inc.)I have Upload.jar
    First Time - I have added only class files and then tried
    Second Time - I have added class files and jar files then
    still i am getting this error..
    java -jar Upload.jar
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: j
    avax/xml/rpc/Service
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
    4)
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
            at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:195)

  • How to launch a java application from Microsoft SQL Server

    Hi everyone
    I noticed the following line in a trigger will launch an executable.
    EXEC master..xp_cmdshell '"C:\Program Files\SkillSets.exe"', NO_OUTPUT
    Does anyone know if this same statement will launch a java program? Or does anyone have any positive experience with that ?

    yes...
    check this basic example:
    public class GoodWindowsExec{
    public static void main(String args[]){
    if (args.length < 1){
    System.out.println("USAGE: java GoodWindowsExec <cmd>");
    System.exit(1);
    try{           
    String osName = System.getProperty("os.name" );
    String[] cmd = new String[3];
    if( osName.equals( "Windows NT" ) ){
    cmd[0] = "cmd.exe" ;
    cmd[1] = "/C" ;
    cmd[2] = args[0];
    }else if( osName.equals( "Windows 95" ) ){
    cmd[0] = "command.com" ;
    cmd[1] = "/C" ;
    cmd[2] = args[0];
    Runtime rt = Runtime.getRuntime();
    System.out.println("Execing " + cmd[0] + " " + cmd[1]
    + " " + cmd[2]);
    Process proc = rt.exec(cmd);
    // any error message?
    StreamGobbler errorGobbler = new
    StreamGobbler(proc.getErrorStream(), "ERROR");
    // any output?
    StreamGobbler outputGobbler = new
    StreamGobbler(proc.getInputStream(), "OUTPUT");
    // kick them off
    errorGobbler.start();
    outputGobbler.start();
    // any error???
    int exitVal = proc.waitFor();
    System.out.println("ExitValue: " + exitVal);
    } catch (Throwable t)
    t.printStackTrace();

  • JNI launching a java application

    Being a java newb, a lot of the JNI code confuses me.
    I have a java application that I wish to run through a JNI wrapper.
    What is the most simple C++ code that will enable me to do so.
    Also most of the code posted for doing this uses various header files. Where can one find these header files, and also which compiler is needed for compiling the wrapper. I assume Gpp or similar - is this assumption correct?

    When using both of those examples I get numerous compiler errors - using the sun invocation api example;
    #include <jni.h>       /* where everything is defined */
        JavaVM *jvm;       /* denotes a Java VM */
        JNIEnv *env;       /* pointer to native method interface */
        JavaVMInitArgs vm_args; /* JDK/JRE 6 VM initialization arguments */
        JavaVMOption* options = new JavaVMOption[1];
        options[0].optionString = "-Djava.class.path=/usr/lib/java";
        vm_args.version = JNI_VERSION_1_6;
        vm_args.nOptions = 1;
        vm_args.options = options;
        vm_args.ignoreUnrecognized = false;
        /* load and initialize a Java VM, return a JNI interface
         * pointer in env */
        JNI_CreateJavaVM(&jvm, &env, &vm_args);
        delete options;
        /* invoke the Main.test method using the JNI */
        jclass cls = env->FindClass("Main");
        jmethodID mid = env->GetStaticMethodID(cls, "test", "(I)V");
        env->CallStaticVoidMethod(cls, mid, 100);
        /* We are done. */
        jvm->DestroyJavaVM();and I get the following errors:
    Compiler: Default compiler
    Building Makefile: "C:\Program Files\Dev-Cpp\Makefile.win"
    Executing make...
    make.exe -f "C:\Program Files\Dev-Cpp\Makefile.win" all
    g++.exe -c ../../package/vocab.cpp -o ../../package/vocab.o -I"C:/Program Files/Dev-Cpp/include/c++" -I"C:/Program Files/Dev-Cpp/include/c++/mingw32" -I"C:/Program Files/Dev-Cpp/include/c++/backward" -I"C:/Program Files/Dev-Cpp/include" -I"C:/Program FIles/Java/jdk1.6.0/include/win32" -I"C:/Program FIles/Java/jdk1.6.0/include"
    ../../package/vocab.cpp:7: syntax error before `.' token
    ../../package/vocab.cpp:8: syntax error before `.' token
    ../../package/vocab.cpp:9: syntax error before `.' token
    ../../package/vocab.cpp:10: syntax error before `.' token
    ../../package/vocab.cpp:11: syntax error before `.' token
    ../../package/vocab.cpp:14: ISO C++ forbids declaration of `JNI_CreateJavaVM'
    with no type
    ../../package/vocab.cpp:14: `int JNI_CreateJavaVM' redeclared as different kind
    of symbol
    C:/Program FIles/Java/jdk1.6.0/include/jni.h:1920: previous declaration of `
    jint JNI_CreateJavaVM(JavaVM**, void**, void*)'
    ../../package/vocab.cpp:14: initializer list being treated as compound
    expression
    ../../package/vocab.cpp:14: invalid conversion from `JavaVMInitArgs*' to `int'
    ../../package/vocab.cpp:15: parse error before `delete'
    ../../package/vocab.cpp:19: syntax error before `->' token
    ../../package/vocab.cpp:21: syntax error before `->' token
    make.exe: *** [../../package/vocab.o] Error 1
    Execution terminated
    That is compiling using dev-C++ and I think the mingw compiler...

  • Calling a java application from another

    Hello,
    i have noticed a strange behaviour of my java app when i open it from another java app. When i run the core application with a bat file using jre1.6 everything works fine. Now what i want to do is create an application that checks the existance of jre 1.6, downloads it if it does not exist and run real application with the new jre. The second small app runs with a small jre 1.4.2. In reality it seem to work fine, it downloads the jre1.6 folder and exits normally. However when the real application is launched it behaves strangely without throwing any exceptions. And this behaviour seems to be random. for example, a jpanel may not show any components, or the whole jframe may close suddenly. Does anyone have any idea what is going on? Is there a chance that some classes of the first jre remain in memory and conflict when the second application is launched?

    Just a wild guess: maybe you're invoking the java 1.6 binaries, but JAVA_HOME or something is pointing to java 1.4 libraries (or vice-versa), and you've found some weird interaction issue.

  • How can I Launch a Java application that I have written using an icon

    I have just finished writing a Messaging system like Ms Outlook written completey in Java. To run my application , I would normaly type: java and then the class containing the main method eg java LogonFrame.
    How can I launch my application by just clicking on an icon ?.
    How can I also package and install this application the way most conventional application are packaged and installed. Do we have a sort of "java Installer" ?.
    Thank you.

    Just make a .bat file. Open notepad, type something like
    @echo off
    javaw -classpath %~d0%~p0 Package.MainClass %1
    Now make a shortcut to this file. Rightclick the shortcut and select start in "minimized". Thats it...
    Nille

  • Cannot launch an java application

    Hi there,
    I'm trying to run a java program after updating to Yosemite. I already downloaded and installed the latest JRE 8 update 25. Trying to run the application results in the following console error (nothing happens on the screen):
    20/10/14 21:32:56,584 com.apple.xpc.launchd[1]: (jclient.LoginFrame.63932[1450]) Service exited with abnormal code: 127
    Can someone please help!

    Hmm, only way I know would be a relatively painless Archive & Install, which gives you a new/old OS, but can preserve all your files, pics, music, settings, etc., as long as you have plenty of free disk space and no Disk corruption, and is relatively quick & painless...
    http://docs.info.apple.com/article.html?artnum=107120
    Just be sure to select Preserve Users & Settings.

  • Start java application from another programm

    Hi everyboda on this side,
    i got a big problem. I would like to start out of MS excel an java programm and I would like to hand over data from the MSexcel programm to the java programm. I hope someone can help me. My idea was to create a batchfile, which I start from the excel-programm to run the java programm, but how do I hand over the data from excel to java?
    In advance thanks to all the ones, who tried to help me - max

    You could try to use a JDBC-ODBC bridge that allows you read the data of your excel file.....
    Here, a guide for use it:
    http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/bridge.doc.html
    Hope this helps.

Maybe you are looking for

  • Send output to a device

    I have an application (test.jar) built to read keys and return its code. The app. runs fine, if I run it from Windows or UNIX. I need to test this app with an external device. Say electronic Time Clocks. It has Linux OS built-in and I could successfu

  • Preloader in flex

    hi     i want to use a preloader in flex.please help me if anyone know the answer                                                                            regards

  • Spotlight stoped working after 3 days

    After installing and being happy with Mac OS X v10.5 Leopard 3 days later for no reason Spotlight just stopped working. I enter a search and I get no results back. As if my drive has nothing on it. I tried the preferences pane and didn't see any sett

  • Print in laserjet Problems

    Hi all, I'm facing problems printing some forms in SAP ECC 6.0. When we try to print in a local printer, via SAPLPD, the form is printed in a normal way, but when we choose a printer in the type device list (that is linked to the same printer), the p

  • Is iTunes version 11.3.0 compatible with windows 8 64 bit

    If so, how can I transfer music files from my computer download to iTunes library? Why only "order from iTunes" can be access not the "browse from media"?