Execute a jar in my program!

Hello everyvbody,
I have an application that has to execute a jar, but i cant seem to get it to work. I tried many different things, creating a .bat file that calls the jat, then calling the bat file, i tried calling the cmd.exe and and then sending the dos command to start the jar, but none of this worked.
It keeps on giving me
CreateProcess: d:\docume~1\pw44500\desktop\aimsta~1\aimsta~1.jar error=193
How can i call this other jar?!?
Thanks alot for your help!
Thanks alot

Here is what i have to do, There is a tread looping in a folder checking if a new file is created. Once a file is created, it copies and renames the file into another folder. I then call the JAR to execute some other commands on this file.
I unfortunatly dont have access to the code of this JAR so no way to go add the watch over there. The watch and copying are working fine, the only thing left, is to call the jar.
So far i have tried many things, even creating a .bat file that calls the .jar and calling that instead.
Runtime.getRuntime().exec("cmd /C d:\\docume~1\\pw44500\\desktop\\aimsta~1\\aimsta~1.jar");absolutley nothing happenes. I tried this different ways,
Runtime.getRuntime().exec("d:\\docume~1\\pw44500\\desktop\\aimsta~1\\aimsta~1.jar");and i tried the same code with run.bat instead of aimsta~1.jar and again nothing.
Thanks for your help!!!

