Run java program from start menu

Does anyone know how to write a class so that when a user is running my program for the first time they can run an installation file that will put a shortcut to my bat file in the start menu.Know of any place i can get info on setting up an installation class or something similar.
If you could give me some info would greatly appreciate it,it's my first time doing anything this big and not really sure where to start with writing an installation file

If your program is just for windows then giving the user an exe instead of a .bat file will help.
http://www.rolemaker.dk/nonRoleMaker/javalauncher/marner_java_launcher.htm
Your user will either need to have a JVM installed on their machine or you will need to provide one with the application. If you intend to provide one, the licence doesn't allow you to install it on to the target machine, but you can place the java dir in your directory structure and access the java/javaw command by a relative path (see the help on the above site for that)
Once you have a directory structure set up for your application, you can use any comercial intall program to give give you a setup.exe file or whatever. if you are providing the VM with your distribution, then the file will at least 14MB plus your class and resource files. If you read the licence agreement for distributing the VM, it tell you what files can and can't be removed from it to make the file a bit smaller. For instance, you can remove webstart because you won't be using that.
search http://www.download.com/ for installers. I think there are a few ad supported ones if you don't want to pay

Similar Messages

  • How to run java program from website?

    Hello
    I'd like to know how to run java program from my web page.
    I'd like to push some button in this web page so java program that would be on my server
    would pop-up. Can it be done automaticaly upon running this web site? (without any buttons - I just enter website and program pops up).
    Cheers

    I rather thought about RMI. But I could try servlets. So how it would look like?.
    I would make http request in browser (enter address) and program would show up in its window?. And I would not have to change anything in my program?. This program would run then on both boxes?. One remotely and one not?.
    But I would have to learn some basics, I've never worked with servlets. Could you suggest some good sites about it?. With ready examples so I could tweak them to my purpose.
    Message was edited by:
    macmacmac

  • How to run java programs from a master java program?

    Hello,
    I have several java programs which run from the command prompt. I am seeking help with code for starting java programs from within a java program. For example, a program called master.java works something like this:
    import java.*;
    create connection pool
    create variables and result sets
    start/run slave1.java (var1, var2);
    start/run slave2.java (var3, var4, var5);
    start/run slave3.java (var1, var4);
    end of program master.java
    Each of the slave.java programs will run for up to an hour. I do not want the master.java program to pause for each slave program to stop. Instead, the master program will keep running and multiple slave programs will be running simultaneously with the master program. When a slave program starts, it is on its own. Also, if possible, I would like to have each of these slave.java programs open in a new separate command window, so I can observe each slave program running in separate windows.
    Any suggestions for code or helpful documentation are greatly appreciated.
    Thank you,
    Logan

    Thank you all.
    At the bottom of master.java I have successfully started a batch file with these lines:
    String jcmd = "cmd.exe /c start c:/data/simulations/MsgViewCount2.bat";
    Process proc = Runtime.getRuntime().exec(jcmd);
    But I still cannot get a java program to start. Here is one variation I have tried:
    String [] cmdArray = new String[2];
    cmdArray[0] = "java";
    cmdArray[1] = "slave1";
    Runtime runtime = Runtime.getRuntime();
    Process process = runtime.exec(cmdArray);
    This compiles, and no errors occur, but nothing happens.
    Regarding this comment:
    Why Runtime.exec? Either make the slaves Runnable or
    just call their main() methods.
    Oh, I see. Sepearate output. :PNone of the slave.java programs have any output.
    Thanks again.

  • Running java program from DOS

    I have just installed JDK 5.0 (update 4) and have tried writing a small demo program. The .class module is created ok but when invoking java I get "Exception in thread "main" java.lang.NoClassDefFoundError. I am running java from a DOS batch file with one command of c:\progra~1\java\jdk15~1.0_0\java %1. A similar batch file is used to invoke javac which works.
    Any ideas what I'm doing wrong? Thanks.

    You can't run a Java program from DOS, in fact you can't even install a JRE under that old operating system as Java requires a 32 bit or 64 bit operating system architecture which DOS never offered.
    But on the off chance you mean a command prompt from Windows...
    Check your classpath, most likely you forgot to add the current directory to that.

  • Remove program from start menu

    I want to remove Dropbox AND iCloud from my start menu - they slow up the process and I don't use them all the time. Can any one tell me how? thanks

    System Preferences->Accounts->username->Login Items and remove what you don't want running at boot time. As for the iCloud account, I don't use it, so you'll have to figure that one out on your own.
    27" i7 iMac (Mid 2011) refurb, OS X Yo (10.10), Mavs, ML & SL, G4 450 MP w/10.5 & 9.2.2

  • How to run concurrent program from a menu

    Hello, I have a responsibility menu and want to enable the user to run a concurrent request by clicking on a menu function. Say I have a prompt called "Payslip Report", clicking on it will now run a concurrent program called "Payslip Report" but the user will now have to enter the parameters for the report.
    How do I achieve this?

    Hi
    You can achieve this defining a new function for the standard submissions form with parameters to specifically launch the payslip report, and even specify values for its parameters. Information can be found on System Administrator Guide under the "Customizing the Submit Requests Window" topic. The steps would be:
    - Create a new function using the Standard Request Submission Form (FNDSRS)
    Give it a meaningful name such as Launch Payslip Report, specify form as type and the user form name of the FNDSRS form
    Use the following parameters, specifying as values the short name of the payslip report and the application it belongs to:
    CONCURRENT_PROGRAM_NAME=PAYSLREP PROGRAM_APPL_SHORT_NAME=PAY
    - Use your new function in Your menu and assign the prompt "Payslip Report"

  • Running Java program from script shell using SSH

    Hello!
    I have this problem: I need to run a java command like: java Prog arg1 arg2 arg3 on i machines, using a shell script.
    First of all, I'm trying to make it work for a single machine. But the problem is when I write the line << ssh user@localhost "java -classpath /a/b/ Prog arg1 arg2 arg3" >> and run the script, it is not able to execute the entire line. Is there a special options for the arguments of my Prog class? I want to mention that between my arguments there is another text file which is read by the Prog and when i run the script says it cannot find that file; Please any ideas for not remain stuck here?
    Thank You in advance!

    Hello! Thank you for being so helpful..
    The part with << is not existent in my script, I've put it just here for quotation.Sorry
    So, from the terminal under Linux I run the command like this: I go to my folder where I have all my .java Classes and I execute the command java Prog arg1 arg2 arg3 . Where arg1...arg3 are arguments which are read from the terminal and then used in my Prog. One of the arguments is a text file, from which Prog.java reads line by line it's content. How can I run the same thing , under a script using SSH? This is basically my question, taking into consideration what I've written in my first post.

  • Can't run Java Programs from home computer

    Hi, sorry if this is a simple problem.
    I downloaded Java version 1.4.0_03 but can't get it to work. I have configured the PATH variable and the CLASSPATH but it isn't working.
    If I type java -version the right stuff comes up.... so where have I gone wrong?
    Any ideas much appreciated
    Thanks
    cat

    I downloaded JDK
    this is whats in the PATH variable:
    ;C:\Program Files\Java\j2re1.4.0_03\bin
    and in the CLASSPATH:
    .;C:\Program Files\PhotoDeluxe HE 3.0\AdobeConnectables;C:\Program Files\Java\j2re1.4.0_03\lib\tools.jar

  • How to Set up the  variables and others to compile and Run Java Programs

    Hello,
    I have just downloaded the jdk1.6.0_07 and jre1.6.0_07 and installed it in C:\Program files\Java in my Windows XP ,So please tell me how to sett up the enviroment variables etc to compile and run Java Programs from Command Prompt.
    thanks

    To set the PATH permanently, add the full path of the jdk1.6.0_<version>\bin directory to the PATH variable. Typically this full path looks something like C:\Program Files\Java\jdk1.6.0_<version>\bin. Set the PATH as follows on Microsoft Windows:
    1. Click Start > Control Panel > System on Windows XP or Start > Settings > Control Panel > System on Windows 2000.
    2. Click Advanced > Environment Variables.
    3. Add the location of bin folder of JDK installation for PATH in User Variables and System Variables. A typical value for PATH is:
    C:\Program Files\Java\jdk1.6.0_<version>\bin

  • Can i call java program from VC++ code...... Urgent!

    hi,
    I have VC++ code.
    I want to run java program from VC++ (SDK).
    Can I call it?
    plz help it's urgent....
    thanks in advance...

    We do it all the time using the JNI invocation API (this is actually how the java.exe application works).
    Here's a tutorial I just found (not sure how good it is, but it should get you going):
    http://www.inonit.com/cygwin/jni/invocationApi/
    One note: If you are going to be invoking the JVM from different threads in your native app, there is some special handling you will have to do - the above tutorial doesn't address this scenario (a dig through the JNI docs should help with that one, though).
    Cheers,
    - K

  • Running a java program from an icon

    I want to run my program from an icon on my desktop. I have a .bat file that I've built a shortcut to and it works.MY GUI program does display and run when I click on the icon. The problem is that the DOS window also shows up behind my GUI.
    Is there anyway to prevent the DOS window from showing? Or is there another way to run a Java program without resorting to a DOS command line or running it through FORTE or another IDD?

    Chris's solution worked well, with one small problem. Once my GUI starts, it takes up the whole screen. Normally when I run it, it appears as a small window.
    not a big problem, I can reduce it easily after it starts. But does anyone know a way to make it come up in the reduced size it norally comes up in when I run it from my IDE?

  • URGENT: How to run a Java program from a different directory?

    Hi.
    How do I run a Java program from a directory that the file is not located in? So lets say im in c:\Java. But the file is in c:\Java\abc\efg\.
    What would be the command to run the Java file from c:\Java.
    I can't remember it and I need it asap.
    Cheers.

    If the class you are trying to run is MyApp.class, try
    c:\Java\>java -cp abc\efg MyAppThe actual classpath you specify will depend on whether or not MyApp.class is in a package (I've assumed it isn't) and whether or not any 3rd party jars are involbed (I've assumed not).
    Edited by: pbrockway2 on Apr 1, 2008 6:42 PM
    The command arguments read as "Run the MyApp class using as a classpath abc\efg relative to here (c:\Java)".

  • Can we run EXE file/ Another Java Program from Java Application? How?

    Can we run EXE file and another java program from java application?
    Thanks in advance

    Example running adobe acrobat
    String command = "C:\\Program Files\\Adobe\\Acrobat 5.0\\Reader\\AcroRd32.exe /t "+selectedDocument+" \\\\CONTROL\\HP LaserJet 4L";
    Runtime rn = Runtime.getRuntime();
    Process process = rn.exec(command);
    process.waitFor();rykk

  • Running a program from Java

    how do i launch one Java program from another?
    both .class files and the JRE directory are in the same directory

    You can use Runtime.exec() to run it as a seperate process, or you can always instantiate your secondary class. Do a search on the term "runtime.exec()" befure you go spawning another thread asking how to use it. That particular subject has been done to death many times already.

  • Run a program from java code

    I want to run this program from my java code,
    In Linux(ubuntu) I write this command to open the program window
    $ paraFoam -case /home/saud/OpenFOAM/OpenFOAM-1.5/run/tutorials/icoFoam/cavity/In my java code I wrote it like this("/home/saud/OpenFOAM/OpenFOAM-1.5/bin/" is the path of the program):
    String command = "/home/saud/OpenFOAM/OpenFOAM-1.5/bin/paraFoam " +
              "-case /home/saud/OpenFOAM/OpenFOAM-1.5/run/tutorials/icoFoam/cavity/";
    final Process myProcess = Runtime.getRuntime().exec(command);
    BufferedReader buf = new BufferedReader(new InputStreamReader(
              myProcess.getInputStream()));
    String line;
    while ((line = buf.readLine()) != null) {
         System.out.print(String.format("%s\t\n", line));
    buf.close();
    int returnCode = myProcess.waitFor();
    System.out.println("Return code = " + returnCode); Return code = 0
    but the program is not opening
    Edited by: Saud.R on Apr 11, 2009 3:37 AM

    Welcome to the Sun forums.
    I am not sure of the answer to your question, but people who use Processes regularly, warn other users to ensure they are also doing something with the error stream of the process, otherwise it can hang as you describe.

Maybe you are looking for