Arrangement of jar containing main class

Hello all,
usually it is required, that that jar file (let me call it "main jar"), which contains the main class (by which the application is entered), has to be the first jar in the order of the jar files within <resources> of the jnlp file.
Now if a patch of the "main jar" is created which doesn't contain the main class, where has this patch jar to be arranged in the jnlp file? Because it is a patch jar, usually it must be arranged in front of this main jar, that it is read before the main jar to load the patched class correctly. On the other hand it is required, that the jar with the main class has to be the first ...
Therefore again: Where has that patch jar, described, to be arranged?
Thanks for all good advices.
Thomas

The main jar does not need to be first, if you explicitly add the argument main="true":
<jar href="jar2.jar"/>
<jar href="jar1patch.jar" />
<jar href="jar1.jar" main="true"/>
the first jar is used as main only if there is no jar listed with main="true".
/Andy

Similar Messages

  • Where is jar containing  XMLImporter class is located ?

    Hi all,
    I am trying to use import script to import some custom region to ebs server. But I get exception of class not found.
    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/jrad/tools/xml/importer/XMLImporter
    Caused by: java.lang.ClassNotFoundException: oracle.jrad.tools.xml.importer.XMLImporter
    I would like to know where is the jar file located ( and exact jar name ) containing the above mentioned classe XMLImporter and others like JPXImporter are located.
    regards

    Hi Kali,
    This the script i used (invoked from JDEV_LOCATION/jdevbin/oaext/bin ... there is no import script in jdevbin/jdev/bin ).
    ./import ../../../jdevhome/jdev/myprojects/xxmy/oracle/apps/per/selfservice/competency/profile/webui/region1.xml -rootdir ../../../jdevhome/jdev/myprojects -username apps -password apps -dbconnection "(description = (address_list = (address = (community =tcp.world)(protocol = tcp)(host =172.16.7.254)(port = 1521)))(connect_data = (sid = VIS)))"
    when run it throws exception
    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/jrad/tools/xml/importer/XMLImporter
    Caused by: java.lang.ClassNotFoundException: oracle.jrad.tools.xml.importer.XMLImporter
         at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    Could not find the main class: oracle.jrad.tools.xml.importer.XMLImporter. Program will exit.
    Regards
    Edited by: user1459178 on Mar 31, 2011 1:56 AM
    Edited by: user1459178 on Mar 31, 2011 1:57 AM

  • How to deploy a simple .jar (containing Helper classes) in Weblogic?

    Hi,
    I have created multiple .jar files.
    1) MDB.jar containing all my MDB classes.
    2) Bean.jar containing all my Session Bean classes.
    3) Utility.jar containing remaining Helper,utility classes.
    I had deployed MDB.jar, Bean.jar by using Weblogic Console, under 'Deployments'-> 'EJB Module'. How can i deploy Utility.jar ? First of all, do i need to deploy Utility.jar? Only EJB JARs need to be deployed?
    If we do not deploy a non-EJB JARs, how this code will be available and is executed?
    Thanks in advance.

    I'd recommend you deploy these 3 components together in an EAR file. THe utility jar file could go in APP-INF/lib, or you could reference it via manifest class-path entries.
    -- Rob
    WLS Blog http://dev2dev.bea.com/blog/rwoollen/

  • Creating a JAR with main class def.

    Hello Amigos,
    I am having problems creating a jar file. My problem is that when I create the jar file and insert this line in my manifest file
    Main-Class: classnamewhere classname is what ever class you want as explain here:
    http://java.sun.com/developer/Books/javaprogramming/JAR/basics/run.html
    Then I have the jar file and double click it and get the Fail to load Main-Class error.
    This is what I am typing in the command line:
    jar cmf MANIFEST.MF myapp.jar *.class
    When I go back and extract all the files out of the jar file the manifest files looks like this:
    Manifest-Version: 1.0
    Created-By: 1.3.1 (IBM Corporation)Thanks in advance

    No ofense but... You got to be kidding me!?!?!Not kidding at all. Had you read the online tutorial, you'd have found the following line:
    Warning: The text file must end with a new line or carriage return. The last line will not be parsed properly if it does not end with a new line or carriage return.
    Have you tried it yet?

  • Which jar contains INavigationMimeRepositoryService class

    I am reviewing the code to build my own version of a workset map.  I'm missing a jar file.  Does anyone know where I might find the jar file containing
    INavigationMimeRepositoryService?
    The code in question is
    INavigationMimeRepositoryService mimeRepositoryService = (INavigationMimeRepositoryService)PortalRuntime.getRuntimeResources().getService("com.sap.portal.navigation.mimeservice.navigation_mime_repository");
    I cannot do a build as the INavigationMimeRepositoryService cannot be resolved.
    Regards,
    Diane Fuller

    Hi,
    the jar file in question is com.sap.portal.navigation.api_mimeservice_api.jar
    You can find it under portalapps/com.sap.portal.navigation.api_mimeservice/lib/
    I recommend the use of the class locator in
    nwds:
    [http://classlocator.sourceforge.net/]
    Best regards,
    Avishai Zamir

  • Java can't find main class when manifest has certain JARs on it

    I recently wrote an Ant script that builds my application and jars it up, creating a manifest in the process. The manifest specifies the main class and a classpath that mentions other jars that exist in the same directory. Everything works as expected and I am able to run the program using "java -jar abc.jar".
    However, I recently started using classes in my program that come from a jar that should (according to the company I work for) reside in a central location rather than each application having its own copy. So, I changed my build script to reference those shared jars in a common location. But now when I run "java -jar abc.jar", I get a java.lang.ClassNotFoundException: com.example.Main. If I edit the jar's manifest and manually remove the new jars from the classpath, the ClassNotFoundException error goes away (although obviously that causes other problems.) Is there something about adding those new jars to the manifest classpath that would prevent Java from finding my main class? My manifest looks something like this and the last two jars (the ones with the absolute paths) are the jars that seem to be the root of the problem.
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.0
    Created-By: 1.5.0_04-b05 (Sun Microsystems Inc.)
    Main-Class: com.uprr.app.rsa.Main
    Class-Path: acegi-security-1.0.6.jar commons-codec-1.4.jar commons-htt
    pclient-3.1.jar commons-lang-2.4.jar commons-logging-1.1.1.jar common
    s-pool-1.5.4.jar dom4j-1.6.1.jar jakarta-oro-2.0.8.jar jaxen-1.1.1.ja
    r jibx-run-1.2.1.jar joda-time-1.6.jar jsr173_1.0_api.jar log4j-1.2.1
    5.jar opensaml-1.1.jar spring-2.5.2.jar stax-api-1.0.1.jar wstx-asl-3
    .2.9.jar xmf-3.0.2.jar xmlsec-1.4.1.jar C:\software\tibco\ems\clients
    \java\jms.jar C:\software\tibco\ems\clients\java\tibjms.jarAny ideas?
    Brandon

    I still don't know why giving the absolute classpath entry like that would cause Java to be unable to find the jar's main class, but I did make an interesting discovery. If I give the absolute path without the drive letter, is able to find the main class again. Something like this won't work...
    Class-Path: C:\software\tibco\ems\clients\java\tibjms.jarBut something like this will...
    Class-Path: \software\tibco\ems\clients\java\tibjms.jarBut I'd still like to know why Java doesn't accept drive letters when running on a Windows machine. After all, what if my manifest needed to reference a jar that was on a different drive, like a network drive (since this whole problem came up as a result of shared common jars that need to exist outside of the project.)

  • Jar containing com.bea.content.repo.i18n.FileRepoExceptionTextFormatter

    i am getting this error while deploying my application containing ejbs: -
    java.lang.NoClassDefFoundError: Class not found: <b>com.bea.content.repo.i18n.FileRepoExceptionTextFormatter</b>
    Can some on one please tell me which jar contains this class. Thankx.
    Regards,
    Yazad Khambata.;-)

    i got same error,expecting answer。。。。。。

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

  • Jar file could not find main class.. I cant see why?

    I have read loads of tutorials on this and it should be very straight forward but i STILL cant make a working jar file of my program.. please see if you can see anything wrong with what im doing..
    my program is one .java file that compiles perfectly, and is runnable both through eclipse and by using the command prompt.. i made a jar file using both eclipse and the command prompt, and neither worked.. every time i run it by double clicking it i get the error "could not find main class, program will exit". here is the contents of my jar:
    CorePackage\IPEmailer.class
    CorePackage\IPEmailer$1.class
    CorePackage\IPEmailer$SMTPAuthenticator.class
    META-INF\MANIFEST.MF
    the MANIFEST.MF file contains:
    Manifest-Version: 1.0
    Class-path: .
    Created-By: 1.6.0_02 (Sun Microsystems Inc.)
    Main-Class: CorePackage.IPEmailer
    (yes there is a blank line at the end)
    the class mentioned in 'Main-Class' has a main method that looks like this:
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        new IPEmailer();
    }the program uses 2 external jar files:
    activation.jar
    mail.jar
    and reads a file called:
    ipemailer.ini
    and writes a file called:
    ip.txt
    the program has no GUI and is intended to run 'silently' in the background
    please help me understand what is wrong with this

    package CorePackage;
    import javax.mail.*;
    import javax.mail.Authenticator;
    import javax.mail.PasswordAuthentication;
    import javax.mail.internet.*;
    import java.util.*;
    import java.io.*;
    import java.net.*;
    public class IPEmailer implements Runnable{
          * @param args
         String recipientsinput[]={""};
         String subject;
         String body;
         String server;
         String user;
         String pass;
         String from;
         String urlString = "http://www.whatismyip.org";
         String currentIP;
         String ipFromFile;
         boolean webFailed;
         long interval = 900000; //15 mins
         long oldInterval;
         Thread t = new Thread(this);
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              new IPEmailer();
         public IPEmailer(){
                         ..........etccould the problem be that the class is a thread? i cant see why it would be, but ive never made a jar where the main class also 'implements runnable'

  • JRE doesn't find the main class inside a JAR archive file

    Hello everybody,
    I've written a small application in Java, using NetBeans. Running my application inside NetBeans works fine, but I can't run it from the console or by double clicking the jar file.
    Running it from the console I get the following error message:
    java -jar TestApplication.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: tst.Benchmark
       at gnu.java.lang.MainThread.run(libgcj.so.81)
    Caused by: java.lang.ClassNotFoundException: tst.Benchmark not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:TestApplication.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
       at java.net.URLClassLoader.findClass(libgcj.so.81)
       at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.81)
       at java.lang.ClassLoader.loadClass(libgcj.so.81)
       at java.lang.ClassLoader.loadClass(libgcj.so.81)
       at gnu.java.lang.MainThread.run(libgcj.so.81)I know that these errors often come when the class path is not set in the right way, and using a single java file, you can fix this by passing the parameter "-cp ."
    I tried this with the jar file but it does not work and using "-cp TestApplication.jar tst/Benchmark" didn't work either.
    Inside the jar file I have the META-INF Folder and a "tst" Folder which contains all my class files. And I've set tst.Benchmark as the main class, this also stands in the manifest file correctly.
    Do you have any ideas what could be wrong?
    Greetings JavanianGuy

    This line
    at gnu.java.lang.MainThread.run(libgcj.so.81)says that you're using GNU's Java, not Sun's Java. They are not the same. GNU Java is incomplete.
    You'll need to ask this question at the GNU Java site.
    Recommendation: Use Sun's Java

  • Running JAR files (Could not find the main class error)

    Hi all,
    I'm having a bit of a problem with my app. I created an application with the current Netbeans edition, containing multiple .class files, and a few .jar libraries that are needed too.
    Now I'm having problems with running the .jar that the Netbeans creates, so I figured I'd make a one on my own.
    Okay, this is what I have going on:
    C:\MyApp\ <--- root for the application
    C:\MyApp\src\ <--- this is where the .class files are
    C:\MyApp\lib\ <--- here are the .jar libraries which are needed
    C:\MyApp\jar.exe
    C:\MyApp\Manifest.txt
    Now I have a couple questions.
    1. Is it ok that the .class files all have a "package MyPackage; " thing in the beginning?
    2. How should I proceed on making the Manifest.txt file correctly? I have tried various different outputs and read a few topics here from how it should be done, but I just can't nail it. Currently my Manifest looks like:
    Main-Class: MyPackage/Myapp
    Class-Path: lib/xxx.jar lib/xxx2.jar lib/xxx3.jar
    Any help would be appreciated! Thanks.

    Oh, almost forgot:
    3. The right way to create a jar? I used this:
    C:\MyApp\jar cmf Manifest.txt MyJar.jar src\*.class
    And system is Windows XP.

  • Executable JAR sometimes could not find the main class.

    I have a little task, that seems to be trivial- but I have no idea how to solve the current problem.
    With a double click on my jar, a message comes up: JVM could not find the main class. Program will exit.
    The executable JAR is an export result from eclipse, with a manifest file that contains the right entry to the main class.
    But the curious thing is, that I have tested the little Swing-Application with 3 JRE versions: 1.4.2._06, 1.4.2_09 and 1.5 on Win2K and XP. Every time it works fine, but on one system it fails. (Normally it requires no external classpath settings, no path-entries to work.)
    The ugly system is Win XP with JRE 1.4.2_06 installed.
    Is there anybody with a good hint?
    Please let me know.
    Christiane

    OK, I ll try to explain it in other words:
    It is an executable jar file, with a manifest file that specifies the Main-Class. No other external files or jars or settings needed. Only a simple JDialog initialized from a parent JFrame.
    I d like to start it with a double click from the Win-Explorer, not from command line!
    As a result a dialog from "Java Virtual machine Launcher" displays
    "Could not find the main class. Programm will exit."
    My Problem is, I don t understand the launching process in depth. But I can reproduce the message with the following command:
    wrong:
    javaw -cp OrderAlertTest.jar OrderAlertParentDialog
    -> Error dialog appears
    correct:
    javaw -cp OrderAlertTest.jar apo.order.OrderAlertParentDialog
    -> OK
    Any idea?
    Christiane

  • Could not find the main class error with executable jar

    Hello,
    I have troubles creating an executable jar file and I ran out of ideas how to solve it so I would appreciate some help.
    I have created a jar file with the export function in eclipse
    the Manifest.MF file contains:
    Manifest-Version: 1.0
    Main-Class: view.AppTennisViewI tried starting the file with a batch file which contains following code:
    @echo off
    javaw -classpath c:\TennisHSQLDB_GC2\tennisApp.jar
    @start javaw -jar tennisApp.jar
    exitthe batch file and the jar are both located in c:\TennisHSQLDB_GC2.
    When i try command line I get the same result.
    I also tried alternate statements such as SET CLASSPATH iso javaw -classpath and including the classpath in the manifest file but no luck. It keeps given me the error: could not find the main class. program will exit
    Anyone any suggestions for my problem?

    nevermind, found it.
    classpath in manifest was incorrect

  • "Could not find the main class" when running a jar

    Hi, I'm trying to create and run a jar from my application, but I can't figure out how to properly set an entry-point. Looking at the Java Tutorials http://java.sun.com/docs/books/tutorial/deployment/jar/index.html I still can't get it to work.
    I have a directory myApp, which contains a directory images and some class files, including mainClass.class. I also have a manifest Manifest.txt in the directory myApp with the following line:
    Main-Class: mainClass.class
    + one empty line
    I create a jar successfully, while inside the myApp directory, with the following command:
    jar cfm myApp.jar Manifest.txt *.class images\*.*
    I then proceed to run the jar with the following command:
    java -jar myApp.jar
    and receive the following error:
    Exception in thread "main" java.lang.NoClassDefFoundError: myApp/class
    My completely uneducated guess is that there is something wrong with my manifest. The tutorial says that the line should be:
    Main-Class: MyPackage.MyClass
    I'm assuming that I get the error because I didn't specify a package, which I didn't do because I didn't know what to put there. Do I even have a package?
    Can anyone tell me what I've done wrong? thanks.
    Message was edited by:
    SmurfZG

    One problem is you are specifying a file name instead of a class name. It probably should beMain-Class: mainClassA good test is to run your app before jaring it - if you run it with "java mainClass" then the Main-Class attribute must be mainClass.
    Also class naming conventions say that class names should start with a capital letter - MainClass for example. It is just a convention, but it is easier to get help when you follow conventions.

  • JAR "could not find the main class"

    I'm running applications under XP.
    In my profile:
    I have a lot of problems double clicking on a jar file.... it always gives me this error: "could not find the main class"...
    In other XP profiles:
    All jar files run properly!
    Help me!

    Is your manifest correct? Does it contain the line
    Main-Class: Application
    or
    Main-Class: package/Application
    in the main section of the manifest (case sensitive)? Can the interpreter find all the required class files?
    Stephen

Maybe you are looking for

  • EhP4-Upgrade: error in phase PREP_INPUT/KX_CPYORG

    Hi! I try to execute a EHP4 upgrade for SAP ECC system with EhP Installer. The programm stopps after several repeat attempts in the the phase PREP_INPUT/KX_CPYORG. The error I get is: CURRENTPHASE PREP_INPUT/KX_CPYORG ...started at 20090320163915 Usi

  • How to filter datas  and display in java

    Hi guys. I'm kind of new to Java, I've have a database where values are stored ,i just have to take one column and i got to filter one value and display all . is there a command to filter I just want to do that if that Not wanted value is there to ig

  • "Missing InfoCube 0COPA_C01 in Version A" during migration to BI7.

    Hi, I get "Missing InfoCube 0COPA_C01 in Version A" error message when trying to migrate ZCOMP_CODE Object ( in RSEC_MIGRATION program) when migration from BW3.5 to BI7.0. Does anybody have an idea how I could fix this issue. Thanks, Sruthi.

  • Mac Pro USB ports and bluetooth not working

    I have a Mac Pro (early 2008) Quad-Core Intel Xeon, 2.8 GHz, 4GB ram, Airport card, Magic Mouse. Suddenly the keyboard and wired/bluetooth Mouse are unavailable, so it is not possible to control the computer. The only way I can use it is by using Scr

  • Dust behind screen on n96

    my phone has been annoying me lately! the OS is fine, but there now seems to be a build up of dust behind my screen! its quite annoying in day light! im blowing my phone from all sides to see if it moves, but nothing, i sent it to the repairs center