Running java program at windows startup

I need to run java program at startup and then it will continue to run in its own thread.
Any body having idea how to do that programmatically?
Zeeshan

This is one option but this is not feasible in my scenario as this application will be running over a network which involves hundreds of computer so is there any way to do it programatically?
I mean if I can load java class file through an exe file then I can load my class file in the startup using C++.
Any Suggestions.
thanks for the help
regards,
Zeeshan

Similar Messages

  • I want to run java program on windows environment as background process

    Hi all
    I want to run java program on windows environment as background processSo command prompt return after executing java command and program on background In Linux we can do this easily �but I do not how to do this in windows
    for example look this programe
    import java.io.*;
    import java.util.*;
    public class TestClass {
         class ravi extends Thread{
              public void run(){
                   try {    
                        String target_file = "ravind.txt";
                        File targetfile = new File(target_file);
                        PrintWriter writer = new PrintWriter(new FileWriter(targetfile)) ;
                   for (int i =0 ; i < 100 ;i++ ){
                        Thread.sleep(10000);
                        writer.println(" ravindra shukla ");
              } catch (Exception e) {               
                             e.printStackTrace();
         public static void main(String[] args) {
              TestClass test1 = new TestClass();
              TestClass.ravi r1 = test1.new ravi();
              r1.start();          
    System.out.println(" return from main ");
    first i compile this
    javac TestClass.java
    then i run this by using this command
    java TestClass
    but becouse i put sleep on threads run function so it takes to much time to get return on command promt .... i want to run this programe as background process so command promt return as soon as i execute java command

    Thanks dude
    This solution �start java TestClass� works fine �. But it does not solve my problem
    It opens another black window and that black window persist till the life time of my program
    Is it possible application run on complete background without opening another black window �as in Linux

  • Run java program in background

    I want to run a java program in background in windowsXP...can anyone help please......can anyone suggest an easy software for running java program as windows service...i tried one but without any success

    How many of the links here have you tried while you were waiting for an answer?
    http://www.google.com/search?q=running+java+program+as+windows+service
    (Note that the query is a direct copy/paste from your post.)

  • Run java program overnight

    Hey,
    I left my office yesterday evening leaving my macbook on
    while it was running a java program that it's supposed to requires between 2 and 3 hrs.
    This morning not only the program was still running (hard to believe it takes more than 12 hrs!)
    but when I typed in the shell the 'ps -all' command
    it says the program has been running for around 30 mins, and now it's still running!
    Is it possible that with certain settings the mac stops its processes after a while?
    What should I check?
    Thanks for helping, I'm actually a newbie in the mac world:)
    g

    How many of the links here have you tried while you were waiting for an answer?
    http://www.google.com/search?q=running+java+program+as+windows+service
    (Note that the query is a direct copy/paste from your post.)

  • How to run a java program in windows 2003 server from unix server.

    Hi ,
    I want to run a java program in windows 2003 server from unix machine ..
    will RMI helps me to obtain this.
    Please tell me the procedure to do this.
    Thanks in advance,

    rmi,web services,corba,web 2.0,xml,xls,dtd,rss,ruby on rails,https,soap,tags,blog,podcast,google

  • Vim and Eclim (Java): Run Java program in embedded terminal window

    Hello all,
    I'm trying to create a decent Vim setup for Java programming. I've installed Eclim, and it works alright. However, one annoyance I have is the way that Eclim runs Java programs. When run (via the :Java command in Vim), a Java program runs in a new shell instance pretty independent from Vim, and then when the program terminates (and Enter is pressed), the output is put into a new buffer at the bottom of the Vim window with the output.
    The problem with this is that I must press Enter to go back to Vim after the program terminates, and then the output buffer is automatically selected even though I most likely do not care to copy any of the output.
    So, this is what I would like to happen:
    - I run my Java program somehow (doesn't have to be with :Java)
    - A buffer containing the running program in a shell is put on the screen (if not already there)
    - The program terminates, and the focus did not change to the output buffer
    At the very least, I want the focus to not change to the output buffer after the program is done running.
    Any ways to at least somewhat accomplish what I'm trying to  get at?

    Trent wrote:
    Yeah? I had AP CS when they first introduced the GridWorld case study. I hope you get more out of the class than I did.
    I have never used Java except for that and my first CS class at university. I eventually realized that software (as a job) wasn't for me and took a route closer to EE. I still fight to avoid being called a programmer though
    I like the idea of programming for a job, not necessarily "software development", something computer science-y sound good to me.
    But anyway, to end on an on-topic note, I embedded gvim inside Eclipse as described here.

  • Could not able to RUN Java Programs in JRE 1.5.08

    hi
    I am using Jdk 1.5.8.
    I don�t have any problem in compiling the files.
    but i could not able to run the program through windows cmd prompt.
    Say name of the java file is newFile (no packages).
    When i try to run the program by using java newFile it raises a ClassNotFoundException.
    it s the same case when try to set any JDBC drivers ..
    is there any problem in my class path settings? Please help me out to fix this problem

    if your current directory is not in the classpath,you should include it in the classpath.
    To do that you can include .(dot) to your classpath variable.
    http://java.sun.com/j2se/1.3/docs/tooldocs/win32/classpath.html

  • How do i monitor performance in the system of a Java program in Windows XP?

    I want to record the CPU usage and Memory usage on an hourly basis programatically, for an already running java class in Windows XP environment for the purpose of testing the Java class. The recording has to be done independent of the java class.By Cpu usage and Memory usage , i need to know how much of the computer's memory and CPU has been used by the java class.
    I tried the HPROF tool available with J2SE 5.0, but it gives the details of each of the functions' usage in the program's allocated space in memory. moreover, it is not independent of the execution of the class.
    The other option is to make use of the Performance tool available in Windows Xp->Administrative tools. This is a complex procedure, and i am not sure of how to proceed in this direction.

    You can use the windows performance monitor (perfmon.exe / perfmon.msc). I don't know wther it is also included in the XP Home Edition. But this is the tool you are looking for. It can display the information in realtime but also can write to a protocoll.
    Here's a shor description of what to do (i have a german windows so i'm more or less guessing the english terms)
    - Start perfmon.msc
    - In the tree on the you can see "systemonitor" (the realtime display) and "performance protocolls and warnings"
    - open "performance protocalls and warnings", the first sub element should be something like"performance protocalls" or "performance indicator"
    - open the context menu for it and create a new protocoll settings.
    - add the information to it you are interested in and make other changes if you want
    - start the new configuration
    once you have the information you can display it it in the systemmonitor by selecting "display information from protocal" from the toolbar
    It will take some time till you know what you are doing (and most of the information the performance monitor is useless to 99% of the people). But its a quite usfull tool once you know how to use it

  • How to start java.exe from a java program in windows ?

    Hi,
    I did like to know, if its possible to run java.exe from a java program on windows ? The java.exe should be visible from checking the processes that are currently running using the Task Manager on windows.

    Runtime.getRuntime().exec("java Sample");

  • Opening a Word Document with a Java program in Windows

    When running a Java program in Windows, is it possible to have a button where when it is clicked it will open a Word document?
    If so, is it hard and can someone tell me how to do it??
    Thanks

    try this instead of Excel.exe you have to use Word.exe
    1. Declare your button
                   JButton butexlcom = new JButton("Carnet Offre");
                   butexlcom.addActionListener( new ButExlCommercial(msgout));
                   butexlcom.setBounds(215,510,110,30);
                   c.add( butexlcom );
    2. run your word document.
    class ButExlCommercial implements ActionListener {
         private JTextArea msgout;
         public ButExlCommercial( JTextArea msg) {
         msgout = msg;
         public void actionPerformed( ActionEvent e ) {
              try {
                   Runtime.getRuntime().exec("c:\\Program Files\\Microsoft Office\\Office\\Excel.exe NameWordDocument");
              catch(Exception en) {
                   msgout.append( "\n*** PROBLEME WORD ***\n" );
    }

  • 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

  • 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 file in windows ?

    How to run .java file in windows without installing any program? Thx!

    First, U must make sure that there is JDK on your computer
    Then, set the envionment variables which the os can find your compiler and interpreter: javac java
    after those, you must complie your .java file to .class file, then you can excute it by java, for example " java helloworld"

  • How to run java program on clients system when system strats

    hi
    I want to run java program on clients computer automatically when system boots up. plzzzzz help me .......

    You can add the call to the java program to the auto start group (under windows).
    You can't start a client program when the server starts, if that is what you mean.
    Timo

  • Running java program as a server

    Please advise of what's difference in running java program with -server option and just runing it like java program1?
    Thx

    -server option uses the server VM for the program and if you use -client it will be run using client VM. Default is client.
    The main difference is the optimations. When you are running with -client option the program is optimized to startup faster and to give better response times.
    -server option optimizes for better resourse management which is important than start up time in server systems

Maybe you are looking for