Similar Messages

  • How can i execute a .jar or .jad through  java?

    I want to execute a .jar like i do in SE using the class RunTime in ME does anybody know how can i do it? There is no method exec in MIDP Runtime API

    I have a MIDlet that receives a jar file from another PDA using DatragramConection and FileConnection. It's working well. When i'm running my application i'll send the jar file to another aplication and this application should receive, execute and return the result. For example, if i have a simple program that prints Hello World. I'll send the program the other PDA will execute and then return a String. I have to call the jr file through java because my MIDlet wil be already running.
    Could you understand my problem?

  • How can execute a jar application

    Hello there, I am facing problem with executing jar application. How can I execute a jar application using java program.
    Thanks & Regards

    VINAY_Kr_SHARMA wrote:
    ...How can I execute a jar application using java program.Do you mean:
    a) You have a Java application on-screen, and you want it to be able to launch other Jars that are not part of the current Java application?
    b) You want to know how to run a Jar in the Java plug-in?

  • Exception is thrown only while executing the jar file

    java.lang.NoClassDefFoundError: javax/mail/Address Exception is thrown only while executing the jar file. But the program compiles and executes good when executed for command prompt through the class files.
    I used javamail API in my program. Classpath and every others are set to the right one's. Executed fine when used java Random.class. But the problem is only with the jar file.
    Please help me out in this regard. Why the exception is thrown only in jar but not at class level.

    Assuming you're running your program using "java -jar", your jar file needs a Class-Path entry
    in the manifest file that references mail.jar.

  • How do you execute a JAR file?

    I'm sorry this is so basic, but I honestly do not know how to do this nor can I find anything online here or anywhere via Google to help me with this one.
    I have a JAR file that I created on another machine using JDK 1.6.0 and NetBeans 5.5 on WinXP.
    I copied and pasted that JAR file over to my machine at home also using JDK 1.6.0 and NetBeans 5.5 on WinXP
    I put the exact directory name where the JAR file resides, "C:\Program Files\Java\jdk1.6.0\classes", in CLASSPATH and rebooted my machine.
    However, upon CD'ing to that directory and doing "java -classpath . GUI.jar", I get a "NoClassDefFoundError" when trying to do so.
    Furthermore, I was not sure how to use NetBeans to run the JAR file to execute the classes within.
    What did I do wrong? I'm so sorry this is so basic.
    Thanx
    Phil

    You are using netbeans to build your jar. Go to your project properties (right click on the project name and choose properties). Then select "Run" from the tree. You will find a text box "Main Class" there, put the name of the class in there that has your main() method, including full package if you have one. That is WITHOUT the .class extension.
    Build your jar, it will be placed in the dist directory of your netbeans project. You can now run it from netbeans itself if you want. If ever you want to run the jar from the command line on your home machine, just navigate to the directory with the jar file and execute this:
    java -jar yourjar.jarand you're off. If your runtime environment is propertly setup you can even execute the jar by simply double clicking on it from the windows explorer. No need to change the CLASSPATH variable at all, in fact it is ignored when executing a jarred application.
    Also a note: you do not need to reboot your machine when you change an environment property. Simply change them using my computer -> properties -> advanced tab -> environmental variables. If you have any command prompts open, close and reopen them so the properties are updated properly.

  • How to execute a jar file which has an applet, without using a html file ?

    I have a jar file which contains a set of class files. iam able to execute the jar file by using this html code
    <html>
    <applet code="file.class" archive="file.jar" width="500" height="300">
    <param name="name" value="value">
    </applet>
    </html>
    I want to know how to execute this class file without using the html tags.
    pls help me out in this.
    Anki

    Hi,
    You can make an executable jar file such that when you double click on that it starts running. Just follow the steps.
    1. Open a notepad and write the following
    Main-Class: XXXXXXXX
    XXXXXXX means Your Main Class name. Don't forget to press Enter after you write your class name.
    2. Save the file as Mani.mf
    3. In the commant prompt ( your directory ) type following lines.
    jar cmf Mani.mf Demo.jar *.*
    4. This will make a jar file which is executable jar file
    Hope this will help you.
    Deepak

  • How to execute a jar file in a java application

    Hi,
    I've already try to execute a jar file by this way :
    Runtime.getRuntime().exec(java -jar myJarFile.jar);
    But the problem is that the display doesn't launch. Normally a "JFrame" display.
    however the corresponding process is launched.
    So i would to know if there is a way to execute a Jar File without using the Runtime class.
    Is there a specific class for the Jar File?
    Thank you.
    Richard

    Create a 'manifest' file pointing to the 'main' class, jar it into the .jar file, place it onto your desktop - or whereever you can click on it, and click on it.

  • How to execute a jar file in other machine?

    Hi all,
    I am working with java. and my machine is connected to LAN.I would like to execute a jar file in my machine from a remote machine that is also connected to LAN.how should i go about doing this.Help me if somebody have a solution as i am badly in need of this.
    Regards,
    Mohan

    Hi Mohan.tkm,
    If you want it to be done in pure Java and independently of the OS of both computers, you may build a RMI server that will launch your JAR by request of a remote RMI client.
    There's an example of RMI here .

  • How to execute dos command in Java program?

    In Perl, it has System(command) to call dos command.
    Does java have this thing?
    or any other way to execute dos command in java program?
    Because i must call javacto compile a file when the user inputed a java file name.

    Look in the Runtime class, it is implemented using the Singleton design pattern so you have to use the static method getRuntime to get its only instance, on that instance you can invoke methods like
    exec(String command) that will execute that command in a dos shell.
    Regards,
    Gerrit.

  • Path to rt.jar from C program

    How do I get path to rt.jar from a program written in C.
    Thank you

    Just like anything else you do in C. Pass in in via the command line or use a config file or use an environment variable or parse the registry (OS specific), etc.

  • Howto execute java jar file via html ?

    hi
    howto execute java jar file via html ?
    could someone pls post a html code ?
    kind regards
    upiter77

    hi
    howto execute java jar file via html ?You can't.
    could someone pls post a html code ?No. you can search for yourself and find the code you need.
    Now, it sounds to me like you're trying to build an Applet or do Web Start or something. In any event, you need...wait for it....Google! :-)

  • Is it possible to execute SAPGUI scripts from java program?

    Hi everyone..
         I need to develop an java applications that executes the SAPGUI script or any technique that execute set of transaction as client.
         Is it possible to execute SAPGUI scripts from java program? if so, how it can be achieved? is there any other technique to achieve above mention scenario?.
         it will be more helpful, if docs related to that are shared..
         Thanks in advance

    Oh, bummer. Would be much more convenient if I could just use iTunes for everything. Can't stand WMP. I wonder if WinAmp might be a good compromise?
    Thanks for this answer . . .
    Sharon

  • XML Parsing Error: no element found Location: jar:file:///C:/Program%20Files/Mozilla%20Firefox/chrome/toolkit.jar!/content/global/netError.xhtml Line Number 1, Column 1:

    Accidentally clicked on "Allow for Safe Networks Only" and saved it. When launching Firefox, this error: XML Parsing Error: no element found
    Location: jar:file:///C:/Program%20Files/Mozilla%20Firefox/chrome/toolkit.jar!/content/global/netError.xhtml
    Line Number 1, Column 1:
    I have uninstalled and reinstalled, changed to a new profile, nothing works. I have looked at Options - Network - No Proxy
    Please help as I love Firefox

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]

  • When I tipe something in adress bar I get "file jar:file:///C:/Program Files/Mozilla Firefox/omni.jar!/chrome/sl/locale/browser-region/region.propertiesSOMETHING couldn't be found"

    This is the meassage I got (in slovene) when I tiped mleko
    Datoteke jar:file:///C:/Program Files/Mozilla Firefox/omni.jar!/chrome/sl/locale/browser-region/region.propertiesMLEKO ni mogoče najti.
    I've opened Firefox in safe mode and I've uninstalled it (and install it again) and nothig hapened.
    Thank you.

    -> Tap '''ALT''' key or press '''F10''' to show the Menu Bar
    -> Update ALL your Firefox Plug-ins https://www.mozilla.com/en-US/plugincheck/
    -> go to Tools Menu -> Clear Recent History -> '''Time range to clear: select "EVERYTHING"''' -> click Details (small arrow) button -> place Checkmarks on '''Cookies, Cache, Site Preferences, Active Logins''' -> click '''Clear Now'''
    -> go to Tools Menu -> Options -> Content -> place Checkmarks on:
    1) Block Pop-up windows 2) Load images automatically 3) Enable JavaScript
    -> go to Tools Menu -> Options -> Privacy -> History section -> '''Firefox will: select "Remember History"'''
    -> go to Tools Menu -> Options -> Advanced -> Network -> Offline Storage (Cache): click '''Clear Now''' button
    -> Click OK on Options window -> Restart Firefox
    Check and tell if its working.

  • I upgraded to Firefox 8. Now my home page says this: "Firefox can't find the file at jar:file:///C:/Program Files (x86)/Mozilla Firefox/omni.jar!/browserconfig.properties.

    This is what it says on my screen when I open Firefox:
    Firefox can't find the file at jar:file:///C:/Program Files (x86)/Mozilla Firefox/omni.jar!/browserconfig.properties.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

Maybe you are looking for