Jar Libraries

Hi,
I have my jar file created with the main class specified. That works fine but it fails to find associated libraries which I have included in a lib folder in the jar. So my questions is how do I specify on the command line the classpath to look at dirs inside the jar. When I say to look at lib it seems to search for a lib folder in the directory I am running from (as I would expect it to). So how do I tell it from the command line, also is there a way to put this in the Manifest file? Thanks a lot
Stephen

You cannot put JAR files within JAR files.
Well you can....
But I am telling you java will never find them on the classpath! ^_^
You need to keep all your JAR's seperate.

Similar Messages

  • Where install JAR libraries on Oracle server

    Hi,
    I have a little problem (of course) to put my libraries (*.jar) on the Oracle server.
    In witch directory on the Oracle server I must deposit Jar libraries to be used by my Java stored developments ?
    For example, my Java stored development use "fop.jar" and "xercesImpl-2.7.1.jar" and I don't want stored this libraries into the Oracle user (with loadJava command) ?
    Is there a file to configure? A special directory where I can deposit my libraries ?
    I use Oracle server 10g on unix.
    Thanks for your help...

    No no no !!! Please !!! Find me another response !! ;o)
    Is it impossible to define a "classpath" for Oracle JRE ??

  • Netbeans: creating a jar including jar libraries

    Hi everyone,
    I am trying to create a jar of my netbeans project which includes some other jars as libraries.
    The problem is that it compiles ok and creates the jar but unfortunately it does not include in the project .jar the libraries needed for the execution.
    Therefore when I run the program it complains with a java.lang.NoClassDefFoundError.
    Anyone can advise on how I can solve this?
    Cheers

    Read the README.TXT file that NetBeans creates in your dist folder. And please be informed that this is a forum for problems related to the Java lanuage and standard API, not for an IDE.
    There are IDE forums on nabble.com and java-forums.org
    db

  • BPEL - using JAR libraries, compile OK, but error while deploying

    Hi All, i have a BPEL process with a JAVA program inside. It uses 3 JAR files as libraries, so they are included in the project properties CLASSPATH.
    When i compile and deploy directly to the domain, i dont have problems.
    But I am using an ANT xml , to deploy with dynamic variables, i was told that when I deploy using this, the libraries should reside in the Server (j2ee/OCJ4_xxxx/applib)
    the libraries are copied there., but still have the following error:
    BUILD FAILED
    C:\BPEL\Invoices_KOFAX_NEO_Service\build-master.xml:172: The following error occurred while executing this line:
    C:\BPEL\Invoices_KOFAX_NEO_Service\build.xml:79: A problem occured while connecting to server "houneotest.nblenergy.com" using port "7781": bpel_Invoices_KOFAX_NEO_Service_1.0.jar failed to deploy. Exception message is: ORABPEL-05215
    Error while loading process.
    The process domain encountered the following errors while loading the process "Invoices_KOFAX_NEO_Service" (revision "1.0"): Failed to compile classes.
    Failed to compile the generated BPEL classes for "Invoices_KOFAX_NEO_Service".
    If you have installed a patch to the server, please check that the bpelcClasspath domain property includes the patch classes.
    at com.collaxa.cube.engine.deployment.CubeProcessHolder.bind(CubeProcessHolder.java:285)
    at com.collaxa.cube.engine.deployment.DeploymentManager.deployProcess(DeploymentManager.java:871)
    at com.collaxa.cube.engine.deployment.DeploymentManager.deploySuitcase(DeploymentManager.java:737)
    at com.collaxa.cube.ejb.impl.BPELDomainManagerBean.deploySuitcase(BPELDomainManagerBean.java:445)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
    at com.evermind.server.ThreadState.runAs(ThreadState.java:646)
    at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
    at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
    at DomainManagerBean_RemoteProxy_4bin6i8.deploySuitcase(Unknown Source)
    at com.oracle.bpel.client.BPELDomainHandle.deploySuitcase(BPELDomainHandle.java:319)
    at com.oracle.bpel.client.BPELDomainHandle.deployProcess(BPELDomainHandle.java:341)
    at deployHttpClientProcess.jspService(_deployHttpClientProcess.java:376)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    at oracle.security.jazn.oc4j.JAZNFilter$1.run(JAZNFilter.java:396)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
    at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:410)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:623)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
    at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
    at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:302)
    at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:190)
    at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    at java.lang.Thread.run(Thread.java:595)
    Total time: 44 seconds

    If that folder also is specified in the <J2EE_HOME>/config/server.xml, e.g. as follows:
         <shared-library name="global.libraries" version="1.0" library-compatible="true">
              <code-source path="../applib"/>
         </shared-library>
    than that is the place where the libs should be to make them available to all deployed applications.
    When you have verified this and it still does not work, the cause of the problem likely is a different one.
    Jan Kettenis

  • How to include external .jar libraries

    hi,
    I'd like to use an external .jar library in my Java program.
    I import the package in the source code.
    But where do I have to specify the file location of the .jar file. Do I have to add its directory to the PATH environment variable or somewhere else??? So far I've done this only in Eclipse, but now I'm working in a pure linux environment... with no IDE.
    Thanks :)

    Or specify the classpath completely when you run javac.
    For example to compile a class called Foo in the current directory which uses classes from an external jar file I would say
    javac -cp .:../../whatever.jar Foo.javaAnd if Foo has a main() class:
    java -cp .:../../whatever.jar Foo(If you are working with a number of projects each with lots of classes and lots of (different) jars, it might be time to look at Ant.)

  • Minimum set of oracle jar libraries for JMS Streams

    In the installation manual there is a list of jars that I have to have in a classpath in order to use Advance Queueing.
    $ORACLE_HOME/jdbc/lib/classes12.jar
    $ORACLE_HOME/jdbc/lib/orail8n.jar
    $ORACLE_HOME/jdk/jre/lib/ext/jta.jar
    $ORACLE_HOME/jdk/jre/lib/ext/jta.jar
    $ORACLE_HOME/jlib/jndi.jar
    $ORACLE_HOME/lib/xmlparserv2.jar
    $ORACLE_HOME/rdbms/jlib/xdb.jar
    $ORACLE_HOME/rdbms/jlib/aqapi13.jar
    $ORACLE_HOME/rdbms/jlib/jmscommon.jar
    The problem with this is that most of these jars overlay the most common java jars that come with J2EE and Jave. (I am using J2EE 1.4 and J2SE 5.0).
    My question is - Is there a sub-list of oracle jars that I must have even if I already have J2EE and J2EE in my classpath, or should I always assume that I have to have every single jar on the list, and remove the Sun's j2ee and j2se ones?
    Thank you,
    Edmon

    Hi pscorca,
    As Arthur suggested, the simplest approach is to make use of the SQL Server Import and Export Wizard. This tool enable us to select multiple Orace tables at one time, and even create the destination table automatically. Then, we can save it
    as a package without running it immediately. In this way, there are multiple Data Flow Task created automatically for each source table.
    Regards,
    Mike Yin
    TechNet Community Support

  • Developing Application for third-party Java API (jar) libraries

    I need some of your inputs on architecting a web based solution to invoke Vantive java API using SAP Netweaver Technology. The API provides methods to connect, insert, update, fetch data from Vantive system using java classes. Pl. let me know which would be best way (webdynpro/ j2ee/java) to create & run web based forms to connect, insert and update data in Vantive using these Java APIs.

    I think there is your choice only that based on your experience with web technologies (in case of integration with portal as I understood) but the nominee with the best integration capabilities is Dynpro. Of course you can simply use standard JEE techniques (see the official JSR for official technology and release notes of official restrictions by SAP implementation). Third party integrations are available in both choices: Dynpro or not. In general your choice is better to be with an appropriate estimation, isn't it? Or try to define concretely criteria of such integration.

  • Import Libraries (jar) into DC Project

    Hi all,
    I want to create a J2EE application with an DC Web-Modul.
    I have to import any jar libraries for other functions (struts.jar etc.). I have imported the library in the project settings:  properties ->java buildpath -> add external jars. But it doesn't´t work. I have also made another dc in which I have import the library. But it doesn't´t work. Could anybody give me some information's how does it work?
    Kind regards
    Axel

    Hi Axel,
    Refer the following thread "Using External JARs in a Web Dynpro Project"
    Web Dynpro Java
    This will be useful for you.
    Regards,
    Santhosh.C

  • Using of AQ jar client libraries: aqapi.jar,..

    Hello,
    I am looking for answers to these questions about licensing of Oracle DB client software, especially Advance queue jar libraries.
    $ORACLE_HOME/rdbms/jlib/ :
    aqapi.jar
    1) Does the licenses allow me to use these libraries by third party application server?
    2) Can be this libraries shipped directly with application
    (for example in ear deployment in directory WEB-INF/lib) ?
    Thanks, Skopino.

    hi, as requested
    SQL Exception: IO Error: SO Exception was generated Code: 17002 State: 08006
    oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:458)
    oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546)
    oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:236)
    oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
    oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:280)
    oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:207)
    oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:157)
    Wallet.main(Wallet.java:31)

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

  • How to include jar files in exporting an .jar with Eclipse

    I would like to add jar libraries into my jar exported in that they are referenced in my java code . how can i do it with Eclipse?
    Thanks for your response.

    You mean to add a library in NetBeans? If so, click here

  • How to export desktop app into jar file??

    Hello,
    I have a desktop application needing some jar libraries.
    I've exported my application using eclipse exporting wizard, so I've achieved
    an app.jar with a simple Manifest.mf (only indicating Main-Class)
    I've modified the manifest.mf to include all the jar libraries in the Class-Path.
    The manifest.mf looks like this:
    Manifest-Version: 1.0
    Class-Path: lib/commons-collections-3.1.jar lib/commons-digester-1.7.jar Main-Class: com.pack2.pack2.MainClasse
    When I try to execute the application with the command line:
    java -jar app.jar
    The next exception is thrown:
    Exception in thread "main" java.lang.NoClassDefFoundError: pack1/class1
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    Can anybody help me please?
    Thanks in advance!

    I've alredy found the solution:
    Class-Path: . ./lib/lib1.jar ./lib/lib2.jar
    The clue is both on Class-Path attribute sintax and the TWO returns after the last manifest line.
    Hope helps others!

  • Setting Classpath so one jar can access another jar

    I am having trouble with running an application as a jar that accesses other custom libraries.
    I have made a small example to try to get this working.
    I have
         HelloWorld.class - that prints out "HelloWorld" and then throws a custom exception JWIException
         JWIException - exception that is in a package com.jeffersonwells.util
    I have put the JWIException class in the directory D:\apps\jbin\com\jeffersonwells\util.
    I have a manifest file that looks like the following.
         Manifest-Version: 1.0
         Main-Class: HelloWorld
         Class-Path: "d:\apps\jbin\"
    I have created a jar with the manifest file and the HelloWorld class
    When I run the jar, I get the following
         Exception in thread "main" java.lang.NoClassDefFoundError: com/jeffersonwells/util/JWIException
    So, I believe the classpath is not being set correctly.
    Then the second part would be to get the HelloWorld app to access the JWIException in another jar file instead of in the directory structure. I assume if the first scenario gets working, this will be fixed as well.
    I would greatly appreciate any assistance you can provide.
    Thanks,
    Tom Krueger

    I thank you all very much. The problem I was having was with not having relative paths in my Class-Path.
    Having the relative paths will work for the most part, however, sometimes we may want to move the executable jar to a different location. Does anyone have a great solution taking the following into consideration.
    Previous posts have said you can reference classpaths through http or ftp. Great, however if you set this to your http://domain/whatever I'm assuming this will prohibit you from moving the application from dev to test to production without modifying the url.
    Thanks for any thoughts!!
    P.S.
    I'm also in a battle here whether to jar libraries or not. jaring allows you to easily move them from server to server and more importantly for me determine versions of compatible files. However, the argument against jaring is speed of development, why jar if I can pull up a java file compile it and copy it to the server. Why waste time in the whole jaring process.
    Thanks again!!!

  • Where are imported shared libraries defined

    in system-application.xml, the imported-shared-libraries are defined as :
    <imported-shared-libraries>
    <import-shared-library name="oracle.dms"/>
    <import-shared-library name="oracle.jdbc"/>
    and these are used in server.xml like:
    <import-shared-library name="oracle.jdbc"/>
    my questions is where does the imported libraries name and actual jar files defined. for ex. for the name oracle.jdbc, where are the jar libraries location defined?
    I got a problem looks like application server not able to find these jars unless I copy them to the applib folder.
    Thanks

    Additional shared libraries may be configured to override the default shared libaries, including the oracle.jdbc library.
    http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapjdbclib/doc/readme.html

  • Can I use addAuditTrailEntry(String message, Object detail) in a jar file?

    I have a lot of jar libraries that I need to import into my BPEL process. It's not practical for me to copy all the code flatly into an embedded java / bpelx.
    How can I call the addAuditTrailEntry method inside the classes in my jar file?
    e.g.
    I import libraries.jar at the top of my .bpel file.
    In my embedded java I do:
    MyClass myclass = new MyClass();
    myclass.doSomething();
    In the public void doSomething() method I would like to write to the audit trail directly. Currently I am simply having the doSomething() method return a String with a summary of everything it has done. This is not good enough because the method takes a long time to complete and I need a running audit trail so that I can take actions depending on what is going on in it.
    I can't seem to find the documentation... I assume in my MyClass.class I will need to import some bpel jars so that it can comprehend what a bpel process is... then pass the current process instance into the MyClass file so that it can call its addAuditTrailEntry method... is this right?
    I envision something like:
    import orabpeljars.jar
    public MyClass(BPELProcess process)
    process.addAuditTrailEntry("In MyClass Constructor");
    ------------------------------------------

    I have a lot of jar libraries that I need to import into my BPEL process. It's not practical for me to copy all the code flatly into an embedded java / bpelx.
    How can I call the addAuditTrailEntry method inside the classes in my jar file?
    e.g.
    I import libraries.jar at the top of my .bpel file.
    In my embedded java I do:
    MyClass myclass = new MyClass();
    myclass.doSomething();
    In the public void doSomething() method I would like to write to the audit trail directly. Currently I am simply having the doSomething() method return a String with a summary of everything it has done. This is not good enough because the method takes a long time to complete and I need a running audit trail so that I can take actions depending on what is going on in it.
    I can't seem to find the documentation... I assume in my MyClass.class I will need to import some bpel jars so that it can comprehend what a bpel process is... then pass the current process instance into the MyClass file so that it can call its addAuditTrailEntry method... is this right?
    I envision something like:
    import orabpeljars.jar
    public MyClass(BPELProcess process)
    process.addAuditTrailEntry("In MyClass Constructor");
    ------------------------------------------

Maybe you are looking for