Jar librarys

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

I don't think this is exactly what I am looking for.
I want something that only downloads the .jar file if
the user chooses an option in a menu. That way
normal users will not have to download unessesary
items. I believe indexing will select appropriate
classes from a jar file the first time the applet is
initialized.
-perciousOn the contrary, I believe it is what you want. This is from the first google hit on "jar indexing":
JAR indexing
If an application or applet is bundled into multiple JAR files, the class loader uses a simple linear search algorithm to search each element of the class path, which may entail the class loader downloading and opening many JAR files until the class or resource is found. If the class loader tries to find a nonexistent resource, all the JAR files within the application or applet will have to be downloaded. For large network applications and applets this could result in slow start up, sluggish response, and wasted network bandwidth.
[Since JDK 1.3, the JAR file format has supported indexing to optimize the process of searching for classes in network applications, especially applets. The JarIndex mechanism collects the contents of all the JAR files defined in an applet or application and stores the information in an index file in the first JAR file. [b]After the first JAR file is downloaded, the applet class loader will use the collected content information for efficient downloading of JAR files. This directory information is stored in a simple text file named INDEX.LIST in the META-INF directory of the root JAR file.
http://www-106.ibm.com/developerworks/library/j-jar/

Similar Messages

  • Loading External JAR librarys in an applet

    HI all,
    I have an application that I would like to add an excell extention to. The extension is in the form of a JAR file, and I only want my applet to load this jar file when a menu item has ben clicked. I do not want the jar file to be loaded together with the rest of the application, because it is large, and unessisary for normal applet operation. Anyone have an idea how to do this?
    Thanks in advance.
    -percious

    I don't think this is exactly what I am looking for.
    I want something that only downloads the .jar file if
    the user chooses an option in a menu. That way
    normal users will not have to download unessesary
    items. I believe indexing will select appropriate
    classes from a jar file the first time the applet is
    initialized.
    -perciousOn the contrary, I believe it is what you want. This is from the first google hit on "jar indexing":
    JAR indexing
    If an application or applet is bundled into multiple JAR files, the class loader uses a simple linear search algorithm to search each element of the class path, which may entail the class loader downloading and opening many JAR files until the class or resource is found. If the class loader tries to find a nonexistent resource, all the JAR files within the application or applet will have to be downloaded. For large network applications and applets this could result in slow start up, sluggish response, and wasted network bandwidth.
    [Since JDK 1.3, the JAR file format has supported indexing to optimize the process of searching for classes in network applications, especially applets. The JarIndex mechanism collects the contents of all the JAR files defined in an applet or application and stores the information in an index file in the first JAR file. [b]After the first JAR file is downloaded, the applet class loader will use the collected content information for efficient downloading of JAR files. This directory information is stored in a simple text file named INDEX.LIST in the META-INF directory of the root JAR file.
    http://www-106.ibm.com/developerworks/library/j-jar/

  • Working with WebCenter Portal & ADF Skin Editor Together

    Hi all.
    I want to ask to webcenter community developers about the best practice to work with ADF Skin Editor for WebCenter Apps.
    I usually deployed my ADF Skin JAR Libraries as Shared Libs and consumed them from pure ADF Applications without problems.
    However, in WebCenter Portal Framework Applications resources are readed at MDS Path: /oracle/webcenter/portalapp/skins/... (like portal-skin.css) or at the shared lib called oracle.webcenter.skin
    My objetive is to provide more Skin's to WebCenter Portal Application from ADF JAR Librarys created by ADF Skin Editor and be selectable (like /oracle/webcenter/portalapp/skins/... resources) in Runtime in Administration page.
    How can i achieve it easly? (Please don't provide off doc, i read it).
    Have i to override SkinPhaseListener of WebCenter to read from another locations?.
    Thanks.

    Hi.
    Finally for WebCenter Portal Applications we are using ADF Skin Editor as support to skin ADF Components.
    When we've got our skin defined in ADF Skin Editor then copy to CSS file under MDS folder (/oracle/webcenter/portalapp...) and create a Portal Resource of it.
    If you want to deploy your ADF Skins as Shared Libs or included directly to WebCenter Portal App as ADF JAR Library then you'll see that they don't appear at Runtime to be selectable in admin page.
    If you want these skins be selectable at runtime you have to register them in generic-resources.xml manually.
    PD: Setting trinidad skins at "FINEST" level debug you can see what trinidad-skins is WebCenter loading.
    I hope this help you.
    PD: Your problem is little different because you are in WebCenter Spaces.
    Regards.

  • Project librarys not included in WAR file with deployment (WEB-INF/lib)

    Using JDeveloper 9.0.5.2
    Project Libraries are not included in WEB-INF/lib when deploying. Although the files are selected in the deployment file at 'Contributors'. Within the 'filter' the .jar files are missing.
    To solve it i have to register again (i have already made the librarys project library's) the files within Tools->ManageLibrarys as user library's.
    The other workaround is to make the library's System Library's within the project.
    In my opinion it is a bug that you must include the project librarys as user librarys within the 'LibraryManager'

    Unfortunately no, the issue with output folder being ignored occurs only with example apps bundled with Workshop product.
    You can try the following workaround:
    - In Workshop, Project > Properties - Java Build Path, switch to Source tab - "Remove the source folder listing" - Click OK and dismiss Properties window.
    - Project > Properties - Java Build Path > Source Tab, add the same source folder entry - Click OK
    - Export as WAR
    With this you should see the class files bundled under output directory structure (Ex: WEB-INF/classes).

  • Dll-in-jar access by java2/1.2 applet

    Given the new security mechanisms of Java2/1.2, is it possible for an applet loaded from the network to access a dll in a jar?
    TIA,
    Reggie

    Java Web Start can access and load native librarys (dll's) but only if the application is signed and requesting <all-permissions> - see the developers guide: http://java.sun.com/products/javawebstart/1.2/docs/developersguide.html#jnlp
    and the section on the Nativelib element.

  • "Jar " contents?

    Hi!
    In reference to "jarring up" my app, does the jar only contain the referenced import statements?
    In other words, is there extra API or librarys that are not being used by my app also just sitting in there taking up space?
    Thanks!

    > OK ... but what i'm trying to understand is that if
    my app does not explicitly call for a certain
    function of the java language, are these funtions not
    included in my finished "jarred" app?
    The only files that will be in the JAR file will be the ones you put there (and possibly a manifest).
    http://java.sun.com/docs/books/tutorial/deployment/jar/index.html
    ~

  • Jdbc connection error !  in  jar execution

    hi for all :)
    i made a swing application with mysql.
    when i complie and execute in eclipse, it works well. (perfectly!)
    after that, i made a test.jar file for deploy.
    but,, the jar file is not working
    when test.jar is executed, jdbc error is occured.
    org.gjt.mm.mysql.Driver
    java.sql.SQLException: No suitable driver found for jdbc:mysql://testIP(**.***.**.***):3306/DBNAME(test)*
    * at java.sql.DriverManager.getConnection(Unknown Source)*
    * at java.sql.DriverManager.getConnection(Unknown Source)*
    * at com.kaist.util.CancerDBSearching.dbConnection(CancerDBSearching.java:220)*
    * at com.kaist.util.CancerDBSearching.<init>(CancerDBSearching.java:39)*
    * at com.kaist.user.GuiEvent.<init>(GuiEvent.java:28)*
    * at com.kaist.user.GuiMain.<init>(GuiMain.java:140)*
    * at com.kaist.user.GuiMain.main(GuiMain.java:133)*
    to solve this problem,
    i make sure that jdbc classpath!
    but, still doesn`t not work!
    what's wrong with my-program.. T_T
    help me, plz!!!!! :-(

    i made the jar file using java-tool : Eclipse ( the export function )
    i do noting about including any library when i create the jar file. (just clicking the mouse... :-) )
    but other librarys are existed in the output of this code( jar tf myJarFile.jar )
    lib/
    lib/jcommon-1.0.12.jar
    lib/jfreechart-1.0.9.jar (like this..!! )
    why the JDBC library didn't included??
    is there any method about including the mysql library when make the jar file?

  • A Game in one jar file

    I've wiritten a very simple game using jogl, and I won't to put all the files in one jar (resources, jogl classes, my classes, jogl natives), so there's no playing with jre needed for the user. My game loads classes and resources correctly from the jar, but the jre doesn't see the natives? Is there a solution?
    Thanks in advance!

    Java 3d api?
    java.sun.com/products/java-media/3D/
    btw. Powered by sun doesn't mean anything. If it is
    not part of java SE or EE or other certifiable path
    then its not going to be supported by 3rd party java
    vendors, it doesn't matter if its done by sun, sun
    isn't java. The whole point of java is write once run
    ANYWHERE, not just on a few platforms, with wierd
    JNI's that support a peculiar (though in OpenGL case
    very good) hardware standard.java3d also uses native librarys (it runs on OpenGL or DirectX), so you face the same problem as with JOGL, you need to install it or load the native dynamic libs.
    Java3D is a higher level API using a Scenegraph concept (OpenInventor). Due to this it's slower than the low level API JOGL which is just a java binding to access OpenGL.

  • Installation of IPC AP 7.0 Jar is getting Failed when uploading in CRM

    Hello Experts,
    we did some changes in the previosly uploded version of IPC AP 7.0  customer user exit Jar file in eclipse.
    While uploading the new modified jar through transaction /SAPCND/UE_DEV in CRM we are getting error :" installation of module <Jar file name > has failed ".
    when we checked the logs in SM 53 we seen the below mentioned error:
    Message: Exception of type com.sap.sql.log.OpenSQLException caught: Exception of type com.sap.sql.sqlparser.CommonSQLParserException: - statement "DELETE FROM "SVMCRT_MOD_TR_T" WHERE "MODULE_NAME" LIKE ? ESCAPE ^ (reason: Modification of ABAP tables is not permit ted)" is not supported
    caught: - statement "DELETE FROM "SVMCRT_MOD_TR_T" WHERE "MODULE_NAME" LIKE ? ESCAPE ^ (reason: Modification of ABAP tables is not permitted)" is not supported
    --> com.sap.sql.log.OpenSQLException: Exception of type com.sap.sql.sqlparser.CommonSQLParserException: - statement "DELETE FROM "SVMCRT_MOD_TR_T" WHERE "MODULE_NAME" LIKE ? ESCAPE '^' (reason: Modification of ABAP tables is n" is not suppor ted
    caught: - statement "DELETE FROM "SVMCRT_MOD_TR_T" WHERE "MODULE_NAME" LIKE ? ESCAPE '^' (reason: Modification of ABAP tables is not permitted)" is not supported
    at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Object;)Lcom/sap/sql/log/OpenSQLException;(Syslog.java:85)
    at 
    if  required i can post the complete stack trace.
    any inputs/suggestions are most welcome.
    Thanks & regards,
    Siddharth

    Hi Mark,
    Yesterday after Posting the thread we found the same Note ,Issue occured because of  JAVA write access was not enabled on the table ,After enabling it as mentioned in SAP Note, Jar file get successfully uploaded.
    Thanks for your Help also.
    Regards,
    Siddharth

  • Application working under NetBeans but not as a *.jar file

    Hello,
    recently I found a little problem. I wrote application that shows all available ports in my computer. When I am running this applications under NetBeans it works with no problem - finds all available ports. Then I am building it to the *.jar file. Application is working with no problem but command:
    Enumeration PortIds = CommPortIdentifier.getPortIdentifiers();
    is not returning any identifiers - PortIds is empty.
    Anyone knows a solution for this type of problems? Thanks

    Hi Venkatesh,
    Few questions.
    1. What is your JDeveloper version? (Always better to post your JDev version along with the question, which would help us to help you better).
    2. Did you try adding webserviceclient.jar to the classpath? (Search in your JDev installation directory for the location of this jar file).
    -Arun

  • .jar file is not working properly :developed in NETBEANS

    Hi Gurus,
    i am using NETBEANS IDE 7.2.
    i am developing a project that interacts with databases 10g and COM ports of machine , these all processes are performed by .bat file which i am trying to run from jFramform , code works perfectly .bat file is also called perfectly when i run the project using F6 from the NETBEANS, for testing i placed some dialogue boxes on the form to test it ,
    but when i run executable .jar  file , form run successfully and dialogue box works perfectly but .bat file is not called by executable .jar file.
    this is how i call the .bat file...
      String filePath = "D:/pms/Libraries/portlib.bat";  
            try { 
              Process p = Runtime.getRuntime().exec(filePath); 
            } catch (Exception e) { 
                e.printStackTrace(); 
    and below is the contents of portlib.bat file
    java -jar "D:\SMS\SMS\dist\SMS.jar" 
    you must probably ask why i am calling a .jar file using .bat file .
    reason is that this .jar project sends message using GSM mobile , System.exit(); is compulsory to complete a job and then do the next one ,
    if i use the same file to execute this job it makes exit to entire the application (hope you can understand my logic).
    that's why i use extra .jar file in .bat file , when single job is completed .bat exits itself and new command is given.
    Problem is that code is working perfectly in NETBEANS when i run the project but when i run .jar then .bat file is not working  ,
    thanks.

    Thanks Sir ,
    You need to first test an example that works like the one in the article.
    There are plenty of other examples on the web - find one you like:
    http://javapapers.com/core-java/os-processes-using-java-processbuilder/
    I tried this one.
      try {
                ProcessBuilder dirProcess = new ProcessBuilder("D:/SMS/SMS/Send_message.bat");
                 File commands = new File("D:/SMS/SMS/Send_message.bat");
                 File dirOut = new File("C:/process/out.txt");
                 File dirErr = new File("C:/process/err.txt");
               dirProcess.redirectInput(commands);
                 dirProcess.redirectOutput(dirOut);
               dirProcess.redirectError(dirErr);
                 dirProcess.start();
            } catch (IOException ex) {
                Logger.getLogger(mainform.class.getName()).log(Level.SEVERE, null, ex);
    as instructed in the article i compiled  both the projects at same version or sources and libraries which is 1.7
    here is my version details
    C:\>javac -version
    javac 1.7.0_07
    C:\>java -version
    java version "1.7.0_07"
    Java(TM) SE Runtime Environment (build 1.7.0_07-b11)
    Java HotSpot(TM) Client VM (build 23.3-b01, mixed mode, sharing)
    inside the NETBEANS IDE c:\process\err.txt  remains empty and code works perfectly , but when I run executable .jar file( by double clicking on that file in dist directry) then c:\process\err.txt becomes full with this error text and there is no response from calling D:\SMS\SMS\send_message.bat
    here is the error text
    java.lang.UnsupportedClassVersionError: sms/SMSMAIN (Unsupported major.minor version 51.0)
      at java.lang.ClassLoader.defineClass0(Native Method)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at java.security.SecureClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.access$100(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Exception in thread "main"
    here is /SMS/SMS
    unknown source ?

  • Unable to load database driver from my applet's jar file

    I'm trying to set up an applet that will talk to a MySQL database. I have no problem connecting to the database as I'm developing the code ("un-jarred"), but when I create a jar file of my code to test through a web browser, I cannot connect to the database due to the usual ClassNotFoundException. I have included mysql-connector-java-3.1.12-bin.jar (the current driver) in the jar, but I don't know if I'm supposed to supply some info through an attribute to the applet tag to let it know that the jar contains the driver it needs or if I have to call the driver differently in my code.
    Any help is appreciated, thanks.

    The simplest approach is always the best. :)Abso-lutely.
    Awesome, that worked perfectly. I Included the extra
    jar file in the applet tag and now my applet makes
    some sweet lovin' to the database.And you have succeeded where thousands have failed. Congratulations.

  • Crystal Report not works in JAR File

    I'm using Eclipse All in one, which includes Crystal Reports.. I Connected my Java program with Crystal Reports and its working properly. Now my problem is that the Report is not working in JAR files.. It throws some exception as
    "com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: com.businessobjects
    com.businessobjects.reports.sdk.JRCCommunicationAdapter---- Error code:-2147215357 Error code name:internal"
    Whats the Error.. I don't know. I think that i may missed some CLASSPATH Files. The included CLASSPATH Files are:
    ReportViewer.jar
    jrcerom.jar
    Concurrent.jar
    CrystalCharting.jar
    CrystalCommon.jar
    CrystalContentModels.jar
    CrystalExporters.jar
    CrystalExportingBase.jar
    CrystalFormulas.jar
    CrystalQueryEngine.jar
    CrystalReportEngine.jar
    CrystalReportingCommon.jar
    icu4j.jar
    keycodeDecoder.jar
    log4j.jar
    MetafileRenderer.jar
    rasapp.jar
    rascore.jar
    rpoifs.jar
    Serialization.jar
    URIUtil.jar
    xercesImpl.jar
    xml-apis.jar
    and the mysql-connector jar file
    Anybody help me please...

    Unable to load database connector
    'com.crystaldecisions.reports.queryengine..driverImpl.
    DriverLoader
    now you have any idea.. pleaseIs that a typo where you have two periods below?
    queryengine..driverImplOther than that I don't think anybody here can help you with that. If your classpath includes all necessary JAR files and you are able to access all your resources from within your application JAR file, then I imagine there is a problem with the third-party crystal decisions JAR file or how you are attempting to use it.
    My advice to you is to try and contact support with the vendor or provider of this API or possibly try posting on a support forum on their website to see if somebody can help you there.

  • How to use one ODSI project artifact as jar for other ODSI project?

    Hi,
    I am working on multiple ODSI proejcts in Same Server. My problem is how to call one projects resources in other ODSI project. I need this as Some of Data Services read the data from more then one database. The projects are in seprate Dataspace projects but they are deployed in same server. When I try to export artifacts from one projects and include them as Jar in other projects I am not able to see any Data service methods so unable to call any method of one project in other project. Please advise how to recsolve this problem.
    Thankyou in advance.
    Rahul

    If you already have a case open, it's polite if you mention that - so I don't have to answer the same questions to support and also to this forum. Likewise, when you get an answer to your question on this forum, you can tell support. So they don't keep looking for something you already have the answer to. Cuts down on the duplication of effort.
    You have one project. You add more files to it (regardless of how you add them - by creating files with the editor, by using a wizard or by importing files from another project), you still have only one project.
    If you had some other project that you exported the files from - that project is still there - but the original project does not know or care about it.
    Edited by: mikereiche on Jun 21, 2010 1:55 PM

  • How to modify a specific class in jar file ?

    I've downloaded a jar file for applet, the jar file works fine... but when I extract a specific class file from the jar file and just recompie it from my IDE (Eclipse) without even making any change and then compress again jar class files including the new modified class file instead of the old one (without any modifications to other classes)... then I get
    (NoSuchMethodError ) exception whenever methods of other classes are invoked from within the modified class !!
    ...The manifist file of the jar file reads the following line
    Created-By: 1.4.0_01 (Sun Microsystems Inc.)
    I thought it means that jar class files were built using JDK 1.4.0_01 ...I used JDK 1.5.0_01 in my IDE...
    I thought JRE incompatiblity was the reason of the problem so I downloaded JRE 1.4.0_01 and used it to build this class file... but i got the same exception..
    so what is the main reason of the problem ? ...should I make changes to IDX files accompanying applet jar files ??
    If no, then how can I overcome this problem and be able to change and rebuild a specific class from this jar file ?
    (I cannot rebuild all classes in jar because there are errors I cannot resolve !!)

    Could you please clarify: do you want to run your project or a project from an independent jar?
    In the first case just select Run Project from the project context menu or select a class with main method and click Run File in the class context menu.
    Regarding the second case:
    - I don't think there is such a feature in the IDE (running third party jars is not an IDE function). Could you explain why you need this?

Maybe you are looking for

  • Two External Displays and Internal Display Over Different Connections

    Hi there. I'm going to be purchasing a rMBP in the very, very near future. However, I am unclear about how external displays work with this. My current display setup at work is two basic 1080p monitors that can be run over DVI, VGA or HDMI. I'd like

  • ATI HDMI Audio Not Working

    Hi. I'm trying to get my ATI HDMI audio working. I've followed the instructions at https://wiki.archlinux.org/index.php/ATI#HDMI_Audio and running "aplay -D plughw:1,3 /usr/share/sounds/alsa/Front_Center.wav" outputs no errors nor any sound on my TV.

  • Count the number of days in the selected range using Customer exit

    Hi Experts, we have requirment where user is asking to add a column to report, which will have 'count of days for which key figure is having values' for each of the months and the Header would be 'Day Count' Please let me know if its possible using C

  • Could I install Oracle Application Server 10g 10.1.2.0.2  x64

    Dear Sir, I have one server installed by Windows 2003 X64 and EM64T (Core 2 Duo Intel CPU). Could it be workable to install Oracle Application Server 10g 10.1.2.0.2 (Itanium version) on it (Windows 2003 X64 and EM64T (Core 2 Duo Intel CPU)) ? Thank y

  • BugCheck Dump

    please review if this stack dump is a concern or if it's a one time non-critical event.  If it's a concern, please provide any recommendations. =====================================================================