Load Java Program AT STartup

Hi I need to want to load a java program on startup and I don't know how. Is it possible to have a script that tells the operating system to load it on startup or can it only be done through the operating system's settings?

On Windows you put a batch file in your startup that contains: javaw <myapp name> or edit your registry settings to achive the same result. On Linux and Unix derivatives there are also startup files you can edit and put entries in to achive that result.

Similar Messages

  • Running a Java program at startup in Linux

    Hello
    How do I run a Java program at startup in Linux? I know in Windows I can put a .bat file in C:\Windows\Start Menu\Programs\StartUp\ directory, but in Linux I have no idea how it is done.
    Thank you,
    Mihai

    This is really a Linux question, not Java.
    And then it depends on the version of Linux you are using.
    Maybe this will help, otherwise you should try on a forum for your version of Linux.

  • Error while loading java program using loadjava

    Hi
    I have oracle 8.1.7 in NT server. When I try to load a java program with load java it gives me the error like this
    Error while resolving class EchoInput
    ORA-00904: invalid column name
    loadjava: 1 errors
    Why this is happening. How can I resolve this. Any help is appreciated
    Thanks
    Santhosh

    You need to install teh jserver component.
    have your dba review this and run all java enabling scripts.
    look for it in the doc as initjvm.sql.

  • Fast loading Java program

    The book "Core Java, Volume I" by Horstmann and Cornell gives a hint for writing a Java program that loads quickly. They suggest that explicit references to other classes be eliminated from the main class, then use Class.forName to force the loading of the other classes.
    I would like to see if the loading of other classes can be done on demand. Here is the schetch of my idea for instantiating and calling a method.
    Class myClassObj = Class.forName("MyClass");
    Object myObj = myClassObj.newInstance();
    Constructor myConstr = myClassObj.getConstructor(new Class[] {String});
    myConstr.invoke??
    Method myMethod = myClassObj.getMethod("myMethod",new Class[]{String,int});
    myMethod.invoke(myObj,new Obj []{"Julie",23});
    Here are my questions:
    1. I can use myClassObj.getConstructor to get a specific constructor but how would I invoke it? Does newInstance call a constructor already?
    2. How would Invoke a static method?
    3. If this approach is feasible, would you recomend it?
    Thanks for your help.

    1. I can use myClassObj.getConstructor to get a
    specific constructor but how would I invoke it? Does
    newInstance call a constructor already?The newInstance of Class calls the constructor with no arguments. To create an object using a Constructor instance, use its newInstance method.
    2. How would Invoke a static method?The API documentation for the invoke() method of Method tells you that. It says "If the underlying method is static, then the specified obj argument is ignored. It may be null."
    3. If this approach is feasible, would you recomend
    it?Almost certainly not. If you simply replace explicit references to the class by calls to Class.forName(), you are still going to be loading the same classes at the same time. So I don't see how this would speed up loading. And I definitely wouldn't recommend putting all that reflection code in your program. First of all, it's slower, so you could negate whatever benefits you might have got at loading time, and second, it makes your program hard to write, difficult to maintain, and subject to run-time errors because you don't allow the compiler to check method names and signatures.
    But if time to load the program is of much higher importance than any of those other considerations, then give it a try.

  • 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

  • How to run a java program in command prompt

    hi i want to run a java program from in command prompt from another directory
    i want to run a file named First in C:\Program Files\Java\jdk1.6.0_07\bin
    so when i give the command
    java "C:\Program Files\Java\jdk1.6.0_07\bin\First"
    it doesnt works it shows
    C:\>java "C:\Program Files\Java\jdk1.6.0_07\bin\First"
    Exception in thread "main" java.lang.NoClassDefFoundError: C:\Program Files\Java
    \jdk1/6/0_07\bin\First
    Caused by: java.lang.ClassNotFoundException: C:\Program Files\Java\jdk1.6.0_07\b
    in\First
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Could not find the main class: C:\Program Files\Java\jdk1.6.0_07\bin\First. Pro
    gram will exit.

    but it prints
    C:\>java -cp "C:\Program Files\Java\jdk1.6.0_07\bin\" First
    Usage: java [-options] class [args...]
    (to execute a class)
    or java [-options] -jar jarfile [args...]
    (to execute a jar file)
    where options include:
    -client to select the "client" VM
    -server to select the "server" VM
    -hotspot is a synonym for the "client" VM [deprecated]
    The default VM is client.
    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
    A ; separated list of directories, JAR archives,
    and ZIP archives to search for class files.
    -D<name>=<value>
    set a system property
    -verbose[:class|gc|jni]
    enable verbose output
    -version print product version and exit
    -version:<value>
    require the specified version to run
    -showversion print product version and continue
    -jre-restrict-search | -jre-no-restrict-search
    include/exclude user private JREs in the version search
    -? -help print this help message
    -X print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
    enable assertions
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
    disable assertions
    -esa | -enablesystemassertions
    enable system assertions
    -dsa | -disablesystemassertions
    disable system assertions
    -agentlib:<libname>[=<options>]
    load native agent library <libname>, e.g. -agentlib:hprof
    see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
    load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
    load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
    show splash screen with specified image
    C:\>

  • Executing a java application during startup

    {color:#0000ff}Hi
    Can anybody help me how to execute a java program during startup?
    Is there any java inbuilt codes to execute the program in startup?{color}

    hi,
    just create the java file and compile it in to .class file.
    create a batch file (open notepad write these commands.
    cd directory name where your java class is
    java classname
    then go to control panel and click on schedule tasks and schedule this .bat file at system startup.
    it will run......

  • 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                                                                                                                                                                                                                           

  • 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;)

  • Calling oracle SQL Loader from java program

    Hi,
    I want to insert data into oracle tables from a text files containing fixed length fields. I am using SQLLoader to achieve this. The requirement is to call the SQLLoader within the java program.
    Does anyone know how to call SQL Loader from java program?
    Thanks,
    Varsha

    Simply "exec" the sqlldr program with the parameters you need to pass to it.
    Runtime.exec (........)
    Try to pass all parameters needed including the username and password, and use the option "silent" to avoid output, and the option "log" to have a log file of the modifications that sqlldr has done to the database.

  • Once my Java program is loaded the it's reponse time is fine but how can I get it to load faster. It takes 10 to 15 seconds to load.

     

    Is it related to iAS. Which java program are you loading. It depends on several issues right from your processor to the classloader.
    Could you provide more details.
    Thanks,
    Rakesh.

  • Desktop java program: wait for page to load

    We're using a macro-builder which records actions and re-executes them via a java program. Basically, the program is supposed to open IE, go to a page, enter a username and password, and click a link within the new page that comes up after login. The issue at hand is that the second page takes too long to load, and the recorded "click" in the macro occurs to soon. Is there any way to identify when the page has completed loading before the app continues?
    Thanks,
    Jonathan

    Is there any way to identify when the page has
    completed loading before the app continues?Not in Java. Probably not even in Visual Basic (I wrote some VB programs that attempted to do that sort of thing several years ago and they never worked properly).

  • How to put a startup picture in a java program?

    Hi there,
    I'm extremely new in Java programming and have a very weak knowledge in C programming. I managed to download a Java source file from the internet which I need to use for my school's project. I was wondering would it be possible for me to put a start up picture or video clip before the program runs? And if so, how do I go about doing it? Thanks in advance.
    LostInJava

    Requires the latest Java version, Java 6.And there are fairly simple ways to program your own splash screens in earlier versions.

  • Loading variables from JAVA PROGRAM

    Hello, i have a java program how have on a variables that i want to put on a DataBase Oracle9i.
    Help me

    Hey, if you're the one that posted this: http://forum.java.sun.com/thread.jsp?forum=32&thread=495288 then you still owe me some..
    You want environment vars to remain changed after your programme finished? Do you want them to remain changed in a new session (logout/login) ? Do you want them changed in both Systems equally (the mechanisms are equal but the syntax is different in DOS and Unix shells) ?
    As I do not get tired to repeat: provide some information and the possibility of being helped is raised exponentially => explain what you try to do and people will try to help you.
    -T-

  • JSP Unable to Load Class (posted in Java Programming for 5 Dukes)

    I hope this isn't a violation of forum etiquette, but I posted my question in Java Programming at http://forum.java.sun.com/thread.jsp?forum=31&thread=203255
    I realize now that it may have been wiser to post it here, but I have some replies already and it makes more sense just to inlcude the link.
    Can anyone assist with the question at http://forum.java.sun.com/thread.jsp?forum=31&thread=203255
    It's worth 5 dukes.

    Try changing <tagclass>E:\Tomcat324\jakarta-tomcat-3.2.4\webapps\examples\WEB-INF\classes\tags.ExampleTag</tagclass> to <tagclass>tags.ExampleTag</tagclass>
    because <tagclass> tag is for the class name and not the location of class file
    And make sure your ExampleTag.class file is in
    \WEB-INF\classes\tag\ExampleTag.class
    B!

Maybe you are looking for

  • No sound out off my speak

    just installed my new Sound Blaster X-FI card on my computer. And i have put the right cables in it. And now i dont get any sound of my Trust 4500P 5. speaker set and i also dont get any sound out off my Headset.plz help to solve this problem

  • Unable to update DVM in MDS with upload through em

              Hello all I'm working on two environment : dev1 and dev2 I'm able to deploy a MDS on dev1 by zipping all the content in a "metadata.zip" file and uploading it to the dev1 through entreprise manager console. When I do the same thing on dev2,

  • Workflow integration with sharepoint

    Dear All, I  had a workflow  for ML81N and MIGO and MIRO , Now i want to send these workflows to the sharepoint , How share point will receive these work items . All inputs are higly rewarded.

  • Fault Tolerance in Nested Lab

    Hi everyone, I am trying to set up FT in a nested lab.I have followed the instructions on How to configure VMware Fault Tolerance on native and in &#8220;nested&#8221; ESXi environments | I wish I could- (German). But after I turn on FT and then try

  • Epson Stylus Pro 3800 printing problem

    I have run the software update today and my iMac shows 10.6.2 now. After the upgrade my Epson printer stopped working. I was still printing photos yesterday before the software update. I got this message: Library not loaded: /Library/Printers/EPSON/C