Run my executable jar on user startup.

hi.i need some help on how to make my jar run when user startup windows. is there any code, API call or something that does it like writing to registry or something? 1 point is that the user must not be able to take away the startup function that easily.

There is a registry entry which could make your app execute on startup. Check http://www.winguides.com/registry/ for that.
DON'T TYPE EVERYTHING WITH BOLD. IT LOOKS BAD.

Similar Messages

  • Error trying to run an executable Jar file

    Hi,
    I know a million people have asked this before. In the past 5 hours I have waded thru a dozen questions-answers-FAQs that were no help. So if anyone is willing to help a stupid person her is my problem:
    I developed a java program using the eclipse ide and it runs fine from within that ide.
    I packaged it into a Jar file, created a manifest file per the instructions.
    But when I double click on the jar file I get the following error from the Java Virtual Machine Loader;
    "Could not find main class. Program will exit."
    My Manifest file has the following text:
    Manifest-Version: 1.0
    Class-Path: swt.jar
    Main-Class: .graphicalUserInterface.AppStandAlone
    <blank line>
    the class AppStandAlone has the method "public static void main(String[] args) "
    it is in a package called "graphicalUserInterface".
    Any help anyone can give me would be greatly appreciated.

    Another 3 hours spent trying to run this java application in a Jar file.
    I identified that I did not have all class paths specified. So I tried to enter them in the "Class-Path:" line of the manifest file. But, according to the java tutorial, the syntax in a manifest file for classpaths is a space SEPARATING each path name. I have a space IN the path name and java is not understanding the paths correctly. For instance, I have a classpath c:\Progran Files\Java\etc... and java interprets this to be a classpath c:\Progran with Files\Java\etc as the program I want to run.
    I tried enclosing the paths in double quotes. Didn't work
    I tried enclosing the paths in single quotes. Didn't work
    I tried using a semicolon as a separator with double quotes. Didn't work
    I tried using a semicolon as a separator with single quotes. Didn't work
    I tried using a semicolon as a separator with no quotes. Didn't work
    I removed the "Class-Path:" line from the manifest and tried adding -cp param to the java command. Example:
    java -cp %classpath% -jar myapp.jar
    I tried all the variations above in the -cp param. None of them worked.
    The only thing that works is if I move executable jar file to the same directory as the required libraries. Then I specify a "Class-Path:" line with no spaces in the path names. Obviously this is not a permanent solution.
    If anyone else has the patience to help me I would really appreciate it.

  • Error when running an executable jar file

    Hi
    I created a java application with a main method in one of the classes and through eclipse exported it as a jar file to run as a standalone application on another machine. In this application, I used a jar file sqljdbc.jar by referencing to it in the application. So I set the jar file's location in the classpath on the other machine and ran the application on the command prompt.
    java -jar myapplication.jar. But I get an error "java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver".
    I am not sure what else could be done. Thanks and appreciate any help on this.

    Do you mean you set the system Classpath on the other computer? When you use "java -jar" the only Classpath that is used is the Class-Path inside the jar's manifest.
    You need to either use the Class-Path in the manifest of myappication.jar to include the sql jar, or use "java -cp myapplication.jar;microsoftsql.jar TheMainClass" (use : instead of ; for *nix computers)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Image not displayed while running executable jar ?????

    hello everyone...i have developed a game like mario and everything is happening well......
    i have created an executable jar file of my game so that i can distribute it to my friends.............
    now the problem is :
    my all the images that are used in my game are in "Images folder", so when i run my executable jar file outside the reach of images folder than images does not get displayed on my game.................i mean when jar file is located beside my images folder then images get displayed but if i move my jar file to some other location then images doesn't get displayed.......
    i have included images folder inside my executable jar file.....but same problem arises......
    in my game, to display images i have used this code:
    Image img=new ImageIcon("Images\\hero.gif").getImage();
    so Images folder should be located at the same directory where my game is located....................
    so can anyone tell me why this is happening ?
    i want to execute jar file even if i relocate my jar file(i've put images folder inside jar).......
    Edited by: JGarage on Nov 28, 2008 10:45 PM
    Edited by: JGarage on Nov 29, 2008 12:50 AM

    inside my jar , i have these three folders:
    engine play res manifest.txt
    engine and play are packages
    to load an image i have used these code
    Image img=new ImageIcon("res\\t.gif").getImage();
    to draw image:
    g2d.drawImage(img,x,y,this);
    i had also used what u said :
    img=ImageIO.read(Thread.currentThread().getContextClassLoader().getResourceAsStream(path));
    Note: earlier u adviced me ImageIO.read(Thread.getContextClassLoader().getResourceAsStream("res/y.gif"));
    getContextClassLoader() is not an static method so i can't acess it from static context.It gave me compilation error.so i used Thread.currentThread().getContextClassLoader().
    and i haven't used BufferedImage.I have used Just Image.

  • Executable JAR Problems

    I made an executable JAR file (With the Manifest file). When I double click it, it just sits there. (Note: Im using XP and i did assosiate the file).
    Please help

    I had a similar problem running an executable Jar file on the XP platform. I was constantly getting the ClassNotFound error when I ran the program outside of the JBuilder 9 environment. I finally resorted to the newsgroups for help and found this suggestion. Including the classpath in the manifest file! This worked for me and hopefully it will help you.
    Main-Class: ewc.DocumentManager
    Class-Path: file:///C:\ewc\classes
    file:///C:\ewc\classes12\ojdbc14.jar

  • Need help with loading images in executable Jar

    Hi,
    I've developed an application using netbeans that needs to load and display images.
    I use netbeans Clean and Build function to create an executable Jar file. When I run the executable Jar file it runs fine but when I come to a section of the application that needs images it freezes and can't load the images.
    When I then return to netbeans the part of the program that did successfully run before Clean and Build doesn't work anymore and I get an error message saying Uncaught error fetching image:
    I use,
    URL url = getClass().getResource("images/image1.png");
    Image image1 = Toolkit.getDefaultToolkit().getImage(url);to load an image.
    Can someone tell me why, when I clean and build my project to create a JAR, my images fail to load.
    Should I be storing the images in a specific folder or something??
    Thanks

    I've opened the JAR using winzip and, for some reason, the JAR hasn't preserved my file structure. So, when I try to look for an image as follows:
    URL url = getClass().getResource("images/file1.png");
    Image img= Toolkit.getDefaultToolkit().getImage(url);The folder doesn't exist and so it can't find the image.
    Can someone tell me how to keep my file structure when I create the JAR or an alternative way to find the images within the JAR file.
    Cheers

  • Porting executable JARs to other computers

    Hi, all!
    There seem to be about 10 threads on this topic already, but none of them had any information that fixed what's wrong with my manifest.
    I'd like to be able to put a downloadable executable jar file on my site so a professor can just download and double-click to run my program (he may or may not have linux, windows, or mac, but he'll definitely have the JRE). I'm getting the "Could not find the main class: program will exit now" error when double-clicking on a jar I created in Eclipse. The program has one main class called Model, and three other classes. The package name is Model, and the project name is ExerciseOneBeta. Here's the contents of my default created manifest file:
    Manifest-Version: 1.0
    Main-Class: Model.Model
    From reading the other forum threads, I made sure that there was a new line after the second line of text. I've already read the jar tutorial at sun; it only included information on how to run a jar from command line, and only after already configuring your JRE path to be accessible to any jar on your machine. I need my jar to be double-clickable and totally self-contained. How should I try to modify my manifest?

    I have twice had similar problems to this and they
    were caused by the following.
    1) Stupid flash and it's stupid installer that
    fiddled with my classpath.
    2) Something when I installed 1.5 runtime whichwent
    away after I upgraded to a more recent version.The app runs fine in Eclipse. If the jar file needs
    to know anything about my classpath or enviro
    variables, the jar file hasn't been constructed
    properly. I need a jar file which is FULLY
    self-contained, and executes on a double-click.Yes, yes lovely.
    What I am saying is that both of those were bugs in other things that manifested (ha ha) themselves when I tried to run self executing jars.
    For starters I would check to see that something hasn't tried to add/modify otherwise screw you up by adding a system environment variable or the like called classpath to your system.

  • Execute executable jars without jar.exe in system path???

    Hello all,
    I could run an executable jar file on my workstation once I configured its MANIFEST.MF file with its Main and class-path attributes. But, the execution failed when I tried to copy this executable jar file alongwith other required jar files to a workstation not having jar.exe in the path! However, the same programme executes successfully when I run it using a batch file where I set jar.exe in the path. is it possible to configure MANIFEST.MF file with system path?
    thanks in advance.

    Actually you don't need Jar.exe to run jars.yes, you are right! actually, I need another dll file in the system path to execute the application. how can I add this dll file to the path when running the application using executable jar.
    BTW, thanks for the reply!!
    note: the dll file required in the path is bundled alongwith other jar files.

  • JVM parameters from Executable JAR

    Is it possible to utilize JVM parameters when running an executable JAR?
    I have an application that process a large amount of data. If I run the application from the command prompt I can use the JVM directive -mx512M to allocate 512MB of memory to the JVM.
    Is there a way of doing the same thing when using an executable JAR?

    In which way are you running a jar without a batch file?
    If you want to make a Java App run with launching according to the operating system's style, unzip JAVA_HOME/src.zip and study the java.exe c source code. Start your own custom java.exe changing its name to yourapp.exe. You can then adorn it with all the things expected on a given operating system.

  • Executable Jar file - Does not open

    Hi,
    I have an executable jar file. The icon of that executable jar is that of an unknown file instead of the normal java icon. So when I try to run that executable jar it shows 'open with'. What is the reason for this? What should be done in order that I can run this executable jar?
    Anees

    Associate .jar files with java -jar in your OS. I didnt get you.
    Normally it should open with these softwares installed, rt?

  • Running executable jar

    HI there, if i compress my application into an executable jar, what would a user need to run it on their machine? (Would they need to have java installed on their machine)Its a simple application that writes to a file.

    HI there, if i compress my application into an
    executable jar, what would a user need to run it on
    their machine? (Would they need to have java
    installed on their machine)Its a simple application
    that writes to a file.The user would need the JRE (Java Runtime Environment) installed, yes. They would not need the SDK (which includes the JRE).

  • How to run executable jar on client machine remotely?

    Hi,
    I have developed PHP web application that uses Java in the background. The problem that I want to solve is to start Java application (executable jar) on client machine.
    Is there any idea how to solve this problem?
    Zoran

    found it:
    in the Group Policy Management Editor go to Computer Configuration > Policies > Administrative Templates > System > Logon > Run these programs at user logon, and add the path (on the local computer) to the script to be run when any user logs
    in.  Powershell scripts need to be called from a .vbs script like this in order to prevent window popup:
    Dim objShell
    Dim cmd
    Set objShell = CreateObject("Wscript.Shell")
    cmd = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -nologo -noProfile -NonInteractive -ExecutionPolicy bypass -File c:\mypowershellscript.ps1"
    objShell.Run cmd,0
    As for distributing the scripts, that's a work in progress... GPP?

  • Problem running my program only after making an executable jar...

    Hi everyone,
    I am having trouble running my program after creating an executable jar. The program runs fine until
    it is supposed to open a specific JFrame. I get the following error message as soon as the frame tries
    to open:
    Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: org.apache.xerces.parsers.SAXParser.<init>(Lorg/apache/xerces/xni/parser/XMLParserConfigurat
    ion;
    Has anyone ever seen this before?
    The strange thing is, this does not happen when I build and run the project under Eclipse.
    Any help or tips would be appreciated!
    Chris

    Roosh wrote:
    The strange thing is, this does not happen when I build and run the project under Eclipse.
    Any help or tips would be appreciated!Make sure you are using the same version of Java as you use with Eclipse.

  • SWT Runs in Eclipse - Not after export (NOT executable JAR)

    I have been working on my first SWT application. It will run when using the Eclipse run command. However, when I export the project to a JAR file I can't get the module to run. I am NOT trying to run this as an executable JAR. I will eventually get to that, but for the moment I just want to be able to execute the module via the standard Java command.
    When I try to run the module via:
    java com.myproj.visual.SearchDisplay I get the following result:
    NoClassDefFoundError:  org/eclipse/swt/widgets/LayoutI have tried every variation of running this that I can find. I have the swt.jar as well as the jar containing my project files in the class path. I have extracted the DLL files from swt.jar and put them in the directory from which I am executing the module, i.e. I change directory to there before executing the Java command. I tried including the following in the Java command:
    -Djava.library.path=c:\projects\java\myproj\swt-win32-3139.dllI have also tried including the classpath at the Java command:
    -classpath .;c:\projects\java\myproj\swt.jar;c:\projects\java\myproj\mmstat.jarSo far nothing has helped. I get the same error regardless what I do. Yet this runs fine inside Eclipse.
    In my Eclipse environment I do have swt.jar imported. And have org.eclipse.swt in my Require Projects tab on the Build Path. I also have swt.jar and Standard Widget Toolkit identified in the Libraries tab of the Build Path. And on the Order and Export tab I have tried including all three (Standard Widget Toolkit, swt.jar and org.eclipse.swt) and then each one separately and then in combinations.
    It is obvious that I am not exporting correctly or I don't have the correct configuration at runtime. But I can not figure this out. I have been reading forums for days now. They mostly are concerned with excecutable JARs which is not yet my problem. I first need to get this working before worrying about packaging an executable.
    Can someone please help suggest some solutions for me?
    It would be GREATLY appreciated.
    Glenn Puckett
    Lexington, KY

    Making a jar file from SWT project, in Eclipse:
    1. Create one manifest file in project with following contents:
         Manifest-Version: 1.0
         Class-path: swt.jar
         Main-class: package.MainClass
    2. Export jar file with this manifest file
    a) Right-click on project
    b) Selection Export
    c) Select Java and Jar file
    d) Select the project, classpath and file project
    e) In jar file textbox enter the name for jar file and select options: "Exports generated class files and resources" and "Compress the content of the jar file"
    f) Press Next button
    g) Press Next button
    h) Select "Use existing manifest from workspace" and select the manifest file which you has created
    i) Press Finish button     
    3. Put togheter the jar file and swt.jar
    4. Run jar file

  • Running executable jar from within a java program

    Is there a way to launch an executable jar in a java program? I tried wrapping the jar in an exe and calling it using Runtime exec() and though this approach works it does only for windows. I want it to work for unix/linux too.

    jaki wrote:
    Yes, but it's a sub process.Nope.
    Hence the calling process doesn't quit unless the called one returns.Wrong.
    My calling program is actually a jar and what Im trying to do is delete the jar after it's done running. But the above method (of launching a separate jar doing the deletion) doesn't seem to work for the above mentioned reason.Wrong.
    If you could tell me any other way it would really be a big help.You don't need any other way. Maybe you need to allow some time for the calling program to wind up. 20 seconds may be overkill, but I'm not in the mood to find how short it can be and still succeed.
    The two classes are packaged in separate jars.import java.io.IOException;
    public class Deletee {
        public static void main(String[] args) {
          try {
             String[] cmds = {"java", "-jar", "E:/temp/Deleter.jar"};
             Runtime.getRuntime().exec(cmds);
             System.exit(0);
          } catch (IOException ex) {
             ex.printStackTrace();
    import java.io.File;
    import javax.swing.JOptionPane;
    public class Deleter {
       public static void main(String[] args) {
          File file = new File("E:/temp/Deletee.jar");
          try {
             Thread.sleep(20000);
          } catch (InterruptedException ex) {
             ex.printStackTrace();
          if (file.delete()) {
             JOptionPane.showMessageDialog(null, "Deleted");
          } else {
             JOptionPane.showMessageDialog(null, "Oops");
    }Try it and see for yourself.
    db

Maybe you are looking for

  • What is the audio format and bitrate for the MixRa...

    Regarding the MixRadio+ "high quality": What is the audio format (AAC/MP3/WMA/etc.) ? What is the bitrate (192/256/320kbps etc.) ? Thanks 

  • PI/PO 7.4 Installation Options

    I have a unique system PI/PO installation request.  The project I am on just approved PI/PO 7.4 as part of the project.  We have a SLD AS JAVA 7.4 system working currently as our central SLD. My question is and I have never heard of it being done is

  • Error when trying to download

    When I try to download a video I get the message "We could not complete your Itunes Store request. An unknown error occurred (-9808) what does that mean and how do I fix it?????

  • Tab pages control

    We are working on migration project from client/server to web using 9ias. lot of our modules have tab pages, oracle docmentaion says you should pay attention using them because all sheets get loaded including those hidding behind the tab. what is the

  • Need music to play through more than 1 slide ...

    I'm new to Mac. I've used PowerPoint and was able to have music play until it ran out. I've edit music to fit my slideshow exactly and I'm using multiple music files in one slideshow. When I add music it stops once it transitions to the next slide. H