Create a JAR including third party JARS

How can I export my project into a JAR file also including the third party JARs being used from my application (project)?
I think Eclipse does not support this, does it?
The problem is, that when I export my project into a JAR and then manually put the required JARs into the JAR using WinZip I do get such an Exception:
java.lang.NoClassDefFoundError: oracle/ucp/jdbc/PoolDataSourceFactory
In my project I have a class (Runner.java) with a main method which the user can invoke from command line. Furthermore I have a GUI also with a main method which internally invokes Runner.java. How can I start either of themain methods/classes both in the same JAR?
Thank you.

hi, i have a question.
i have an application that uses different third party
jars. For the moment i make my jar like this :
a) i include all my third party jars (it is working)
or is it better to
b) include the jars in the jnlp file
this is best, leaving the third party jars alone.
if b is better should i :
b1) link to them to another jnlp file, like this :
<extension name ....
If you app needs all-permissions, it is best to do it this way, you can, for example, sign your jar, and then ask for all-permissions in the main jnlp file, then not ask for all-permissions in the extension jnlp file. Or you can ask for all-permission in the extension as well, if the third party jars are signed, and need all-permissions to run properly.
or
b2) just put them as resources
if you don't need all-permissions anywhere, this is easiest.
If you do need all-permissions everywhere, you could also do this, but you would need to sign the third party jars with the same certificate chain as you signed your jar.
If the third party jars are allready signed by the third party, or if all-permissions are only needed in some of the jars, the b1 is beter.
>
Another question :
i sign my jar, but can't access the local file
system. if i use solution a from above, do i have
also to sign the jars that i include in my jar...
You need to add :
<security> <all-permissions/> </security>
to your jnlp file. In that case, all the jars listed as resources in that jnlp file need to be signed, and by the same certificate.
for solution b i think i will have to sign all the
jars... right ?
yes
Thx for your help/Andy

