Import "jh.jar" to my application

I did a litle help with JavaHelp for my application and when i move to another computer the help will not display because it can not find the HelpSet class. On my PC a have the jar file "jh.jar" in my classpath, but I want to import it to my application but I don`t know how.
Can anyone know how to do this?

Quoting myself:
If the main class is declared in the manifest and you're simply double-clicking the jar you should use the Classpath attribute in the manifest file (in this case I guess you can put jh.jar in the jar itself).
Googling out, it looks like you actually can't put a jar inside a jar (I thought you could cause you can put a jar in a war or an ear, my fault).
Event though this looks different (at a glance, didn't go deep in it).
Anyhow, according to the [sun jar specs|http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html] (that is the proper docs I kept mentioning):
◦Class-Path :
The value of this attribute specifies the relative URLs of the extensions or libraries that this application or extension needs. URLs are separated by one or more spaces. The application or extension class loader uses the value of this attribute to construct its internal search path.So you should be able to try something like Class-Path: jar:MyJarName.jar!/jh.jar (and probably a lot of easier url like the ones in the over-mentioned thread).
I never did it, never tried, don't mean to and think distribution should be solved with distribution techniques (like JWS or a simple zip file).
If you want me to spend time on this instead of you and keep posting to the wrong forum (this is now officially OT), please add dukes (10 would be just fine).

Similar Messages

  • How to import a jar file in JSP

    How to import a Jar file in JSP Page.
    please reply its very urgent!

    Hey I am facing a similar problem:
    I have this jar file lbswebservice.jar that I have to use for my application.
    I added it to the classpath, I copied it in my WEB-INF/lib folder, but when I try to access classes in this package, it doesnt work.
    For example the jar contains the package com.blipsystems.lbs.ws.messages.* ; that contains different classes, like the Campaign class.
    I tried to use this class (just to create an object) in different context (through jsp, or just through java test classes), but it never works, i get the error: com.blipsystems.lbs.ws.messages.Campaign cannot be resolved to a type
    I am a bit desperate here...

  • Including External JARs for Java Application in OC4J

    Hi Experts,
    Here is my requirement.
    I have developed my Java application using Tomcat Server & Eclipse. In my application I have used some External JARs & imported the classes in my JSP.
    Now that I'm using OC4J Server instead of Tomcat I'v no clue as to where I have copy these External JARs for my application to work.
    I have installed OBIEE-Client which includes OC4J server. The path where I have placed my application is as below
    *"C:\OracleBI\oc4j_bi\j2ee\home\default-web-app"*
    If I run my application the server does not import the classes in the JSP which we include using Import statement using JSP tags (*ex* - <%@ page import = "org.apache.commons.fileupload.*"%>).
    This is the location which I found, where I need to put my Java-J2EE application. This OC4J_BI comes with OBIEE.
    Kindly help me out on where to place these External JARs exact location in OC4J.
    Also let me know if I have to alter any configuration/xml file (if so pls specify the file name & its location).
    Thanks in advance,
    Venky

    You can either include the external libraries in the application, by placing them into WEB-INF/lib, or you can import them into the server as "shared libraries", normally you'd use the "enterprise manager" application to do this. Having loaded a shared library you then add it to the classpath when you're deploying the application.

  • Gif file not found in JAR from Java Application

    Hello Forumers,
    Could some one please explain how to create a JAR file from where I can get a GIF file. I have tried a number of different ways but it allways fails. (I have tried to add the GIF files using the jar command and I have tried to add it using WinZip after the jar is created).
    To isolate the problem I created this very simple program, the program works very well when the gif file resides on the directory from where I run the Application, but when I remove it from the directory it fails. I have tried to put the GIF file in the JAR in a number of different ways but it allways fails. (I have also tried with and without slash before the name of the GIF). I guess the problem is the way I create the JAR file
    import java.io.*;
    public class GifTest
    { public static void main(String args[])
    { InputStream in = GifTest.class.getResourceAsStream("/open.gif");
    if (in==null)
    System.out.println("Null returned");
    else
    System.out.println("OK");
    Any Hints appreciated
    /Kjell

    Hi,
    here is a small application using my own class GetImageIcon.
    Normally I have this "help-class" in a utility-package to use it from all my projects without copying. For this example I copied the code in the test application. Feel free to use the code of the class like you want. For me it works fine.
    Do the following:
    1. Create a folder called /meta-inf under the folder where the class-files are. Use a text-editor and create a file saved as "manifest.mf".
    manifest.mf tells the jar-file which is the main-class from where the application will start when double-clicked.
    It only has to contain one line:
    Main-Class: GifTest
    2. Compile and create the jar file. I made a bat-file containing:
    javac -verbose GifTest.java
    %pause
    REM Create Jar-File
    jar cmf meta-inf/manifest.mf GifTest.jar *.class *.gif
    REM Show Table of Content of the Jar-File
    jar tf GifTest.jar
    %pause
    So you can see what's in the jar-file.
    3. When you double-click on the jar-file the application is executed. So it is easier to use for the users. They don't have to type in anything on the command-line. You can deploy this jar-file to any client and run it. The only thing you have to do, is to install the JRE on the clients.
    I develop with JDK 1.3.1 and JRE 1.3.1 is installed on the clients of the company I work for.
    //Begin of the code
    import java.io.*;
    import java.awt.*;
    import javax.swing.*;
    import java.util.jar.*;
    public class GifTest extends JFrame
            protected JLabel m_title;
            protected ImageIcon m_image;
            static File file;
            //You have to define the name of the jar-file
            static String jarFile = "GifTest.jar";
            //Instance of the class GetImageIcon
            protected GetImageIcon gii = new GetImageIcon();
            public GifTest()
                    super("GifTest");
                    setSize(400,200);
                    //the name of the image and the name of the jar-file the image resides in
                    m_image = gii.getImageIcon("orb.gif", "GifTest.jar");
                    m_title = new JLabel(null, m_image, SwingConstants.CENTER);
                    getContentPane().add(m_title, BorderLayout.NORTH);
            public static void main(String argv[]) {
                    GifTest frame = new GifTest();
                    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    frame.setVisible(true);
    public class GetImageIcon{
    * @param fileName the full qualified name of the file
    * from the root of your application. use a "/" before the
    * fileName, eg. /images/warning.gif
        public ImageIcon getImageIcon(String fileName, String jarName) {
            int counter, c, i = 0;
            byte buffer[];
            JarFile  jfile;
            JarEntry jentry;
            InputStream in;
            ImageIcon m_image;
            try{
                    // Create Jar-File object from JarFile
                    jfile = new JarFile(jarName);
            catch(Exception ex){
                    System.out.println("JarFile-Problem " + "\n" + ex);
                    return null;
            try{
                    // create Jar-Entry object from File-Name in JarFile
                    jentry = jfile.getJarEntry(fileName);
            catch(Exception ex){
                    System.out.println("JarEntry-Problem " + "\n" + ex);
                    return null;
            try{
                    // create InputStream from JarEntry
                    in = jfile.getInputStream(jentry);
            catch(Exception ex){
                    System.out.println("JarEntry-Problem " + "\n" + ex);
                    return null;
            try{
                    //get uncompressed size of entry data in Jar-File and create byte-array with this size
                    buffer = new byte[(int)jentry.getSize()];
                    //write int-value 'c' (casted to byte) with read() and while-loop in byte-Array
                    while((c = in.read()) != -1){
                            buffer[i] = (byte)c;
                            i++;
            catch(Exception ex){
                    System.out.println("in.read()-Problem " + "\n" + ex);
                    return null;
            try{
                    //create ImageIcon with byte-Array 'buffer'
                    m_image = new ImageIcon(buffer);
            catch(Exception ex){
                    System.out.println("ImageIcon-Problem " + "\n" + ex);
                    return null;
            // return the created ImageIcon
            return m_image;
    }

  • How to import external jars in a CAF project?

    Hello Experts!
    Could you help me find out the way to import external jars in a CAF project. I have tried to import the jars
    in ejbmodule using "java build path--->libraries". But while trying to build the project it's displaying error and all the imported jars automatically get removed from the list.
    I have read that creation DC of type "External Library" can help me.
    1) Create a DC of type external library
    2) Copy my jars to folder "libraries"
    What should I do next? And how can I import my DC of type "External Library" to my CAF project?
    Looking forward for your suggestion.
    Thanks & Regards
    Vitaly

    Hi,
    This article will guide you how to deploy the external jar files to the application server.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/60a0f850-c451-2c10-a6a6-ddcabfa3a65b&overridelayout=true
    Add the library project to the public part of your caf project to use the jar files.
    Regards,
    Gayathri

  • Problem using Jar to include external jars in an application

    Ok so, I've just completed a project, and i want to be able to jar it up so its executable by just using the jar file. I can do this, and it will load the first screen. However, i used eclipse to develop it so I just added two files to the eclipse path and it all worked. But when I jar up my application (and include the two external jars in my app), and try to use any class that needs the external jar, it dies and says java.lang.NoClassDefinitionError: javax/servlet/http/HttpServlet
    How do i set it up so it actually finds the classes in the external jar?? Its fairly important that i get this to work :)

    If this app is not running as part of Tomcat, you have two options. One, as ejp pointed out, is to put the missing jars into your $JAVA_HOME/lib/ext dir. If you've already tried that and it's not working, then the jars your putting there do not have the necessary classes in them. Use 'jar -tf <jarname>' to see a list of the classes in the jar.
    The second approach, which it sounds like you've already tried, is using the Class-Path entry in the Manifest file. You must make sure that the jar you're referencing (servlet.jar) has the missing classes in it, and that the jar is in the same directory as the application jar. Another potential gotcha with this approach is to make sure that the jar is not indexed (they're not indexed by default).

  • Import MDM jars to DC

    Hi All,
    I have created a DC, I want to import a few MDM jar files to this DC. I tried copying the jar files into the lib folder of the DC and then set the path in the java build path, but when I try to build the DC the reference path that was set goes off and throws an error that it is unable to import those jars.
    I also tried adding these jars as "add external jar" but it throws the same error saying unable to resolve the path.
    Is there specific way we need to follow to add a MDM jar to a DC? The same code worked fine with a normal project, but not working when Iam using a DC. Please advise.
    Regards
    Suresh

    Hi Suresh!
    Thank you for your detailed answer. I am developing a Local DC Web Dynpro workflow, using CAF GP.
    The system I use: NetWeaver 2004s SP9 (Sneak Preview), and NetWeaver Developer Studio, version 7.0.07.
    I also deployed com.sap.mdm.tech.mdm4j.sda which contains all the MDM jar files, but these cannot be reached using DCs as far as I know.
    So thats why I need to create another Local DC which contains the MDM jars and after I have created it, I can add it as "Used DC" to my Web Dynpro type DC.
    The workflow is going to be displayed on Portal so I need to create Callable Objects. After I got the following document, I started to develop my WD project as DC.
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/50d74ada-0c01-0010-07a8-8c118d408e59">Implementing a WD CO which Implements the GP Interface</a>
    I went through the steps you suggested, after I have built the J2EE/Enterprise Application DC I deployed it. Then I added it to my WD DC as "Used DC" but the build failed, because of errors where the implementation uses the MDM Java API.
    Have you any ideas what can cause the problem, or how to solve it?
    Could you please tell me the version of NetWeaver, which solved your problem!
    Thank you for your help in advance!
    Kind regards,
    Peter
    Message was edited by:
            Peter Ley

  • 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

  • Importing a jar w/ or w/o using classpath

    I need a programmable way to do the following.
    I have 3 jar files I want to use in my program: 1) looks-1.3.1.jar, 2) OfficeLnFs.jar, 3) winlaf-0.5.1.jar.
    I don't really understand how the classpath works in detail. I have tried my program out with my own system and it works fine, probably because I have those three in my classpath. I try it on other machines or inside virtual machines that I have not installed those on and it does not work.
    I would like to import those packages and use them without haveing to install tem on client machines except within my own directories of the program.
    Can this be done without the classpath, and if so, how?

    There is a Class-path entry in the manifest you use when you create a jar file where you can specify other jar files that are to be on the classpath. Read the doc for the syntax.
    Add that entry to manifest for the first/starting jar for your application.
    Then if you start your application by:
    java -jar first.jar
    java will start with the Main-class and use the Classs-path value to find the other jars. The other jars probably have to be in the same folder.
    Another solution is to move the extra jar files into the java folder labeled: ext within the lib folder.

  • Can a PDF be imported in a Web Dynpro Application

    Can a PDF be imported in a Web Dynpro Application than deployed into a New Archive and be able to displayed in the browser?  Instead of creating the PDF from scratch.

    I am sorry, I did find the tool menu.
    I did import it and created the datasources for the form.
    And I get this error messege when I deploy:
    Error stacktrace:
    java.lang.ClassCastException
         at com.acc.demo.salestaxreturn.wdp.IPrivateSalesTaxReturnCompView$IContextElement.wdSetObject(IPrivateSalesTaxReturnCompView.java:201)
         at com.sap.tc.webdynpro.progmodel.context.AttributePointer.setObject(AttributePointer.java:222)
         at com.sap.tc.webdynpro.clientserver.uielib.adobe.impl.InteractiveForm.afterHandleActionEvent(InteractiveForm.java:106)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.afterHandleActionEvent(ClientApplication.java:1085)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:393)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:635)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)
         at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:249)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:48)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:385)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:263)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:340)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:318)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:821)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:239)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)

  • Don't know how to make my main class import a jar file

    OK, the title doesn't make much sense but here are my create-jar.bat and manifest files:
    create-jar.bat:
    jar cvmf manifest.txt dassimul-admin.jar player/ admin/ com/ connector/ common/ *.class
    manifest.txt:
    Main-Class: admin.DASAdmin
    the problem is that in connector/ folder there is the jdbc mysql connector driver (.jar file).
    in Eclipse I can add this jar to the Java Build Path, so the program runs.
    When I double-click the dassimul-admin.jar file, I get a Class Not Found Exception
    C:\MYWORK\dassimul>java -jar dassimul-admin.jar
    FATAL ERROR WHILE LOADING SQL DRIVER: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    I think that the problem lies in the fact that admin.DASAdmin can't see and import the jar file in connector/ folder... am I right?

    It looks like you are putting the mysql jar file inside the dassimul jar. That won't work unless you write custom code. You should use the Class-Path attribute of the manifest to define a relative path(s) to the other jar(s) that you need to use.
    [http://java.sun.com/docs/books/tutorial/deployment/jar/index.html]

  • Import file  export  instead of  application export

    Hi All
    please help
    i exported my application, now i wanted to do an import to the file
    i did import ------->
    import file : i choose the application export file
    file type : i choose instead of application,page or component export i choose by accidently :*file export*
    did NEXT -> it wrote : Successfully Imported File
    then it wrote If you wish to to Install now, click Next >.
    i did NEXt : it wrote to me in the header :Install Static Files
    logget in as : my user
    install file workspace : name of the workspace
    but i did not push the button of install static files. then i saw that this is not what i won't to do . my quetsion is did i do any harm?
    is the statis files (which i don't really know waht it is ) are sitting on the server , or in the application ? please tell me, is there anything that i need to cancel? i saw in the export ripository that it shown as static files export.
    note : as a person who develope on this application , i've never, use an import of static files.
    inspite of all this, i started to do an import for my application which the suitable file file type , and i stopped in the middle.
    i'll be grateful for a quick response!

    Hello Arie !
    thanks for quick response.
    i've choose onw of the two application which i currently have on my workspace and did what you've wrote with the share componennts -> static files , it right to me no static files. i did the same with my other application , and i got the same message, maybe i'm getting this message because i did not do the install operation ? . however share components are related to the application that i've choose and not to all the apex, right ?
    the thing that i don't get is if i get:no static files found,so why in the Export Repository i'm getting about one application export file:static file export?
    can i delete it from there ?

  • How to import external jar file

    i am using bcprov-jdk14-124.jar file for my project. i can import this jar file through eclipse project properties but this is not worklng when i create jar file for my project. This is worked in eclipse only. i want to use that jar file in my project current path. so any body help me how to import this jar file? ( i am using mac os to develop java project )

    You need to specify the classpath when you execute it outside of Eclipse.
    Kaj

  • Xpath expression not working with xmlparserv2 10.x jar in websphere application server 8

    Hi,
    I am using xmlparserv2 10.x  jar in websphere application server to transform xml. Due to some unknown reason we are seeing inconsistent result for the xpath expression we used inside the xslt.
    .|following-sibling::* This is the xpath expression we use.
    the meaning of the expression is to union the current node and the following siblings of the current node. But while rendering the page( a servlet) for first two times it gives the expected result. From the third time, it is giving unexpected results. It is missing the first node in the following-sibling::* So it just results in current node and misses the next node and then combine the nodes following the next node.
    For example when executing the above expression on the node A , it should result A B C D. It is returing correctly for first 3 times. From the 4th time it just results  A C D and misses B.
    <root>
         <A />
         <B />
         <C />
         <D />
    </root>
    But it giving results consistently when using xmlparserv2 9.x jar. But it is not 1.5 compliant.
    Pleas help!..
    Thanks,
    SP.

    If you are new to JSF, then I'd try and simplify the environment in which you are working as the first step to achieving a successful outcome.
    JSF 1.2 is a certified and well tested component of WLS, so we know it works. I'm not sure of the effect of all those additional modules you are adding in there -- it appears as if you have gotten a Faces implementation instantiated, but there could be some form of version difference/conflict since it can't find a method its looking for.
    Using Oracle Enterprise Pack for Eclipse (http://www.oracle.com/technology/software/products/oepe/oepe_11115.html) you can build yourself out a pretty simple JSF application to get started from and deploy it to a WLS server. This would remove all the additional libraries you currently have, provide you with a bundled applicaton to deploy and give you a pretty good environment from which you can learn and experiment with JSF.
    -steve-

  • Static initialization of java code included in the Imported Archives jars?

    Hi
    Does SAP PI 7.0 support static initialization of java code included in the Imported Archives jars?
    Static block of a java class included in the Imported Archive jars throws a Runtime Exception called ExceptionInInitializationError while trying to run.
    Regards,
    RDS

    Have you tested the code outside PI?

Maybe you are looking for

  • At max how many logical columns can be created in RPD

    Hi All, At max how many logical columns can be created in RPD. I have a requirement of creating 200 columns. Will there be any problem . Is there any predefind number of columns for RPD creation?? Please help ..

  • How To:  write a logo image in a list display report

    I have a simple list report that I create with a bunch of write statements.  How can I insert a Logo image on this report ? I have my Logo image loaded in SE78 as a bitmap graphic. Not sure if with the write statement, I can write out this logo on my

  • Replace KMS server with same-named server

    I need to replace my KMS server (win2008r2) with a new server (win2012r2), but with the original server's name.  This is my plan:       Shutdown the current KMS server and remove it from AD, WINS & DNS       Rename the new server with the old server'

  • Album Art doesn't work

    Recently, when I put album art on the iPod, it won't recognize it. Roughly about 2/3 of the songs on the iPod will display the art but the other fraction doesn't even recognize it. It shows up fine in iTunes, both on the hard drive and the iPod and I

  • Add MIME to XML

    Hi, what would be the best way to add a MIME object to XML? I am reading the MIME object with class CL_MIME_REPOSITORY_API. I am unsure how to get the XSTRING into a suitable XML format. Thanks. /Björn-Henrik