Starting a jar file.

I am wondering if anyone might have a suggestion to this.
I have created a .jar file from JBuilder using the application option in archive builder. ie the jar file should be able to start just by double clicking it. I take the jar file to one of my other machines and it starts fine. I use the java - jar command and it works fine. I double click it in my Windows XP and I get the error: Java Virtual Machine Launcher - "Could not find the main class. Program will exit."
I did read a case in the postings where a startup file was creating havoc, but I don't think I have any java dependent startup's.
I have tried various things like checking my classpath environment variables, associating the file with Javaw from C:\j2sdk1.4.2_03\bin. Any other comments would be appreciated.
cheers
James

Well, I guess I found the answer of some sort. I tried JWhich from the URL http://www.javaworld.com/javaworld/javatips/jw-javatip105.html, but that didn't work. But, what it did do is that it told the O/S that I had changed the jar launch settings when I went into Tools/options/view File Types of explorer and after highlighting the jar extension. This would have come up if I had changed it to something else anyway. I guess I just didn't notice the little message. The GUI gave me an option if I wanted to restore back to original and walla! it now works.
Hope this is of use to you if you come across this problem and not sure what to do.
cheers..
James

Similar Messages

  • Starting a JAR File in Linux

    Hi,
    , to start a jar file in Linux from a file.. how can i do that?... like a .*bat file in windows, or a script file in unix...
    Thanks verry much, and sorry my english, (i'm form .UY :) )

    java -jar yourJar.jar should work for you. You could create an executable shell script to perform this or setup a file association to execute the file using java -jar whenever you bonk on it.

  • How to start a Jar file in another directory?

    Hello!
    I have 2 questions, hope someone can help me...
    1)
    I have a GUI which is placed in C:/java/tmp/GUI.java. When I run this program I want it to start runing a JAR file which is placed in d:/tmpdir/app.jar. How do I do this?
    2) How can I get the directory a program is running in?
    /Clabben

    Hello
    Yes Rana the main method is placed in GUI.java, and I want this method to start/run the app.jar. The problem is just that these are placed in different directories AND how do I "start/run" the app.jar? The app.jar has also got a main-class. So you can click on it to run it, but I want the GUI.java to do this . Do you, or anyone else, have some code example?
    /clabben

  • Oracle 11g application won't start sometimes(jar files issue)

    Hello,
    The issue we experience is that now and then, our forms 11g application
    won't start.
    So it can be the case that, for example, the application can be started
    succesfully 5 times in a row, but the 6th and 7th time, it won't start
    anymore. But when we relaunch it for the 8th time, it launches perfectly.
    When the application isn't starting, a new window is opened having a yellow triangle
    with an exclamation mark on the top right corner.
    After a long period, we suddely discovered that it had something to do with ".jar" files.
    Because when we clear the "java jar cache" on the client machine
    (start -> control panel -> java -> "general" tab -> "view..." button -> select all the files and click on the
    cross(remove selected sources) ), the application succesfully starts for about 10 times in a row.
    But the first time we start the application(after clearing the cache), it takes much longer, because the application
    is downloading the .jar files again. (java logo appears with a progress bar)
    But clearing the cache every time before starting the application can't be a decent solution we think.
    When we enable all java debugging info in the console, we received the error below 2 times when launching a application session that refused to start:
    java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.awt)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPackageAccess(Unknown Source)
         at sun.plugin2.applet.Applet2SecurityManager.checkPackageAccess(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at oracle.forms.engine.Main.initDesktop(Unknown Source)
         at oracle.forms.engine.Main.start(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Anyone having a clue ?
    thanks in advance !

    Sorry, I meant WEB-INF\lib in the WAR file inside my EAR.
    I put all the jar files in the WEB-INF\lib of the WAR file but it still does not work. I have to specify them in the classpaths and put the jar files in the domains\domain\lib directory
    I thought if you put it in the WEB-INF\lib then you don't have to put them in the classpath.
    Am I right?

  • Server won't start and JAR files

    My application uses external classes (quartz, jersey, jackson) and I included all the jar files containing the external classes in the WEB-INF\lib directory of the EAR file already. I deployed it to WLS 10.3.5 on windows but when I tried to start it up, it failed to start up.
    I copied all those jar files and put them in the <domain>\lib directory and add in the classpath section on the ServerStart tab of the server then it started up.
    I thought if you include those jar files in the WEB-INF\lib of the EAR file then you don't need to put them in the <domain>\lib and specify in the classpath section?
    Do you have any ideas?

    Sorry, I meant WEB-INF\lib in the WAR file inside my EAR.
    I put all the jar files in the WEB-INF\lib of the WAR file but it still does not work. I have to specify them in the classpaths and put the jar files in the domains\domain\lib directory
    I thought if you put it in the WEB-INF\lib then you don't have to put them in the classpath.
    Am I right?

  • Jar file not starting properly when in dir with name 2 or more words

    Hello,
    I have a pretty weird problem here. When I start my jar file from a directory like Test/MyJar.jar everything is fine. But if I try to start it from Test 1/MyJar.jar the file is not running properly. The jar file reads files from it's directory and the message I receive is can't find Test20%1/MyFile.txt.
    Any help will be appreciated.

    Anyway. Probably the easiest thing is to not read from the directory. Rather, put the files you need to read into the Jar file itself, and read them using Class.getResourceAsStream.
    This is a workaround, but it's a good one.

  • Java Application as jar File cannot connect to SAP via JCO

    Hey guys,
    I wrote a test class to play a little with the java connector. Everything worked fine.
    Now I want to pack my java class and the JCO classes in one jar file. I have written a manifest file with the Main-Class statement and after I start the jar file I got following exception:
    Exception in thread "main" java.lang.ExceptionInInitializerError: JCO.classIniti
    alize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
    JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc [no sapjco
    rfc in java.library.path]. java.library.path [C:\WINDOWS\system32;.;C:\WINDOWS\S
    ystem32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\Ja
    vaConnector\sapjco.jar;C:\j2sdk1.4.2_12\bin;]
            at com.sap.mw.jco.JCO.<clinit>(JCO.java:776)
            at de.lymez.sti.SAPAufruf.getDocnr(SAPAufruf.java:26)
            at de.lymez.sti.Aufruf.main(Aufruf.java:12)
    Can anyone help me? I don't think that I forget something during the JCO installation, because my class file worked fine and give me the correct values out of the SAP System.
    Best regards,
    Timo

    Thanks Vladimir,
    but I followed the Tutorial and copied every dll in the wright folder and set the pathes. In one of the threads someone told about a tool named dependency walker. I used this with the sapjcorfc.dll and the tool answered that the DRVADODB.DLL is not found. Can anyone send me this dll? And why worked everything fine, when I use the class? I only have problems when I use one jar file!
    Thanks for any help!!
    Regards,
    Timo

  • Problem whit jar-file

    I made one project whit DB on NET BEANS, but when i start my jar file, who is automaticly generated by NET BEANS my DB jobs doesen't work and when i start my jar file on oder computer the images on icons disappear.

    I agree - you need to post more information.
    Check out http://forum.java.sun.com/thread.jspa?threadID=5173326 and http://forum.java.sun.com/thread.jspa?threadID=5156691&messageID=9593420 for examples.

  • Update automatically a JAR file

    He folks!
    Here is what i want to:
    1.
    Develop a little dummy java applet (just for testing), placed in a jar file.
    2.
    That applet should be signed as a trusted applet, so that it can do some more
    stuff on the client and
    3.
    Every time the user starts the applet on his client, the applet should
    check on the server, if there is a newer version, and if so
    update itself automatically, if not just start the jar file on the client machine.
    Does anyone have any suggestions how to do that, or where to get some informations
    about that topic?
    greetings
    Normen

    Every time the user starts the applet on his client,
    the applet should
    check on the server, if there is a newer version, and
    if so
    update itself automatically, if not just start the jar
    file on the client machine.That is already done automatically. If you want to bind the caching to a certain version number, or understand more about applet caching, you should read this single page: http://java.sun.com/j2se/1.4.1/docs/guide/plugin/developer_guide/applet_caching.html

  • Some prolems when trying to create Jar file...

    Hi,
    1st sorry i post this in the wrong box, i posted it in the Jar box but no body replied and I really need to get this done soon...
    I've got a list of *.class and a folder images and Start is the class I want to be the entry point
    I tried:
    1. jar cfm MyApp.jar Manifest.txt *.class images
    In Manifest.txt has a line: Main-Class: Start
    the jar file is created, but when I tried to run (both double click and command line) this gives me an error "Failed to load Main-Class manifest attribute from..."
    2. jar cmf MyApp.jar Manifest.txt *.class images
    this has error while making the jar file, it gives "java.io.FileNotFoundException: MyApp.jar (The system cannot find the file specified)...
    3. I tried the 1st method, then unzip the jar file, edit the manifest.mf file by adding a line Main-Class: Start. Then zip it, rename it to MyApp.jar
    And a weird thing happens... When I place the jar file IN THE SAME FOLDER with other class files, it runs fine. But when I move it to A DIFFERENT FOLDER with other class files, it runs with dimension 0x0, i.e. only the title bar is displayed...
    I've tried those method and none of them work... can some one tell me what I have done wrong?
    Thanks...

    This is the class used to get the ImageIcon for the JLabel
    public class CardGUI extends JPanel {
         private ImageIcon tmp;
         private final int CARDWIDTH = 50; //Card width is 50
         //return the Card GUI
         public ImageIcon getCardGUI (int kind, char suit) {
              //This String is used to locate the file (*.png)
              //of each Card
              //E.g. Card 2 Club will has file "images/cards/2c.png"
              String imgStr = "images/cards/" + kind + suit + ".png";
              tmp = new ImageIcon(imgStr);
              //If the card is not found, return the back of the Card
              if (tmp.getIconWidth()!= CARDWIDTH) {
                   tmp = new ImageIcon("images/cards/back.png");
              return tmp;
    }Then the JLabel used this to set the image, where humanCard1 is an instance of JLabel, and cardLabel is instance of the above class.
    humanCard1.setIcon(cardLabel.getCardGUI(card10.getKind(), card10.getSuit()));
    > new ImageIcon("images/mainbackground.jpg")Wrong. Because there are any more no files in a jar archive. Only file is the jar file itself, and nothing else.
    What do u mean? When I create the jar file, i include the images folder inside the jar file already?
    I've been using the Swing forum and that's how I know the 2 methods above for setting image for JLabel and JPanel... So what should i be searching for in the Swing forum now?

  • Please I can not get a .jar file to run on XP SP3 start/run/cmd/

    I can not get a .jar file to run on XP SP3 start/run/cmd/
    Please help if can figure this out. I'm convinced it is a Windows XP SP3 problem from searching on google and seeing other ppl on XP SP3 with same problem (but no working solution for myself). I'll try to be complete-listing all I've done.
    I had installed: Java SE Runtime Environment v6u14 for Windows Multi-language
    I had checked here it was working properly: http://www.java.com/en/download/manual.jsp
    I'm trying to run this jar file (soht-client-0.6.2.jar):
    http://prdownloads.sourceforge.net/telnetoverhttp/soht-java-client-0.6.2.zip?download
    http://www.ericdaugherty.com/dev/soht/javaclient.html < this is the information for the program.
    (yes the file can be executed and should open the program's window
    I wanted to post screenshot of it but friend that it's working for isn't here)
    _(Please find log of all cmds I did in this post here: http://pastebin.com/f792983df )_
    _I have extracted +'all' the files to: C:\062\+_ (I have tried using other directories, same problem)
    ++I then start/open/run/cmd+
    then I: cd C:\062\+
    then I try various commands - all+ of these do absolutely nothing- meaning no errors, no reply, no window opens, nothing except enters that directoy again:
    java -jar soht-client-0.6.2.jar
    java -jar -client soht-client-0.6.2.jar
    java -client -jar soht-client-0.6.2.jar
    java -jar soht-client-0.6.2.jar soht.properties
    soht-client-0.6.2.jar
    So I try this cmd: java soht-client-0.6.2.jar
    Reply:
    C:\062>java soht-client-0.6.2.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: soht-client-0/6/2/jar
    Caused by: java.lang.ClassNotFoundException: soht-client-0.6.2.jar
    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: soht-client-0.6.2.jar. Program will exit.
    I try this cmd:
    java -jar soht-client-0.6.2.jar -client
    Reply:
    C:\062>java -jar soht-client-0.6.2.jar -client
    Unable to load configuration file: -client - java.io.FileNotFoundException: -cli
    ent (The system cannot find the file specified)
    SOHT Java Client
    The SOHT Java Client requires a properties file. Either start
    the application in the same directory as the soht.properties
    file, or specify the file name on the command line:
    java -jar soht-cleint-<version>.jar c:\soht.properties
    So then I do these cmds which produce the exact same error/reply just above; Unable to load..:
    j_ava -jar soht-client-0.6.2.jar -client soht.properties_
    java -jar soht-client-0.6.2.jar -client C:\062\soht.properties
    So then I copy soht.properties to C root and do:
    java -jar soht-client-0.6.2.jar -client C:\soht.properties <same error as above
    Then from other information I have read I right click on the .jar file, select open with Always open with:
    _"C:\Program Files\Java\jre6\bin\javaw.exe"_
    Try again.. same problem.
    Then I do cmd:
    _"C:\Program Files\Java\jre6\bin\javaw.exe" -jar "C:\062\soht-client-0.6.2.jar"_
    does nothing, retry the other commands same thing (either nothing or those same replies)
    Then I read (http://forums.sun.com/thread.jspa?threadID=5384879) someone had the same problem as I and they solved it by uninstalling all Java/reboot/ then install JDK 6 Update 14 with NetBeans 6.5.1 start NetBeans and then it worked for them.
    So I unistalled all Java, rebooted and gave the cmd another try (before re-installing), now a new error, of course:
    C:\062>java -jar soht-client-0.6.2.jar
    'java' is not recognized as an internal or external command, operable program or batch file.
    Then I install  Java SE and NetBeans Cobundle (JDK 6u14 and NB 6.5.1) Final Release/ reboot/ open Netbeans/
    go to test java page; all is good, run cmds again -and still nothing..
    C:\062>java -version
    java version "1.6.0_14"
    Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
    Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)
    I reassociate program with: C:\Program Files\Java\jre1.6.007\bin\javaw.exe_
    same thing.. nothing
    Thank you very much for your time :D_
    PS. My computer has been newly reformatted so needing another reformat I'm sure is not the solution.

    Thank you very much for your replies Taggert_77 & swmtgoet_x :D
    Taggert77_: I have never used NetBeans. I only installed it in the bundle as I had read on another post that somehow installing the bundle magically helped another user with the same problem (he didn't know why it worked after that either).
    Before XP SP3 I was able to execute .jar file through cmd prompt. Now I am not.
    This file is executable, grab it and you will see. Here is a screen shot (program in front is FlashFXP, behind is the cmd prompt and what should happen):http://www.freeimagehosting.net/uploads/53273b4ddf.jpg
    swmtgoetx_: I only did the other cmd's to try to make it spit out something, anything lol :D
    The proper cmd is simply: java -jar soht-client-0.6.2.jar
    I did give your cmd a try, and it produced nothing :( (just like the other correct cmds)
    java -client -jar soht-client-0.6.2.jar soht.properties
    Thank you again...the mystery remains
    PS. If you do a search for this you'll find an amazing amount of XP SP3 users with the same problem and no solution posted that I could find except one chap that did the unistall install order that I did above).

  • Error message at start-up Unable to access Jar file

    I am a consumer, not a business...and not an IT professional. I am running Vista and have not installed any new software recently.
    At every start-up, I get a pop-up titled Java Virtual Machine Launcher. The message says "Unable to access jar file". C:\users\user\.jnana.jnana.tsa.
    Any idea how to fix this?
    Thanks in advance.
    Edited by: 794979 on Sep 15, 2010 5:31 AM

    ok i'm gonna make it easier on you.
    i gess i found what is the problem but have no idea how to solve it.
    when i obtained the .jar file i also obtained a README.txt file in which it is written the following phrase:
    ** If a library on the projects classpath also has a Class-Path element*
    specified in the manifest,the content of the Class-Path element has to be on the projects runtime path.
    I'M SORRY BUT I DID NOT UNDERSTAND WHAT IS MEANT BY: what is "the projects runtime path"?
    the content of my manifest is:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.1
    Created-By: 10.0-b23 (Sun Microsystems Inc.)
    Main-Class: hequalifies.ui.HeQualifies
    Class-Path: lib/PlugIn
    X-COMMENT: Main-Class will be added automatically by build
    I'm having problem with lib/plugin.

  • Starting jar-files in Windows XP

    I've installed the latest JDK a while ago and everything went smooth until I installed a program to open zip-files (Filzip). After installing this it claimed responsibility for jar-files too, associating the .jar with it.
    Now all .jar files are of the type 'Filzip' and are being opened by that program. How can I get Windows XP to associate jar-files to java again?
    P.S.: I've tried to make Filzip not to open jar-files anymore, but I was not successful.

    not true. You can edit the manifest file, its just
    plain text.Well, basically I don't change programs other people wrote. Eather they work, or they don't. Call me a 'stupid user'...
    I don't think I really get your problem. You say you
    are trying to open a jar file, but jar's are
    associated with some zip program... but the zip
    program will only try to open the jar file if u double
    click the file itself... it makes NO difference if
    you are entering the java -jar command at the console.Here is what I'm talking about.
    1.) console
    java ptpicker.jarException in thread "main" java.lang.NoClassDefFoundError: ptpicker/jar
    java -jar ptpicker.jar(program starts...)
    2.) desktop
    .jar files are of type "Filzip" but I have associated them to start with "java.exe". Due to the reason that I can't pass the '-jar' parameter in Windows XP it exits with NoClassDefFoundError.

  • How to start java app with many jar files

    Hi,
    I have an application that makes use of 50 jar files. When I try to start the application, I need a very long command line like
    java -classpath file1.jar;file2.jar;file3.jar; ... de.me.myapp.myclass
    This is not very handy. Is there a shorter way if all jars are in the same directory? I would like a command like this:
    java -cp /usr/local/my_jars de.me.myapp.myclass
    but this does not work.
    Any Idea if there is an easy solution?
    Andreas

    aaa801 wrote:
    i think there was a way to do it but it eather only worked with javac or java exe which is a lil problem but i did -cp .;./*.jar or something of that sortAs of Java 6, the classpath can contain wildcards.
    http://java.sun.com/javase/6/docs/technotes/tools/solaris/classpath.html

  • Adding patch jar file while starting Managed Server through Node Manager

    Hi,
    I am using Weblogic Express 10.0 on Linux env, Jrockit JVM.
    I have a patch jar file from BEA, I added it to Weblogic start script, when I start the Managed server by using startManagedWeblogic.sh script, I can see that patch jar file is added to classpath when I grep for Java process.(ps -ef | grep -i java).
    But when I start the Managed server through NodeManager and grep for java process, I dont see the patch jar file added to classpath of Managed server process which is started.
    Can someone let me know if I have to add the patch jar file somewhere else along with Weblogic start script if starting Managed server through Node Manager?
    Weblogic Consultant

    Thanks for your response.
    I found another way to do this.
    Edit nodemanager.properties file and set StartScriptEnabled=true (By default it is false), and then restart the Node Manager process.
    Enabling this setting to true will enable the NodeManager process to use startManagedWeblogic.sh script while starting the managed server, all the added jar files, memory settings will be taken from start script of Weblogic
    Weblogic Consultant

Maybe you are looking for

  • Freight provision

    Hi Friends, We have a framework order that got an unwanted condition type FRA2 entered with a value. Goods reciept and Invoice has been done already. Looking at the accounting doc, the amount has been posted to Frieght provision G/L Account and GR/IR

  • Connecting a Dell 1100 laser printer to iMacs

    I have a two iMacs (one is brand new and one is 4 years old) and want to connect a Dell 1100 laser printer to them. Is this possible to do and if yes what software do I need (and where can I get it)? Thanks!

  • System error in program CL_RSR_CLIENT and form MENU_SEL_ITEM

    Hi, After a system copy (BWP to BWT) we encounter a problem with reports containing documents the BWT environment. At first I thought it was a problem with the Java stack, but now I am not so sure anymore. When running a report in RSRT (for example i

  • Bapi BAPI_NETWORK_COMP_ADD

    Hi, I am using bapi BAPI_NETWORK_COMP_ADD to post(Confirm) the network activity data. For the multiple records the very first record is being posted by the bapi and for the rest records error message is being shown as  ' Order (network no.) is alread

  • Picture Preview Blank

    Hello all, When I click on a photo that I want to use in iMovie, the preview is a blank. That is with or without the Ken Burns effect turned on. It is not all photos. Seems to be those over about 1MB taken with an SLR camera. Any ideas? The photos ar