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.

Similar Messages

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

  • Error when duble click on executable jar file

    when duble click on jar file I get error message " Could not find main class . program will exit" , I am using jre 1.5_04,
    when I runnig from command - java -jar ./myJar.jar --> works fine.
    when I runnig from command - java -cp ./classes myUi --> works fine.
    I get the error just when I try to execute the jar by duble click.
    it some one knows what can be the problem??
    Thanks
    Nir

    The message bar says " The following disk image couldn't be opened"... As for reason... "Not recognized"

  • Executable Jar file, please help!!!

    I know this has been posted many times before, but Im going insane, and nothing is working, I will now have spent more time trying to make an executable jar file, than the time I spent actually writing the program, here's my problem
    I got two classes, tictactoe.class, and whichBox.class, I want to make a jar file, I have tried many types of manifest files, none worked, my Main() is in tictactoe.class, if ANYONE can help me get this working I will give them dukes!!!!!

    I know this has been posted many times before, but Im
    going insane, and nothing is working, I will now have
    spent more time trying to make an executable jar file,
    than the time I spent actually writing the program,
    here's my problem
    I got two classes, tictactoe.class, and
    whichBox.class, I want to make a jar file, I have
    tried many types of manifest files, none worked, my
    Main() is in tictactoe.class, if ANYONE can help me
    get this working I will give them dukes!!!!!
    your manifest file should look like this...
    Manifest-Version: 1.0
    Main-Class: tictactoeplease note there must be a line return at the end of tictactoe. so the file should have three lines.
    if you have this correct the only other thing i can suggest is are you sure it is your manifest file that is being added to the jar.
    your jar command should look like the following assuming the jar files is called Game, your manifest is called game.mf and both files reside in the default package.
    jar -cvfm Game.jar game.mf *.class hope this helps.

  • Class not found error while executing jar file

    I have written a java code in which i am connecting to database....when i run the class file using......java class_filename it works........
    but when i run the jar file using .......java -jar jar_name ...yi gives me the error as 'Class not found'......
    can anybody help me please......
    Thanks and Regards,
    Siddhesh

    that class is part of jar file.....in classpath i have included zip files for jdbc ...to get databse connection.....and the jar being executed ................still it gives the error ClassDefnotfound which i think is due to database connection problem.....the exception is raised while.....
    Class.ForName("Driver_name").newInstance();/ This driver is present in zip files that i have added in classpath....
    above statement doesn,t giv error while i execute the class file............but exception while executing jar file only..
    Thnaks and regards,
    siddhesh

  • Got error when trying to generate Java proxy jar file for webservice

    Hi,
    I am having a warning message when trying to generate java proxy jar file on weblogic8.1
    webservice test web app, the message is as follows:
    "Warning Failed to generate client proxy from WSDL definition for this service.
    Prescription Please verify the <types> section of the WSDL."
    in the mean time, on weblogic starting terminal, I saw the following exceptions,
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\AlphaLength4Deserializer.java:36: cannot resolve symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkLengthFacet(__typed_obj,4L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\OSIFieldAnonTypeDeserializer.java:36: cannot resolve symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkMaxLengthFacet(__typed_obj,69L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\AlphaLength2Deserializer.java:36: cannot resolve symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkLengthFacet(__typed_obj,2L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\FreeFormAnonTypeDeserializer.java:36: cannot resolve symbol
    symbol : class FacetUtils"
    Can anybody help me about this issue? I attached WSDL file, also United Airlines
    got an enterprise weblogic license deal with BEA, any help will be highly appreciated.
    Thanks!!!
    Naichen
    [ModifyPNRWSContract.wsdl]

    Hi Naichen,
    I was able to successfully run both the autotype and clientgen Ant task, on the
    WSDL you provided. The code behind those Ant tasks are pretty much what the WebLogic
    Web Services test page run. Are you using WLS 8.1 SP2? If not, you might want
    to try with that version.
    Regards,
    Mike Wooten
    "Naichen Liu" <[email protected]> wrote:
    >
    >
    >
    Hi,
    I am having a warning message when trying to generate java proxy jar
    file on weblogic8.1
    webservice test web app, the message is as follows:
    "Warning Failed to generate client proxy from WSDL definition for this
    service.
    Prescription Please verify the <types> section of the WSDL."
    in the mean time, on weblogic starting terminal, I saw the following
    exceptions,
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\AlphaLength4Deserializer.java:36: cannot resolve symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkLengthFacet(__typed_obj,4L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\OSIFieldAnonTypeDeserializer.java:36: cannot resolve
    symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkMaxLengthFacet(__typed_obj,69L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\AlphaLength2Deserializer.java:36: cannot resolve symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkLengthFacet(__typed_obj,2L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\FreeFormAnonTypeDeserializer.java:36: cannot resolve
    symbol
    symbol : class FacetUtils"
    Can anybody help me about this issue? I attached WSDL file, also United
    Airlines
    got an enterprise weblogic license deal with BEA, any help will be highly
    appreciated.
    Thanks!!!
    Naichen

  • Error when trying to run the rcu.bat file as part of OBIEE 11g installation

    when trying to run the rcu.bat file as part of OBIEE 11g installation on windows 7 64 bit I am getting the following error
    "windows cannot find C:\Users\manoj\Desktop\Oracle.Make sure you typed the name correctly, and then try again".
    Please help me how to overcome this error, I am not able to understand why it is looking for C:\Users\manoj\Desktop\Oracle.
    Thanks
    Manoj

    after setting the ORACLE_HOME and Path environment variables also....I am still getting the same error...so is it like RCU can be run only on windows 7 32-bit machines and it does not work on 64-bit machines? and also it seems like the previous versions of OBIEE 10.1.3.X does not support windows 7 64-bit machines...
    please help me finding a solution to this error....
    and what are all the versions of OBIEE can be installed on windows 7 64-bit machines?
    can't we install OBIEE 11g on windows 7 64-bit machines without including RCU?
    thanks
    Manoj
    Edited by: mkumar on Jun 2, 2011 3:47 AM

  • Executable Jar files can't be run without command line

    Hello,
    A few months ago, I was messing with some executable jar files, but now I can't run them anymore without a batch file or command line, so how do I fix this?
    Thanks in advance,
    Yves W.
    Edited by: Yves W on 18-dec-2010 15:56

    Open a command prompt.
    Type
    assoc .jarYou should get:
    .jar=jarfileIf not, type:
    assoc .jar=jarfileNow type:
    ftype jarfileYou should get something like this (adjust the path to javaw.exe for your system):
    jarfile="C:\Program Files\Java\jre6\bin\javaw.exe" -jar "%1" %*If not, type (adjust the path to javaw.exe for your system):
    ftype jarfile="C:\Program Files\Java\jre6\bin\javaw.exe" -jar "%1" %*

  • Executable JAR file: Could not find the main class.

    Hello,
    I have a problem with making an executable JAR file.
    I have written a JAVA program that consists of five different classes of which User.java is the main class and I have saved a text document with Main-Class: User and a blank line after that.
    If I try:
    jar cmf MainClass.txt User.jar User.class Beheerder.class Operator.class Manager.class MaakVisueelSchema.class
    it makes a executable jar file which actually works! :)
    But when the Operator class trys to open the MaakVisueelSchema class the screen stays blank.
    I can run MaakVisueelSchema with java MaakVisueelSchema.
    So I tried to make an executable JAR that consists only of MaakVisueelSchema, the same way as I did for User:
    Main-Class: MaakVisueelSchema
    jar cmf MainClass.txt MaakVisueelSchema.jar MaakVisueelSchema.class
    Then I get the error message:
    Could not find the main class. Program will exit.
    from the Java Virtual Machine Launcher.
    The big difference between MaakVisueelSchema and the other classes is that MaakVisueelSchema contains a PaintComponent method and an ComponentListener. Is it possible that one of those creates the error?
    Can anyone help me with this problem?
    Thanks in advance!
    Bye!

    Yes,
    I tried:
    jar xvf MaakVisueelSchema.jar
    and it returns:
    META-INF/
    META-INF/MANIFEST.MF
    MaakVisueelSchema.classN/G. You need to manually create a manifest file in a text editor, have it point to your main class, and enter it in your jar command as an argument.

  • [b]Simple Deploy problem- making an Executable JAR File ...PLEASE HELP [/b]

    Hi all,
    I Trying to deploy a simple J2SE app by making an Executable JAR File, however I don'r understand how to add a valid value to the Main Class field.
    I followed the following description within Jdev, after creating a Deployment Profile:
    Deploying an Executable JAR File
    You can make your simple archive or J2EE Client Module into an executable JAR file that you can launch with the java command.
    To deploy an executable JAR file:
    1) Select and right-click the simple archive or client icon in the Navigator to display the context menu.
    2) Choose Properties.
    3) Click JAR Options in the tree.
    4) Select Include Manifest File (META-INF/MANIFEST.MF).
    5) In the Main Class field, enter the fully qualified name of the application class that is to be invoked.
    7) Click OK.
    8) Launch the executable JAR file from the command line:
    java -jar myapp.jar
    where myapp represents your JAR file name.
    Like I said it's in 5) I'm doing something worng
    My deploy-file (PlotPrint.deploy) looks the following:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <client-deployment xmlns="http://xmlns.oracle.com/jdeveloper/903/deploy/j2ee-client-jar" nselem="client-deployment" class="oracle.jdeveloper.deploy.jar.ClientProfile">
    <archiveOptions>
    <additionalManifests/>
    <compressed>false</compressed>
    <hasManifest>true</hasManifest>
    <mainClass>PlotPrintClient</mainClass>
    </archiveOptions>
    <archiveTargetPlatform/>
    <cdaSettings>
    <additionalArchives/>
    <afterFilters/>
    <beforeFilters/>
    <duringFilters/>
    <selectedArchives>
    <archives>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/jdbc/lib/classes12.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/jdbc/lib/nls_charset12.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/jdev/lib/jdev-rt.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/soap/lib/soap.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/lib/xmlparserv2.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/jlib/javax-ssl-1_2.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/jlib/jssl-1_2.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/j2ee/home/lib/activation.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/j2ee/home/lib/mail.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/j2ee/home/lib/http_client.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/webservices/lib/wsdl.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/lib/xmlparserv2.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/lib/xmlcomp.jar!/"/>
    </archives>
    <selectionMode>0</selectionMode>
    </selectedArchives>
    </cdaSettings>
    <defaultConnection class="java.lang.String"/>
    <deployClientMaxHeapSize/>
    <earURL path="deploy/PlotPrint.ear"/>
    <enterpriseAppName/>
    <jarURL path="deploy/PlotPrint.jar"/>
    <profileDeps/>
    <properties/>
    <selectedProjectFiles>
    <autoInclude>true</autoInclude>
    <deploySourceAs>0</deploySourceAs>
    <files class="[Ljava.net.URL;"/>
    <selectionFilters/>
    </selectedProjectFiles>
    </client-deployment>
    I using Oracle9i Jdev, but have also tried it un the new Jdev 10g version, but the same problem everytime:
    Error message: Could not find the main class: program will exit.
    Please help I really need this to work
    Message was edited by:
    MHCI
    Message was edited by:
    MHCI

    Yes that was the problem so I have changed the element mainClass to
    <mainClass>xxPlotPrint.MHCI.PlotPrintClient</mainClass>
    But now another probem has occured, since I get the following error when run the jar-file (When I run the app from within Jdev there are no warnings or errors).
    ----Batch-file-----
    @echo off
    java -jar PlotPrint.jar
    echo Test Plot and Print Batch-file!
    pause
    ---- out to cmd ----
    Exception in thread "Thread-0" java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl
    at xxPlotPrint.MHCI.NNE35_worker.run(NNE35_worker.java:42)
    at java.lang.Thread.run(Unknown Source)
    Exception in thread "Thread-2" java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl
    at xxPlotPrint.MHCI.OCEJobDB_worker.run(OCEJobDB_worker.java:41)
    at java.lang.Thread.run(Unknown Source)
    Exception in thread "Thread-1" java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl
    at xxPlotPrint.MHCI.NNE27_worker.run(NNE27_worker.java:42)
    at java.lang.Thread.run(Unknown Source)
    It's the same problem in all three exceptions (the exactly the same code), however I was a bit to quick this is the line (the line before I process the xml doc :-)
    import org.w3c.dom.Element;
    responseData = new Vector();
    responseData = test_NNE35_SOAP.getXSDdoc();
    Element elements = ( (org.w3c.dom.Element)responseData.elementAt(0) ); (line 42)
    Please help I don't understad why I receive this exception, since I included the xmlparserv2.jar file, and don't even have a workaround :-(

  • Executable Jar files with Oracle drivers and Oracle classes

    I have a program which works perfectly that is used to do file
    maintenace on an oracle table. Now I am ready to make this into
    an executable jar file. I know how to do this, but my problem is
    now how do I get the Oracle classes into my jar? I think they
    are all in classes12.zip, but just adding classes12.zip into the
    jar doesnt work. I still get an error when running the program
    that says it can't find oracle.jdbc.drivers.oracledriver.
    You can use the jar command to add all classes in a directory,
    but this doesnt work either.
    Has anyone out there ever done this? Please help if you know how
    to do this. How do you put the oracle classes into you
    executable jar file?
    Wah!!!

    Me again. I forgot to mention that I am only using Java. We
    don't have Oracle forms or jdeveloper. This is just straight
    java. Everything worked until I tried to executable jar creation.

  • Creating an executable jar-file including a custom package

    I am trying to learn how to create executable jar-files. I have managed this with a single class. However having a class which is an extention of another class which in turn belongs to custom package, I can't make it work.Running the program normally is not a problem. I don't think the problem is the actual code, but I will include it here anyway. I create the jar-file using:
    jar -cmf Direkt2b.txt Direkt2b.jar *.class
    where Direkt2b.txt is just:
    Main-Class: Diriekt2b
    Only the main class-file is included this way. Copying the other file to the same directory before creation doesn't help either. There is no error messages, the jar-file just refuses to run no matter what.
    The main-class:
    import java.awt.*;
    import extra.*;
    class Direkt2b extends ExtendedFrame {
         Font f;
         Direkt2b() {
              f = new Font("SansSerif", Font.BOLD, 24);
              setBackground(Color.yellow);
              setSize(400,150);
         public void paint(Graphics g) {
              g.setFont(f);
              g.setColor(Color.blue);
              g.drawString("V?lkommen till Java Direkt", 45, 100);
         public static void main (String[] arg) {
              Direkt2b d2 = new Direkt2b();
              d2.setVisible(true);
    The help-class:
    package extra;
    import java.awt.*;
    import java.awt.event.*;
    public class ExtendedFrame extends Frame {
         private static boolean first = true;
         private boolean isFirst = first;
         public ExtendedFrame() {
              addWindowListener(theListener);
              first=false;
         WindowAdapter theListener = new WindowAdapter () {
              public void windowClosing(WindowEvent e) {
              dispose();
              if (isFirst)
                   System.exit(0);
    }

    My problem wasn't really getting more than one class in a jar-file,
    but rather that my jar-file with multiple classes wouldn't execute.
    Reading the original post I realized that maybe I was unclear about that.
    However I have solved the problem now so for anybody reading this
    thread in the future I will tell you how.
    The general setting is this: You have a bunch of self-made help-classes
    organized in some classdirectory somewhere in the filesystem. You use these
    in your programming from time to time. You have set a classpath-varible
    in your OS such that Java could find your help-classes.
    Now you want to create executable jar-files so that you could publish your work.
    My problem was that while I added all needed classes in a jar-file, the main-class
    couldn't find the others because they were referenced incorrectly. The solution I
    came up with may not be elegant, but it works. I copied the main-class and all directories
    (only one in my case) just as they appear in the classpath-directory, to the same temporary
    directory. Then I created the jar-file from there, using: jar -cmfv Direkt2b.txt Direkt2b.jar Direkt2b.class extra/*.class
    I suspected that incorrect referencing was the problem and I tried several variations on the theme above
    before giving up and writing the first post. Part the problem was that I didn't get any error messages,
    just an annoying error-sound double-clicking the jar-file. I learned later that you could run jar-files from
    the command -prompt using: java -jar myjarfile.jar. This way you get a more useful response.
    I guess there is a way to include the classpath instead somehow, but I will use my method for now.
    I hope this was helpful to somebody.

  • Can't Execute JAR file deployed from JDev 903

    Hi Everyone:
    I took the Oracle beginning Java class, and got a copy of JDeveloper 9, and started in on a project. The task was to create a small module that will allow users with no direct SQL access to change their Oracle passwords. The good news is that it runs great from within JDev; it catches exceptions cleanly, it handles multiple databases with no problems. The bad news is that I cannot get it to run from a batch file or command line (client is Windows). I have run 'setvars', I have copied the CLASSPATH from the run window in JDev, all to no avail.
    I am trying to deploy the app as an executable jar file. It's not meant to be an applet, because of the security implications.
    I would gladly RTFM, but the FM's that I have gloss over the deployment step in Jdev. I figure it's something obvious, but I just cannot figure it out.
    Any suggestions? Help a newbie...
    Thanks,
    Mike

    Hi Mike,
    I suggest you take a look at the log window of JDev, when you've successfully run your project.
    If the log window is not displayed, go to View | Log.
    Cut the command line, invoking javaw.exe, and paste it into your favorite editor.
    Change javaw.exe into java.exe, save your file as a bat file, go in a DOS console, and run the bat file.
    Let me know if it fixes your problem.
    Thanks,
    - Olivier

  • Executable jar files and manifest file

    Hi,
    I have the following files in a folder named: Test
    a.jar
    b.jar
    c.jar
    Driver.class
    Driver.mf
    Here, MainClass is the main executable class that uses a,band c.jar files. This is how my MainClass.mf file looks:
    Manifest-Version: 1.0
    Main-Class: Driver
    Class-Path: a.jar b.jar c.jar
    Now I use the following command to make one executable jar file:
    jar cmf Driver.mf DriverMain.jar *
    It creates an executable jar file named : DriverMain.jar
    Now I copy the executable jar file (DriverMain.jar) into a different folder named: RunTest
    and double click it, doesn't work.
    my question is:
    what am I doing wrong? Any special characters needed in my Driver.mf file (space/newline/etc)?
    What I am trying to get is: One execuatble jar file so I can just double click to run it, and that single executable jar file will have all the necessary jars in it (i.e. a.jar, b.jar, c.jar in this case)
    Anyone please help!
    Thanks
    -Ron

    Rony,
    Sorry to disappoint, but you can not use embeded jar/zip files within an executable jar. The JDK sadly for some reason decided this was not a useful idea, so developers like me who want to distribute plugins with thier own dependencies have one of two choices. You either have to unzip the jar file that contains the embeded jars to a directory, then run your primary exectuable jar, OR you have to write a custom classloader that your "launcher" creates then loads the embeded jar files.
    The best thing to do is either jar up a, b, c and driver into one jar, so that it works, if you can legally do this. A lot of 3rd party libraries may not allow this per their license. Otherwise, another choice is to use a free installer or buy an installer that allows you to distribute a single exectuable installer program that will properly create the dir structure you need.
    As for the way it works, if you declare:
    Class-Path: a.jar b.jar c.jar
    the JAR loader code in the JDK looks in the root dir where your application was started for a/b/c jar files. They have to be on disk.
    If you want to place them in /lib, for example, you would havd a jar file like:
    Driver.class
    Driver.mf
    lib/a.jar
    lib/b.jar
    lib/c.jar
    When unzipped, your "root" dir would look exactly like the above, and your manifest would have Class-Path using ./lib/a.jar ./lib/b.jar ./lib/c.jar
    Anyway, there thus far isn't any way around this issue of embeding jar files in an executable jar file. You MIGHT be able to not specify any classpath, then in your Driver.class, create a new custom classloader that dervies from URLClassLoader, but in the findClass(), you get a ref to the .jar file that the classloader class is inside of, and from that use it to find the lib/*.jar files and add them to the classpath. For this to work, however, your Driver.class code should ALSO be contained in an embeded jar file that is loaded by this custom loader. The only thing Driver.class would contain (and I would rename it to something like Launcher) is the code to create the custom classloader.
    It's fun stuff, but a little bit of work to make it work. You can infact make it work! I may yet one day take our plugin engine custom loader and create a way for this to work!

  • Why -jar option used to install a software which is in executable jar file?

    Hi all,
    i have a query, i have a generic installer which is used to install the oracle weblogic 10.3 software in unix platform(i.e., which is in .jar extension) which is executable jar file.
    To install this software which have to use -jar option to install
    java -jar net_server<version>_generic.jar
    my question that why we use -jar option to install or to extract the software
    can any one clarify my doubt...
    thanks in advance
    abhi
    Edited by: sumanth_abhi on Jan 27, 2009 11:50 PM

    According to the Jar Guide (http://java.sun.com/j2se/1.4.2/docs/guide/jar/jarGuide.html)
    Executable Jar Files
    On Microsoft Windows systems, the Java 2 Runtime Environment's installation program will register a default association for Jar files so that double-clicking a Jar file on the desktop will automatically run it with javaw -jar. Dependent extensions bundled with the application will also be loaded automatically. This feature makes the end-user runtime environment easier to use on Microsoft Windows systems.
    The Solaris 2.6 kernel has already been extended to recognize the special "magic" number that identifies a Jar file, and to invoke java -jar on such a Jar file as if it were a native Solaris executable. A application packaged in a Jar file can thus be executed directly from the command line or by clicking an icon on the CDE desktop.
    Despite that every JAR file can be executed as a program if and only if the META-INF/Manifest.mf contains the Main-Class tag. This done through java -jar jarfile.jar
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • Best practice to update an Iterator after commit

    Hi, I am using JDeveloper 11.1.1.6. I have basically two sections on my page. First section is one region showing status of the Row contained on my second section of the page. In my second section contains UIComponents to update/create Row informatio

  • IMac G5 17-inch display slowly getting brighter

    I have a 3-year old iMac G5. The 17" display is slowly getting a brighter and brighter white point and is noticeably blowing away subtle lighter colors. Adjusting brightness or recalibrating the monitor doesn't seem to work. Is there a way to fix thi

  • Nat Geo HD ... Two issues

    1. EPG not showing content past midnight AGAIN.  2. Every 20-30 mins, channel loses synch, resullts in crash sound and picture breakup to green screen before recovering a couple of seconds later. Needs looking at. No other channel is affected.  Solve

  • How To Install Verizon Access Manager If It Fails Installation

    If you're unable to install the Verizon Access Manager on your PC the program will work just fine without installing it! I performed the following on two different Windows XP SP3 machines and the Verizon Access Managers work fine on both. 1. Download

  • Performa 6320CD ethernet connection?

    Okay, so I have a Performa 6320CD running System 7.5.3 (soon to be 8.1) and with a Sonic Systems Commslot I Ethernet card going directly to a cable modem hooked directly into a cable jack. It gives me an option to switch to Ethertalk, but gives me a