Similar Messages

  • How to include third party .jar files into my jar file

    Hi,
    how do i include a open source third party jar file into an executable jar?
    i have a class called BlogBox.java and it uses org.apache.commons.net.ftp.FTPClient, i want to create an executable file, where do i put the .jar file containing FTPClient aka Apache Commons Net?
    currently i'm getting the following error from when executing my BlogBox.jar
    C:\MyJava\BlogBox>java -jar BlogBox.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient
    at blogbox.BlogBox.<init>(BlogBox.java:27)
    at blogbox.BlogBox.main(BlogBox.java:103)
    Any suggestions? i have searched google and this forum but could not find the solution to my problem, thanks
    [edited msg] do i need to add the classpath at execution or something of the apache commons net library?
    Message was edited by:
    gekkokid

    When you use an executable jar the normal class path
    is ignored, but you can put a classpath inside the
    jar. The usual trick is to place the library jar
    files in a directory inside the application directory
    and direct the manifest file to it. The manifest file
    live in the jar inside the META-INF directory and
    it's called manifest.mf
    The two heavilly used entries are Main-class: and
    Class-path: lines. Class-path just has a
    comma-separated list of library paths.
    The jar utility has a special option to load it up.Thanks :) I created a "/lib" directory, placed in the packages in there and redirected the Class-Path: lib/commons-net-1.4.1.jar
    and it works,
    thank you everyone :)

  • Best way to make a jar with third party jars

    hi, i have a question.
    i have an application that uses different third party jars. For the moment i make my jar like this :
    a) i include all my third party jars (it is working)
    or is it better to
    b) include the jars in the jnlp file
    if b is better should i :
    b1) link to them to another jnlp file, like this :
    <extension name ....
    or
    b2) just put them as resources
    Another question :
    i sign my jar, but can't access the local file system. if i use solution a from above, do i have also to sign the jars that i include in my jar...
    for solution b i think i will have to sign all the jars... right ?
    Thx for your help

    hi, i have a question.
    i have an application that uses different third party
    jars. For the moment i make my jar like this :
    a) i include all my third party jars (it is working)
    or is it better to
    b) include the jars in the jnlp file
    this is best, leaving the third party jars alone.
    if b is better should i :
    b1) link to them to another jnlp file, like this :
    <extension name ....
    If you app needs all-permissions, it is best to do it this way, you can, for example, sign your jar, and then ask for all-permissions in the main jnlp file, then not ask for all-permissions in the extension jnlp file. Or you can ask for all-permission in the extension as well, if the third party jars are signed, and need all-permissions to run properly.
    or
    b2) just put them as resources
    if you don't need all-permissions anywhere, this is easiest.
    If you do need all-permissions everywhere, you could also do this, but you would need to sign the third party jars with the same certificate chain as you signed your jar.
    If the third party jars are allready signed by the third party, or if all-permissions are only needed in some of the jars, the b1 is beter.
    >
    Another question :
    i sign my jar, but can't access the local file
    system. if i use solution a from above, do i have
    also to sign the jars that i include in my jar...
    You need to add :
    <security> <all-permissions/> </security>
    to your jnlp file. In that case, all the jars listed as resources in that jnlp file need to be signed, and by the same certificate.
    for solution b i think i will have to sign all the
    jars... right ?
    yes
    Thx for your help/Andy

  • Question about using third party jar files in Java Web Start Environment

    Hi everybody, I got a very strange problem and still can't figer out how to solve it. Can anyone help to overcome this problem?? Thanks in advance.
    Question: I wrote a simple java swing application to connect to Oracle database. I packed whole my classes and a third party jar file(classes12.jar) to a new jar file named "IRMASSvrMgntGUI.jar" and then use command 'jarsigner' to signed IRMASSvrMgntGUI.jar. There is no problem when I execute 'java -jar IRMASSvrMgntGUI.jar' in the command line. But when I execute this application via Web Start Environment, an "java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
    " error occured with the following detail log shown in Jave Web Start Console:
    =============================================================
    java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
         at DBConnection.getNewConnection(DBConnection.java:25)
         at IRMASSvrMgntGUI.actionPerformed(IRMASSvrMgntGUI.java:524)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.AbstractButton.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    ==========================================================================
    contents of the manifest file I used to create this jar file are as follows
    ===================================
    Manifest-Version: 1.0
    Main-Class: IRMASSvrMgntGUI
    Class-Path: classes12.jar
    Created-By: 0.9a (itoh)
    ===================================
    and file structures in "IRMASSvrMgntGUI.jar" is
    ====================================
    META-INF/
    classes12.jar
    DBAuthenticateDialog.class
    DBConnection.class
    IRMASSvrMgntGUI.class
    ====================================

    If you directly include classes12.jar in IRMASSvrMgntGUI.jar, the classloader won't be able to find the classes inside classes12.jar. You should sign classes12.jar separately and include that in jnlp along with your application specific jar. When you're launching your app using "java -jar somefile.jar" then the classpath settings in manifest file are used, but that's not the case when you start using JWS since in this case the classpath is based only on the " <jar href=..." entries in jnlp.

  • Eclipse third-party jar inclusion

    I really should know how to do this but...
    I'm using the Apache jakarta commons CLI package (org.apache.commons.cli)
    I had assumed that
    import org.apache.commons.cli.*;would work just like
    import java.util.Iterator;In that once it compiled, I wouldn't need to worry about where the third party jar file was etc and could distribute my package freely.
    Apparently I was mistaken:
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException
    How do I "include" the appropriate information in my .jar file so I don't have to worry about the environment in which the program is run?
    java is still my lovely language

    This program is a small part of a larger package, and
    sits in the same directory as a bunch of other .jars,
    each representing one program. It just seemed a little
    bit messy to require multiple files for a single
    program in this case.
    I did review the links, thank you, and have since used
    the class-path entry method with multiple .jars as a
    workable solution. I'm just not happy with it.Typically when users install software, they run one of those InstallShield (or their competitors) installers. And they have no idea how many files are created or what it does. One file, ten files, a thousand files, they don't really care.
    Right now it looks to me like you're wearing both the user hat and the installer hat here, and as a result not doing really well at either hat. You as the user shouldn't care if you have to install three or five files to run the program; to you as the installer it looks messy but compared to most real-life installs it's incredibly tidy. Don't worry about it.

  • Third Party Jars in OIM 11G

    Hi All,
    I am trying to invoke a web service stub to call create() functionality.
    From the stand alone program(with out integrating with OIM server), if I just run it from eclipse, I am able to create the user in target system. If I try to invoke through process task adapters, I am getting Connection Exception.
    I think there is something to do with the third party jars. I have copied all the jars to /<Oracle_Home>/Oracle_IDM1/server/ThirdParty and <WEBLOGIC_HOME>Middleware/wlserver_10.3/server/lib.
    Should I run "UploadJars.sh" utility of OIM?
    Should I update the classpath of OIM and weblogic? I heard that from 11g onwards it automatically pick up the third party jars. Isn't so?
    My OIM Server and Target System Application are in different machines. There is no SSL communication. So I think no need to exchange certificates also.
    Please help me to solve this.

    Hello, oimcoder.
    I've removed the jars everywhere (from database and CLASSPATH variable too) besides the ThirdParty folder. When I run my Scheduled task there is a stack trace in log:
    [2011-09-22T12:26:41.717+03:00] [oim_server1] [TRACE] [] [oracle.iam.platform.pluginframework] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000JAGRjisCgoYFLryGOA1EUjqc000005,0] [SRC_CLASS: oracle.iam.platform.pluginframework.PluginClassLoader] [APP: oim#11.1.1.3.0] [SRC_METHOD: findClass] in find classorg.apache.cxf.jaxws.JaxWsProxyFactoryBean
    [2011-09-22T12:26:41.717+03:00] [oim_server1] [TRACE] [] [oracle.iam.platform.pluginframework] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000JAGRjisCgoYFLryGOA1EUjqc000005,0] [SRC_CLASS: oracle.iam.platform.pluginframework.PluginClassLoader] [APP: oim#11.1.1.3.0] [SRC_METHOD: findClass] Class Not found - org.apache.cxf.jaxws.JaxWsProxyFactoryBean
    [2011-09-22T12:26:41.717+03:00] [oim_server1] [TRACE:32] [] [org.springframework.transaction.jta.JtaTransactionManager] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000JAGRjisCgoYFLryGOA1EUjqc000005,0] [SRC_CLASS: org.springframework.transaction.support.AbstractPlatformTransactionManager] [APP: oim#11.1.1.3.0] [SRC_METHOD: triggerBeforeCompletion] Triggering beforeCompletion synchronization
    [2011-09-22T12:26:41.718+03:00] [oim_server1] [TRACE] [] [org.springframework.transaction.jta.JtaTransactionManager] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000JAGRjisCgoYFLryGOA1EUjqc000005,0] [SRC_CLASS: org.springframework.transaction.support.AbstractPlatformTransactionManager] [APP: oim#11.1.1.3.0] [SRC_METHOD: processRollback] Should roll back transaction but cannot - no transaction available
    [2011-09-22T12:26:41.718+03:00] [oim_server1] [TRACE:32] [] [org.springframework.transaction.jta.JtaTransactionManager] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000JAGRjisCgoYFLryGOA1EUjqc000005,0] [SRC_CLASS: org.springframework.transaction.support.AbstractPlatformTransactionManager] [APP: oim#11.1.1.3.0] [SRC_METHOD: triggerAfterCompletion] Triggering afterCompletion synchronization
    [2011-09-22T12:26:41.718+03:00] [oim_server1] [TRACE:32] [] [org.springframework.transaction.support.TransactionSynchronizationManager] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000JAGRjisCgoYFLryGOA1EUjqc000005,0] [SRC_CLASS: org.springframework.transaction.support.TransactionSynchronizationManager] [APP: oim#11.1.1.3.0] [SRC_METHOD: clearSynchronization] Clearing transaction synchronization
    [2011-09-22T12:26:41.718+03:00] [oim_server1] [TRACE] [IAM-1020021] [oracle.iam.scheduler.vo] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000JAGRjisCgoYFLryGOA1EUjqc000005,0] [SRC_CLASS: oracle.iam.scheduler.vo.TaskSupport] [APP: oim#11.1.1.3.0] [SRC_METHOD: executeJob] Exception encountered
    [2011-09-22T12:26:41.718+03:00] [oim_server1] [TRACE:16] [] [oracle.iam.scheduler.vo] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000JAGRjisCgoYFLryGOA1EUjqc000005,0] [SRC_CLASS: su.jet.idm.otp.saphr.oimdataloader.SaphrLoader] [APP: oim#11.1.1.3.0] [SRC_METHOD: logJobExecution] ENTRY 16В 461 1В 316В 683В 601В 644 1В 316В 683В 601В 718 6 java.lang.Exception: java.lang.NoClassDefFoundError: org/apache/cxf/jaxws/JaxWsProxyFactoryBean
    [2011-09-22T12:26:41.719+03:00] [oim_server1] [TRACE] [] [org.springframework.beans.factory.support.DefaultListableBeanFactory] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000JAGRjisCgoYFLryGOA1EUjqc000005,0] [SRC_CLASS: org.springframework.beans.factory.support.AbstractBeanFactory] [APP: oim#11.1.1.3.0] [SRC_METHOD: doGetBean] Returning cached instance of singleton bean 'txManager'
    [2011-09-22T12:26:41.719+03:00] [oim_server1] [TRACE] [] [org.springframework.transaction.jta.JtaTransactionManager] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000JAGRjisCgoYFLryGOA1EUjqc000005,0] [SRC_CLASS: org.springframework.transaction.support.AbstractPlatformTransactionManager] [APP: oim#11.1.1.3.0] [SRC_METHOD: getTransaction] Creating new transaction with name [null]: PROPAGATION_REQUIRES_NEW,ISOLATION_DEFAULT
    [2011-09-22T12:26:41.719+03:00] [oim_server1] [TRACE:32] [] [org.springframework.transaction.support.TransactionSynchronizationManager] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000JAGRjisCgoYFLryGOA1EUjqc000005,0] [SRC_CLASS: org.springframework.transaction.support.TransactionSynchronizationManager] [APP: oim#11.1.1.3.0] [SRC_METHOD: initSynchronization] Initializing transaction synchronization
    [2011-09-22T12:26:41.719+03:00] [oim_server1] [TRACE] [] [org.springframework.beans.factory.support.DefaultListableBeanFactory] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000JAGRjisCgoYFLryGOA1EUjqc000005,0] [SRC_CLASS: org.springframework.beans.factory.support.AbstractBeanFactory] [APP: oim#11.1.1.3.0] [SRC_METHOD: doGetBean] Returning cached instance of singleton bean 'toplinkSession'
    [2011-09-22T12:26:41.719+03:00] [oim_server1] [TRACE:16] [] [org.eclipse.persistence.session.oim.connection] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000JAGRjisCgoYFLryGOA1EUjqc000005,0] [APP: oim#11.1.1.3.0] client acquired
    [2011-09-22T12:26:41.719+03:00] [oim_server1] [TRACE:16] [] [org.eclipse.persistence.session.oim.transaction] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000JAGRjisCgoYFLryGOA1EUjqc000005,0] [APP: oim#11.1.1.3.0] acquire unit of work: 1992813264
    [2011-09-22T12:26:41.719+03:00] [oim_server1] [TRACE:16] [] [org.eclipse.persistence.session.oim.transaction] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000JAGRjisCgoYFLryGOA1EUjqc000005,0] [APP: oim#11.1.1.3.0] TX binding to tx mgr, status=STATUS_ACTIVE
    [2011-09-22T12:26:41.719+03:00] [oim_server1] [TRACE:32] [] [org.eclipse.persistence.session.oim.query] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000JAGRjisCgoYFLryGOA1EUjqc000005,0] [APP: oim#11.1.1.3.0] Execute query ReadObjectQuery(referenceClass=JobHistory )
    [2011-09-22T12:26:41.720+03:00] [oim_server1] [TRACE:32] [] [org.eclipse.persistence.session.oim.query] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000JAGRjisCgoYFLryGOA1EUjqc000005,0] [APP: oim#11.1.1.3.0] Execute query ReadObjectQuery(referenceClass=JobHistory )
    [2011-09-22T12:26:41.720+03:00] [oim_server1] [TRACE:32] [] [org.eclipse.persistence.session.oim.connection] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000JAGRjisCgoYFLryGOA1EUjqc000005,0] [APP: oim#11.1.1.3.0] reconnecting to external connection pool
    [2011-09-22T12:26:41.723+03:00] [oim_server1] [TRACE] [] [org.springframework.jndi.JndiTemplate] [tid: [ACTIVE].ExecuteThread: '21' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: 2ec07577f0893da0:3c1077a9:132906edc25:-8000-000000000000040d,0] [SRC_CLASS: org.springframework.jndi.JndiTemplate] [APP: oim#11.1.1.3.0] [SRC_METHOD: lookup] Looking up JNDI object with name [ejb.stateless.SchedulerService#oracle.iam.scheduler.api.SchedulerServiceRemote]

  • How to add third-party jar in CRM ISA application?

    Hello SDN!
    I need to add third-party jar in CRM ISA application. I know how to add such jars in common case and for local DCs. But for CRM I can't determine which DC should contain this third-party jar.
    Please tell me ASAP which DC (e.g. crm/isa/home/ext) I should use.
    Help will be appreciated.
    Regards, Lev.

    Hi,
    To add third party jar you need to create new DC which contain your third party Jar. Once you have new DC with your Jar file you can add as Used DC in required DC.
    Please refer [Using External Libraries for Development with NWDI|http://help.sap.com/erp2005_ehp_04/helpdata/EN/46/3ce3e4df201d63e10000000a11466f/content.htm] for more infromation to create DC with Jar File.
    eCommerce Developer.

  • Using third party jars with Oracle Business Rules

    Hi
    I am working on Oracle AS 10g release 2.
    We are using Oracle Business Rules in integration with Oracle BPEL.
    While using third party jars however, Oracle Business Rules end is facing errors.
    Error during unmarshallingProvider com.sun.xml.bind.ContextFactory_1_0_1 not found
    oracle.classloader.util.AnnotatedClassNotFoundException:
    Missing class: com.sun.xml.bind.ContextFactory_1_0_1
    Dependent class: javax.xml.bind.ContextFinder
    Loader: oracle.xml:10.1.0_2
    Code-Source: /D:/oracleasr3/lib/xml.jar
    Configuration: <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in D:\oracleasr3\j2ee\home\oc4j.jar
    Can anybody help in figuring out where Jaxb jars(3rd party jars) are to be kept so that OAS access it?
    We tried using the applib folder to load the jars but we are getting class loading errors.
    When new instances are created, class loading is not happening.
    Pls help.
    Thanks
    Kavya

    Are you using Application Server Release 3 or Release 2? There are different versions listed in your mail.
    I think you probably want to add this as a shared library via EM and then import the shared library to your application with the application's xml config files.

  • Third-party jars not visible to EJB's and servlets.

    Hi, This is an unanswered post in an newsgroup which exactly displays our
    current problem,
    Extract Begins -->
    "I've got a WebApp with classloading issues while running WebLogic 5.1.
    According to the JSDK 2.2 API, if I include third-party classes in
    WEB-INF/lib, my EJBs and servlets should be able to load any jar'ed classes
    inside. In practice, however, it seems to make no difference. My EJB always
    comes back with a NoClassDefFound error for xerces.jar that's in WEB-INF/lib
    (and I've even tried adding it to the EJB JAR itself with no change).Of
    course, if I put Xerces in the server's classpath, there are no problems but
    that's a road I don't want to go down.How can I tell my EJB's to load
    third-party classes from the WEB-INF/lib directory of the WAR file? I'd
    appreciate your insight. <-- End
    We are busy migrating one of our apps from 5.1 to 6.1, What we have done
    thus far and fairly successfully is the following,
    We packaged all the jsps, WEB-INF, html, images into a WAR file and then
    packed all EJB's, META-INF and classes to which the ejbs refer, into an EAR
    file.
    EMARKET_APPS/
    +myjsp.jsp
    +myhtml.html
    +images
    +WEB-INF/+
    |
    +classes/+
    |
    +myclass1.class
    +myclass2.class
    |
    +lib/+
    |
    +OReily.jar
    +jts.jar
    +xerces-1_4_1.jar
    +junit.jar
    +jcschart110Kwl.jar
    |
    +web.xml
    +weblogic.xml
    +META-INF/+
    |
    +applications.xml
    +ejbs/+
    |
    +myejb1.jar
    +myejb2.jar
    +lib/+
    |
    +classes.jar
    Please advise.
    Rgs Roly

    Have you tried to include the jars in the Class path entry in the manifest file.
    That should work eventhough I haven't tried it yet (fighting with ear deployement
    and I must say WLS seems to be winning). I'll get back to when I've tried it.
    There is a VERY good article on theserverside.com regarding class loaders and
    EAR/WAR/EJBs at http://www.theserverside.com/resources/articles/J2EE-Deployment/chapter.html
    Good luck
    /erik

  • NoClassdefFoundError on the third-party jar's classes when building APK

    I am building a native extension for Android.
    For the android library, I create a android project and add several third-party jar files to build path.
    I extract a jar file from a android project and merge it and third-party jar files into a single jar file.
    I package ANE using a merged jar file and build a APK.
    When I install a APK and launch it, NoClassdefFoundError on the third-party class occurs.
    I use Flash Builder 4.6 and set sdk version to the Flex SDK 4.6.0 + AIR SDK 15.0.0.356.
    I decompile APK and check the classes.dex.
    Strangely a certain jar's classes are missing in the classes.dex.
    I tried googling and found a similar case.
    The following is the link :
    http://stackoverflow.com/questions/24777394/noclassdeffounderror-on-thirdparty-class-files -when-building-adobe-native-extens
    I try to follow the answer in this link.
    Did dx.jar in the AIR SDK really strip out some classes of third-party jar file??
    I inquired the java version of the third-party related with NoClassdefFoundError.
    Now I am waiting for the reply.
    Is anybody else know about this?

    The android-support-v4.jar is same.
    I check android-support-v4.jar's classes in ANE.
    But they are missing in APK after release build.
    I don't know why.
    I use Flash Builder 4.6 and Flex SDK 4.6.0 + AIR SDK 15.0.0.356.
    Is there anyone else know about this???

  • JAR executable do not find third party Jars

    Boy I am beat.
    I am trying to build executable jar that needs bunch of third party jars.
    So I import the jars into a ext folder at the top of the pkg. I jar it all up (using Ant)with a manifast that point the classpath to the jars at the ext folder
    Dir Structure:
    myJar.jar
    |
    +-build
    |main class
    |
    +EXT
    |
    + bunchOfJars
    </pre>
    Manifest-Version: 1.0
    Created-By: Apache Ant 1.5
    Built-By: Ted I Weitz
    Classpath: ext/dom.jar ext/xsltc.jar ext/dt jar ext/vecmath.jar
    ext/j3dcore.jar ext/j3dutils.jar ext/xercesImpl.jar ext/xalan.jar
    Main-Class: myMain
    Command:
    java -jar myJar.jar
    I will be very gratfull for any idea
    Ted

    Just posted on this in another thread I am watching. As far as I know, and every other post I have seen on this topic, there is no way to do this without using a custom classloader that is used by the executing .jar itself to load any .jar files. How I can see this work is the main class is nothing more than a "classloader" launcher. It creates a new instance of this custom classloader. It then opens "itself" (the .jar the main class and all the .jar's are in), reads the manifest file to locate the .jar files the application requires, then either loads them, or somehow is able to reference them without directly loading them. The URLClassLoader is a good one to extend for this. It already opens up any .jar file specified in its path when being created, scanning for any files in there. Basically, you need to "extend" this functionality to scan any .jar's in the .jar, and so on. So, the launcher may be like so:
    public void main (String[] args)
    JarClassLoader jcl = new JarClassLoader(this.getClass().getClassLoader());
    jcl.launchApp(this);
    the jcl.launchApp would be a method that tells the classloader to use THIS class, its "root" dir, to locate the .jar file to open and scan for more jar files. Each time it comes across a .jar file in the .jar, it opens it and scans it as well.
    Keep in mind, when the URLClassLoader contains one or more .jar files, when a class it loaded references a class that is not found in the that classloaders parent loader classpath, it then starts looking in the .jar files in the URL[] path specified to it. It looks at all classes in the .jar files, but it does NOT look in nested .jar files in the .jar file. Basically, you could take the source code of the URLClassLoader, and add the ability to open up any .jar files nested in each .jar file as needed to resolve a class. I would imagine this could take some time at runtime, probably a second or two on slower machines for a single typecast. However, that would be dependent on the number of nested .jar files, the number of .jar's in the classpath of the classloader. I think I may undertake this task when I have time. I gotta finish my plugin engine first, then I may undertake this classloader. I am pretty sure that is the proper approach to take. However, because it is not part of the JVM .jar execution mechanism, a special bit of coding will be required, such as what I posted above. The main class in the .jar file will have to create this classloader and tell it to "execute" the program, passing to it another main class, specifying the location of the .jar file the main class is in, etc. Hell, you could almost bypass the java -jar app.jar and just do a java Classname where by the class and the .jar are bundled together, although this wouldn't be as nice. The reason this might be better is that then you wouldn't have to do any special coding in the .jar main class. I suppose though, by providing the "launcher" class and having a developer just extend it as part of their main class could also work.
    }

  • Plz suggest me How to use Third party jar files in ODI

    Hi all,
    I need to know how to use the third party jar files or our own customised jar file in ODI.
    regards
    palash

    Hi all,
    I am unable to implement..................
    I have one question, if I add any type 4 coneection supported jar file in my ODI_CLASSPATH can I use them in writing procedure to connect Databases
    I am trying to connect Oracle database by putting Ojdbc14.jar in the class path of ODI_CLASSPATH so that in my procedure I can use it .............but failed I dont know how to solve this problem.
    another thing Open Tools are delivered as a Java package (.zip or .jar) containing several files:
    A compiled Java .class file
    Other resources, such as icon files is it so ..............Then I can use full java apllication by preparing required bunch of classes and by set them appropriately in open tool
    need ur suggestion....
    regards
    palash

  • Unable to access classes in third party jar files packaged with my ejb.jar

    I have packaged some third party jar files in my xxx_ejb.jar file.  The third party jar file contains classes that are accessed by some custom classes which are in turn accessed by my bean classes.  I get the following error when my custom classes attempt to use any of the classes in one of the third party jar files:
    java.lang.NoClassDefFoundError: com/Ostermiller/util/CSVParser
    Shouldn't I be able to access classes in jar files that are packaged with my xxx_ejb.jar file?  I see the xxx_ejb.jar file as a resource of the application classloader that contains it but I don't see the third party jar files.

    As per the Java EE specification, additional JAR files should be packaged on the EAR level. Only WAR files' WEB-INF/lib folder is scanned for JAR files to be added to the classloader.

  • How to Call third party Jar into Application

    Hi Can any Expert help ?
    I want to put third party Jar into my application but i have some problem occur.
    1. how to call jar with parameter in application ?
    2. when i exit the third party jar task, it will exit my main task too. How to set my main tast exit stats standalone ?
    3. I have over 10 jar files in one application, how can i set a classpath for client to call JNLP, instread of load all jar to client before run.
    Thanks.
    Sanki Poon ([email protected])

    1) Sounds like you are trying to launch the third party from it's application main instead of using it as an API How does your code interact with it or is that not important?. You don't call a jar, you load a class. You could use a exec http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Runtime.html to run the java launcher and pass it all it's command line stuff(But this may not be possible security wise via WebStart).
    2) if it is launched in the same JVM and it calls a System.exit there is nothing you can do about your app closing too. It would need to be in another instance of the JVM
    3) Under the resources tag you can have as many jar tags as needed.
        <resources>
            <j2se version="1.5.0" java-vm-args="-esa -Xnoclassgc"/>
            <jar href="/jsf-wita/apps/MathMLWebEditor.jar"/>
        </resources>

  • Problems with the ActiveX bridge for Java beans when using third-party .jar

    I encountered the following problem when using the ActiveX bridge for a java bean:
    I am using JDK 1.4.2_09 and MS Visual Basic 6.0 (SP6). I wrote a java bean called ProcessViewer (my class ProcessViewer inherits from JComponent and implements the interfaces Serializable and AdjustmentListener) which I would like to use within a VB 6.0 application. I used the ActiveX bridge (packager.exe) to generate a DLL (ProcessViewer.dll) and registered it successfully. The java bean GUI-control works fine within my VB 6.0 application unless my java bean (ProcessViewer.jar) uses any third-party .jar files.
    But when I tried to add a reference to some third-party class (com.sap.xxx.xxx....) I got some problems. I could solve the problem with packager.exe by setting the correct CLASSPATH. But at runtime my VB 6.0 application does not work. It crashes or it reports an error like this: "The control ... could not be loaded from axbridge.dll" (although I deployed my .jar file correctly to the directory C:\Programme\Java\j2re1.4.2_09\axbridge\bin and lib). Setting the CLASSPATH environment variable before calling my VB 6.0 application (exe) did not solve the problem.
    How can I teach my VB 6.0 application (containing the Java bean ActiveX control) where to find the third-party .jar file? Copying the third-party .jar file to the JRE lib-folder or to the axbridge\lib folder did not solve the problem either.
    I studied the documentation about the ActiveX bridge given at:
    http://java.sun.com/j2se/1.4.2/docs/guide/beans/axbridge/developerguide/index.html
    but I am missing informations on how the third-party .jar files can be found during runtime of the ActiveX container (e. g. a VB 6.0 application).

    See how to solve your problem with JNI:
    http://codeproject.com/cpp/OOJNIUse.asp
    More examples (for SWING) in tools setup:
    http://www.simtel.net/product.php[id]95126[SiteID]simtel.net
    http://www.simtel.net/product.php[id]94368[SiteID]simtel.net
    http://www.simtel.net/product.php[id]93174[SiteID]simtel.net

Maybe you are looking for

  • How can I display the same page when I'll press

    i have a jsp page. It contains user name & password. and a link like SIGNOUT COMPLETELY. when i press the back button it should show only this page. You have noticed one thing that when u sign out from YHAOO MAIL then a page is displayed USERNAME : [

  • LDAP PL/SQL API

    Subject: DBMS_LDAP get ORA-06502 and ORA-06512 error msgs I used DBMS_LDAP in PL/SQL procedure and am getting the following error msgs. Could anyone help? ORA-06502: PL/SQL: numeric or value error ORA-06512: at "SYS.OWA_UTIL", line 315 ORA-06512: at

  • Missing Font, Unuseable Font

    I have Linotype Zapfino PS.1, the standard post script type 1 version of Zapfino installed on my machine but Linotype Zapfino PS, the Ligatures for this font do not show up in Font Book. Additionally, I would like to use a Post Script version of Helv

  • Volume keys no longer functional?

    the volume keys quit working on my wired aluminum keyboard this morning. nothing new, just stopped wrking. other function keys seem to still be working. tested on 10.7 and 10.8. tried installing keymap to see if the keys could be tricked into returni

  • Extended battery life for droid 2 ?

    how much longer ...will the battery last with an extended battery for the droid 2?