Starting a java program on System boot/startup

Hi,
I am trying to find out how to start a java program on system startup which basically spawns a Thread which in turn does some processing.
Came across windows specific options which help one make it as a service.Making a .bat for windows and .sh for linux could be a option but not sure where to put these in respective OS or whether it is a good option.
If someone has tried out similar thing please let me know the details for the same.
Regards
Raj

[codes]
in command prompt
type edit startupor somename.bat
then type
cd C:\Program Files\Java\jdk1.5.0_01\bin
javac data1.java
java data1
and save
[codes]
copy startup.bat file
and click on start-->programs--> startup(rigthclick and open)
then paste that file into that folder...
now you ll get that file opened whenever system boots.
reply if this was usefull;)

Similar Messages

  • How to start a java program as a start-up service in Linux?

    i sucessfully started a java program by adding a script to /etc/init.d,
    but in the script, i have to type the full path of the java laucher, the environment variables are not loaded on startup, what should be done to avoid the full path in the script? Any one has a similiar experience or got a solution to share?

    I'm replying to myself .... ;-) ahah
    All we need for this purpose is JavaService, at link
    http://www.alexandriasc.com/software/JavaService/index.html

  • ASP code to start a Java program (with parameters)

    Hi! All,
    I am trying to write some ASP code which should start a java program. Does anybody know a simple way to do this? Am new to ASP
    Thanks

    It doesn't have anything to do with java.
    Basically you need to make a system call which will start an external application. The external application can be anything including something like "java MyClass".
    So either find an ASP forum/board/newsgroup to ask how to do a system call or read some docs on it.

  • How do you start a java program with more RAM alloaction

    Hi
    can anyone please tell me how to start a java program to start with lots of RAM (RAM size is sent as a parameter), I have seen it somewhere and now I cant remember it. I have a server application to run this way.
    thanks and rgds
    sunil

    see the tooldocs of java: http://java.sun.com/j2se/1.4/docs/tooldocs/tools.html

  • Using a sql trigger to start a java program

    I want 2 create a trigger on an update to a table in SQL Server, that will start a java program, is this possible?
    and if so, how do I do this...?
    thanks

    tried something similar but not exactly, should work though. in the update trigger, in databases such as 8i onwards, use a java stored procedure to code an RMI client that calls the server. implement the server as Activatable and it should start up.

  • To run a java program on windows xp startup

    hi ,
    i have a sample HelloWorld.java program.
    i wrote a batch file to run this program as follows:
    set PATH=%PATH%;C:\Program Files\Java\jre1.6.0\bin;
    cd c:\test
    java HelloWorld
    This program runs when i click on the bat file.
    Next i add this batch file to registry to auto-start on windows startup
    However, on windows startup, i get the following:
    Exception in thread "main" java.lang.NoClassDefFoundError
    Anyone can help me? Thank you in advance!

    Hi Sergi,
    Thanks for the info. I couldn't able to login because of my internet connection.
    Thanks,
    --Srini                                                                                                                                                                                                                           

  • How to start a java program on another machine from one on my machine.

    During the next few weeks, I will be designing a grid computing system for a research project I am working on. The grid will be written entirely in java using java 2 SE. The question I have is, is there a way for the main program to remotely start the other programs on the other machines? I am very familiar with most networking concepts, but java is not my primary language so I was having trouble tracking down this feature if java even has it. Any suggestions you have would be greatly appreciated.
    thanks

    The administrators of each machine have agreed to install my java programs so that I may run my software. Worst case scenario I can have them manually start my program on each machine. The grid is to be the backbone of a very large simulation software to simulate around 18 million ISO shipping containers and the boats and ports they are on. The simulation will be used to test several security system designs. Because of the large scale of the problem, the solution has been decided to be a distributed system so that we can spread the load over a large number of systems. I understand the whole start a service on the other machines concept. I am looking for a way to start an already installed java program with as little human intervention as possible. The service idea will work. What I was looking for more specifically was a way to start the java virtual machine and run my code without having to leave a program running on their machine because like i said earlier they are personal machines. anyways if it is not do able I understand. Like I said, java is a second language and I don't yet know its limits or restraints.

  • Start a java program from an FMB then read and write some variables

    Hello,
    I am trying to see whether the following setup works:
    item A, B, D and Button Z are on a Forms Canvas.
    User clicks on Button Z. This will launch a java program (Myprog class).
    Myprog main will read values in item A and B, run some calculation and then will return it back to our forms module and then will be displayed in item D.
    I have read about PL/SQL wrapper but the way I am looking at my setup is that my Forms module will be just the GUI interface.
    Any ideas ?

    main thing: a JAVA class that will take some inputs and will output some results and messages.
    Prob: I do not want to use swing or any other GUI builder to make a nice GUI for my JAVA class.
    What I want: I know how to use Forms. As such, I just want to put together a quick interface (mymodule.fmb) that when executed will allow the user to click on a button to start the java process and then see the results and error messages.
    Why I don't want to go through SWING: my main prob is to get the java class executed ( which is fine right now thru command line) by other users thru a GUI interface. I do not have time to go thru SWING.
    From the paper I mentioned, I think the PJC is the way to go. Can you please confirm ?
    Thanks.

  • Starting a java program on a ordinary windows computer (without JDK)

    I have made an ordinary java program which reads from a specified text file, changes it a bit and then creates a new file with the new text. This works good when I use a computer with an JDK installed, but I must be able to run this program on a Windows 2000 computer (without any "extras" installed, only the programs that are included in Windows 2000). The reason for this is that I'm not allowed to install programs on this computer. Can anyone help me?

    You neither need to
    1- have a JRE installed on the computer (Java Runtime Environment)
    The Java Virtual Machine to convert the compiled byte code into the necessary instructions for the computer it is running on... W/O it...can't run it.
    2- create a native executable...there are packages etc for which this is true. If you can install NOTHING on the computer... you would either
    A- Find one of the packages that creates .exe files from java or class files
    B- Bundle the JRE with it... it doesn't need to be 'installed' persay-- unpack the directories and create a batch file that calls <path-to-java>/java <path-to-program>myclass
    C- Write it in C or C++
    That is not an inclusive list of possibilities... Java's portability comes with the price-tag of needing something that can run it... once you have that something (and the JRE is fairly ubiquitous, or at least, easy to get if not present generally) ... you can run the program.
    ~Dave

  • Starting a java program from a button

    Hi,
    How can i start another java application (which is saparated from the orginal application) by pressing a button in the main application?
    what should the action be?
    tia,

    TheOtherClass.main(theArgs);Though you might want to create a new thread for that call first.

  • Is there a way to start a JAVA program from the dock?

    Hello,
    I wrote some JAVA applications and I would like to put them in -
    - and start them from - the dock.
    These applications were built into .jar files.
    I can start them from Finder which tells me that there is some .jar starter utility.
    ;JOOP!

    The Dock is for Applications, Documents, and Folders (which can take several forms). There are some other odd animals that can stay in the Dock, but they were never truly implemented (recent items is one). If you "wrap" the .jar file inside some package that behaves as an application, you can have it stay in the Dock just as any other Application.
    A .jar file is not an application, it's a java archive. It is a collection of classes, metadata, etc. which the Java runtime interprets and executes. The Application which runs it shows up in the Dock as the coffee cup, but that is just the runtime engine, not the .jar.
    The .jar is like any other document, such as a a word processing document. Just like any document, it can be double-clicked and the handling application will be called to open it. Double-clicking that word processing document causes the word processing application to open the document and interpret its contents. Double-clicking the .jar file causes the java runtime engine to open the .jar file and interpret its contents. Instead of presenting it as paragraphs of text, it displays it as the application it represents.

  • Execute java programs automatically when system is connected to internet

    Good Day friends...
    Iam beginner in java. Please goes through the Question and please answer.
    I need to start my java programs automatically when system(windows operating-xp/7) is connected to the internet.
    Thanks in Advance,
    Shackir

    A. You might want to learn about Windows Services. Try searching for it on the web
    B. There is no way to programmatic detect if/when the local computer is connected to the internet, at least not in Java. The best you could do would be to create a timer and to periodically try to make your connection

  • Running a Java Program for every shut down of system

    Hi
    I have a java program that sends an email to the Admin of my network.
    But this is program i just want to execute for every shutdown and on of my system
    Please Tell me how to execute my java program at system shutdown time and on time..
    Thanks

    Despite your objective, this is not a Java issue. The real question is "How does one run a program just before system shutdown?"
    How you execute such an application is system dependent. Java doesn't know when the system shuts down, only when the JVM shuts down. Unless you're willing to have JVM running the entire time the system is up, you'll need native code to detect system shutdown & launch the notification app.

  • Starting Java Program with a bash Shell script

    Hi !
    I know this is a Linux query but I am putting it on this site to get different answers.
    I want to start my Java program with a shell script. Can anybody give me a proper script to start my Java program?
    I am using RH Linux 7.3 and JDK 1.4.
    Can I start the Java program without starting the terminal? Just like the Sun One Studio4 'runide.sh' script.
    Please help.
    Bye Niteen

    assuming you have your PATH and CLASSPATH variables set correctly, your script should look like this:
    #!/bin/bash
    cd <project_dir>
    java <class> &
    example:
    #!/bin/bash
    cd ~/projects
    java project1.main_package.MainClass &
    of course you could add some more elaborated stuff like compiling files before running the program, etc.
    if you dont like terminals, try running "nautilus" (it's like Windows Explorer). i never use nautilus (especially for running scripts), so i cant guarantee it will work, although i dont see why it shouldnt...

  • Calling one java program (with main method) from another

    Hello,
    How can I start another java program from one? Lets
    say I want Second.java to start by calling it from
    First.java. How do I do it? The two programs are given
    below. Any help is appreciated.
    Thanks,
    Amanda
    First.java
    import java.io.*;
    import java.lang.reflect.*;
    public class  First
         public static void main(String[] args)
              Process theProcess=null;
              System.out.println("Hello World from First.java!");
              String second=new String("Second.java");
              //System.load(second);
              //Runtime.getRuntime().load(second);
              try
                   theProcess=Runtime.getRuntime().exec( "Second.java"
                   System.out.println("after exec");
              catch (IOException ioe)
                   System.out.println(">>IOException thrown in
    First.java while calling
    Second.java."+ioe.getMessage());
    Second.java
    public class  Second
         public static void main(String[] args)
              System.out.println("Hello World from Second.java!");
    }

    Stop posting here. The crosspost remark was to alert others that there is a duplicate topic - all answers should be centralized in one so as to not waste people's time duplicating answers when they don't see both topics and the answers therein.

Maybe you are looking for