Jar File Problem Using External Packages

I am having problems creating an Executable jar file that imports classes from my own package.
I can create an exe jar no problem without using any external packages, but when I use an external package the jar will not execute.
I am using WindowsXP, my package is in,
C:/MyClasses/Database
the class files are stored loose, not in a jar file
I have tried altering the class-path in the manifest file, but to no joy - I may have not changed the classpath correctly!
Please help
Magic

This is a mine field of "correct programming style."
External jars, if very general, could be placed in the directory jre/lib/ext.
In some cases you can unzip the external jars and add them to your own jar.
The manifest.mf migth be looked into, and of course you need to communicate your patching!
As you remarked, it might be a problem of class path usage.
For that the jar tool documentation might explain it better than I.

Similar Messages

  • Jar file problem , please help

    Hi guys , i am not sure if i am in the right place to have this post in so i'll give it a try
    i know my explanation might be a shot in the dark but i'll try my best
    i have made a program using eclips , to send emails using my email , on certain conditions
    so when that codition happenes on some class in my program
    this class will call the email class and send an email to someone
    now the problem is not in the program , because as along as this program is in eclips and i run the program in eclips , everything goes fine , No errors what so ever
    but , if i make jar file , using eclips "export"
    once i run the program , the program would run , but once the same condition that ihave specified previously happenes , the current class never calls the email class , and no emails would be sent
    i am very confused wether
    1) it throws a class not found for some wierd reason
    2) or the external library that i used to send emails , is not exported
    i tried to check the CLASSPATH file and i think everything seems to be fine , so i dont know what the problem is
    so in short
    if the program is in eclips , every thign goes fine
    if the program is a jar file , then it would work fine but once it needs to send an email , it never does and i can still work on the program , but no emails will be sent
    thanks please some one help me out with this

    for more information here is the senario
    because i see that you guys are some how lost because i am not providing enough information
    so this is a detailed info of the problem
    i have 3 classes
    1) mybankmain (jframe)
    2) mybankbody (all labels and buttons and events included here)
    now: within some events in my program ,
    it calls a class called.....
    3) myEmail
    this class imports two things that are comming from an external jar file , so in short , if the external jar file is not available the program would complain
    i run this on windows xp (SP2)
    now: if this program runs on eclips , it would do everything it is supposed to do and all kind of calculations will be done and emails will be sent on the conditions that i have specified within the program
    if i make a jar file on windows , and i run the jar file , the file would work , all functionalities will work
    EXCEPT: sending an email
    - either my class is not found
    - or external jar file is not found which causes my class not to be able to perform its tasks
    i did only one test
    which is that i switched the main and i made myEmail as a main and i tried to export the jar file
    Result: jar file doesnt work
    the way i view whatever inside my jar file , i use Winrar and it would view everythign in the jar file and i see that all my classes are included there
    if i open my CLASSPATH , i see that there is a pointer to the external jar file
    if i open my manifest : i DO NOT see the exrernal jar file in there but i do see that its pointing to my main class
    class main : mybankmain
    and there is only the version and signiture
    i hope all these additional details would help in determining the problem that ihave been trying to solve for 2 weeks now

  • Jar file of Helliker.ID3 package

    Hey guys,
    I am facing a problem with making a jar file of hellikar.id3 package.I am importing hellikar.id3.ID3v2FormatException class but it is giving class not found error.I tried to set the classpath but its not working.Can any body please tell me how i should make the jar file helliker.id3.jar so that i can add it in lib/ext directly.
    Please tell about how i can use jar cvf filename.jar   with regard to class hierarchy.I created a jar file but it is not working so i figured out that there must be a problem with from where(directory) to make the jar file on command prompt.*

    Thespian wrote:
    Please tell about how i can use jar cvf filename.jar   with regard to class hierarchy.I created a jar file but it is not working so i figured out that there must be a problem with from where(directory) to make the jar file on command prompt.*Have you tried the Jar tutorial? [http://java.sun.com/docs/books/tutorial/deployment/jar/index.html]
    If you have gone through a tutorial and still have problems, I suggest you post a short example of what you try to do and what does not work. Include commands you use and error messages you get.

  • Jar files for using BRM API's

    Hello,
    I am not able to locate the Jar files for using BRM API's. I have tried searching the forum and did not find the name or location from where I can get them. If they are available on the server I could ask the basis team to give me a copy. Any help would be greatly appreciated.
    Regards
    Preetam

    Hi Adam,
    I have created a New EJB Project for my proxy development. This is the usual way I develop proxies for any given service interface created in ESR. Now i am not sure how to create  a dependency with the BRMS facade. If i find the jars i can add it as an external library when compiling.
    Can you explain a bit more about what you ment by "developing the java proxy in a development component", how did you accomplish this when creating a proxy for a service interface?
    http://help.sap.com/saphelp_nw73ehp1/helpdata/en/e2/3620cef55842cca4632664212f31b1/content.htm?frameset=%2Fen%2F81%2F097529e0e545e58bb2d7a34e4d0a2a%2Fframeset.htm

  • Problem using External Library DC

    Hello,
    First of all, I'm a java programmer kind of new to NWDI. I'm working on a Java DC that's meant to send e-mails which of course uses the JavaMail API, so I understand I have to add to my SC another DC of type External Library that contains the jar files I need. Here is where it all falls apart. I have followed step by step several possible solutions to this and still gettin' the "import cannot be resolved" error message in my Java Perspective. The procedure I'm using is the one described in this thread:
    Re: External Library DC question
    Can anyone help me out with this? I'm using NWDS 7.0.14
    Thanks in advance...

    HI,
    That post was to big. so without reading it im posting.
    1 create a library DC.
    2.Add the jar files in it.
    3. create a public part of type API and SDA.(use SDA if you want to deploy it with the project(just like an add external jar file) or use API part (if you want to use it as add jar file option))
    4. use that public part in you DC.
    5. use add jar option in your build path.
    if you have done these an having an error please tell me at what step you have a problem

  • Add jar files and use those classes at the runtime

    Hi All,
    I need to add some jar files at the runtime depends on which the user selects where the jar file is located and i need to import those classes in other class for some functionalities . I could add jar files by using the URLClassLoader and Class.forName("myjar.myclassname") is also succeeded and i have no clue how to use those classes with in the jar file as i couldn't import those classes also in the source because the jar files are being added at the runtime(This leads to class not found exception at the compile time).
    I had found a complicated way of using those classes after being added at the run time as below.
       Class clazz = Class.forName(myClass);
                final Method method = clazz.getDeclaredMethod(requiredMethod, new Class[]{URL.class});
                final Object returned = method.invoke(clazz.newInstance(), new Object[]{request}); but, its really pain to use in this way in all the places.
    Does any of you have simpler suggestions on how to achieve this?
    Thanks,
    Venky.

    Thanks jschell. Yes, you are right. I had found that using reflection API is the only way to load classes at the run time. But according to our application using reflection makes the application little complex, so while start of the application or during other modifications, i am overwriting my jar file to the latest one using FileChannel class as below
          FileChannel ic = new FileInputStream("new.jar").getChannel();
          FileChannel oc = new FileOutputStream("old.jar").getChannel();
          ic.transferTo(0, ic.size(), oc);
          ic.close();
          oc.close();After this code is executed, our application totally uses the new jar file.It is little fast than using reflection. Is this a good idea?

  • Where is the .jar file that contain this package oracle.security.idm

    Dear Everybody
    Could you tell me where is the .jar file that contain this package
    oracle.security.idm
    Thanks for your help

    Hi,
    check jdeveloper_home\jdeveloper_10133_<version>\jlib\identitystore.jar
    Frank

  • From where can I download the jar files to use JAXB 2.0?

    Hi all,
    From where can I download the jar files to use JAXB 2.0?
    ~Regards

    Does the government not let you do Internet searches where you live? My Internet search for "JAXB 2.0" returned this:
    https://jaxb.dev.java.net/
    as the first link. If you can't find it from that page it doesn't exist.

  • To add the JNI dll to the jar file and use the dll inside the jar file

    Hi to everybody,
    I am new to java.
    I want to add the JNI dll to the jar file and use it in the java class.
    How can I achieve it.
    Please help me.
    Thanks in advance.
    Regards,
    M.Sivadhas.

    can't be done because none of the known operating systems support reading binary libraries from .jar files ... you can add the binary to the jar but then you have to extract it...
    besides, mixing platform specific and platfrom independent components is not a very good idea, i'd keep the dll out of the jar to begin with

  • Problem using external jars in my java component

    Hi Guys,
    I just wanted to ask how to properly reference an external jar to a java dc. I already have an external library dc which contains my external jars and also compilation and assembly public parts,  a j2ee library which has the assembly public part of the external jars that is deployed to the server, a java dc which has the compilation public part of the external jar.
    My problem is whenever I trigger a method of the java dc in my webdynpro dc I'm having an exception. weird thing is when I put the whole method from the java dc to the webdnypro dc it functions well. So I'm thinking if the interaction between my java dc and j2ee lib dc has to do with this maybe I'm missing some configuration.
    need your insight on this one.
    Thanks,

    Hi TznHuang,
    Pleaserefer to this blog might helpful for you
    /people/raphael.vogel/blog/2008/05/05/how-to-use-external-libraries-in-the-sap-component-model-part-ii
    Also please build external DC and then sync sorurces and sync used DC from inactive DC TAB for DC where you have used
    external DC.
    Hope bit helps
    Regards
    Arun Jaiswal

  • Problem in viewing a converted JavaHelp (jar) file (created using RH2002 to RoboHelp X5)

    Hi,
    I have a javahelp project (compressed javahelp) created using
    RoboHelp 2002. The output files are jar files.
    The source files are .mpj. When I view the existing jar files
    without converting the project to .xpj I am able to view the jar
    files.
    However, this project needs to be upgraded to RHx5. During
    conversion(.mpj to .xpj) everything seems to be working fine and
    the javahelp files are generated. But when I try to view the jar
    files nothing is diplayed.
    I get the following error. Please see below.
    Has anybody come across anything similar? Is there anything I
    need to take care of before I upgrade to .xpj? I cannot locate the
    glo.xml file in RH.
    Best regards,
    Urmi
    Parsing failed for null
    Exception caught while parsing jar:file:C:/Documents and
    Settings/urmiroy/Desktop/ep2_cd1helps/Developer_edit/JavaHelp/FLEXIEDGEBTS_dev_edit.jar!/ FLEXIEDGEBTS_dev_edit_glo.xmljava.io.FileNotFoundException:
    JAR entry FLEXIEDGEBTS_dev_edit_glo.xml not found in C:\Documents
    and
    Settings\urmiroy\Desktop\ep2_cd1helps\Developer_edit\JavaHelp\FLEXIEDGEBTS_dev_edit.jar
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at
    javax.help.MergeHelpUtilities.mergeNodeChildren(MergeHelpUtilities.ja
    va:89)
    at
    javax.help.plaf.basic.BasicGlossaryNavigatorUI.loadData(BasicGlossary
    NavigatorUI.java:217)
    at
    javax.help.plaf.basic.BasicGlossaryNavigatorUI.reloadData(BasicGlossa
    ryNavigatorUI.java:198)
    at
    javax.help.plaf.basic.BasicGlossaryNavigatorUI.installUI(BasicGlossar
    yNavigatorUI.java:146)
    at javax.swing.JComponent.setUI(Unknown Source)
    at javax.help.JHelpNavigator.setUI(JHelpNavigator.java:257)
    at
    javax.help.JHelpNavigator.updateUI(JHelpNavigator.java:276)
    at
    javax.help.JHelpNavigator.<init>(JHelpNavigator.java:105)
    at
    javax.help.JHelpGlossaryNavigator.<init>(JHelpGlossaryNavigator.java:
    62)
    at
    javax.help.GlossaryView.createNavigator(GlossaryView.java:82)
    at javax.help.JHelp.setupNavigators(JHelp.java:148)
    at javax.help.JHelp.<init>(JHelp.java:126)
    at javax.help.JHelp.<init>(JHelp.java:76)
    at
    sunw.demo.jhdemo.JHLauncher$DisplayAction.actionPerformed(JHLauncher.
    java:956)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown
    Source)
    at
    javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknow
    n Source)
    at
    javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at
    javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
    Sour
    ce)
    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.pumpEventsForHierarchy(Unknown Source)
    at java.awt.Dialog$1.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(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)

    Hi Colum,
    Thanks for your reply.
    Yes, I have gone through the Peter Grainge's article. It is
    indeed very informative and I have installed the JDK and the JH
    according to the instructions given therein. My installation seems
    complete as the viewer works fine. The JDK version is 1.4.2_18 and
    the JH version is 2.0. The environment variables have also been set
    accordingly.
    All this while I was thinking it is a Java issue so I have
    tried out with different JDK versions.
    But now I think it can be a tool issue because :
    I can view the existing JavaHelp file with the current Java
    viewer.(if I do not open the project in X5)
    I can view Sun supplied sample jar files with the viewer.
    I can create new JavaHelp files with RHX5 and the current JDK
    and JH installation and view those files.
    I cannot view the JavaHelp file if I convert the .mpj to .xpj
    (the generate dialog works fine and says compilation is complete).
    The Display button does not display the file. The view
    command line command throws up the error mentioned in my earlier
    mail.
    Would appreciate any pointers.
    Best regards,
    Urmi

  • How to deploy jar file for use within mapping user-defined fcn

    Hi all,
    I have a java class I'd like to called from a mapping user-defined function.
    Here's what I've done (but hasn't worked)
    1. Added 'package com.<mycompany>.xi.util.base64 to the source class file and compiled it.
    2. Created a sda with a plain provider.xml file, i.e. no references were made to any other library files.
    3.  Deployed the sda to the xi 3.0 j2ee server successfully using SDM.
    4.  Under the Visual Admin tool, I see that the library was deployed successfully.
    5.  In the import text box in the user-defined function (design time), I enter com.<mycompany>.xi.util.base64.*.
    A syntax check returns an error indicating the package could not be found. 
    Can anyone give me pointers as to how I can get this working?
    Thanks,
    --jtb

    Hey James,
    No! That's not the right way!
    What you have done is for accessing external JMS & JDBC drivers in their corresponding adapters. For the access inside a mapping user defined function, it's enough if you import the jar files.
    Look at this blog and you will be very clear!
    /people/divya.vidyanandanprabhu/blog/2005/06/28/converting-xml-to-pdf-using-xi
    regards,
    Felix

  • Sincere Eclipse 3.0.2 build problems using a package for all Eclipse Java p

    Hi,
    I had the following problem:
    - jar-file put into a directory (for jdbc-access)
    - Environment variable set in Window/preferences/Java/BuildPath/ClassPathVariables:
    Name: classpath (could be any other name, does not correlate with WIN env. var.)
    Path: C:\java\eclipse\jars\mysql-connector-java-3.1.8-bin.jar
    - class-file was automatically built by Eclipse, error message:
    �. java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    In Windows I set the classpath environment variable to
    classpath=.;C:\java\eclipse\jars\mysql-connector-java-3.1.8-bin.jar
    In Windows/i.e., a DOS-Shell. It works
    As it didn�t work in Eclipse, I deleted Eclipse and installed it again (from an elder version I had on another workstation)
    After starting Eclipse asked me to rebuild all -> Yes (it then needed some time to do so)
    Then it worked
    So, right here I thought I knew how to go on in other projects using this jar-file, but:
    The same problem appears in another project, but it works in WIN/DOS command line, but not in Eclipse. Project/Clean und rebuilding automatically or manually doesn�t help.
    As a workaround for this project I did in
    Project/Properties/Java/BuildPath/Projects I marked a link to the project where it works (see above), and now it works, too.
    But I am not satisfied, I don�t like trial and error solutions.
    I suppose that Project/Clean doesn�t really clean properly.
    Has anybody made similar experience and knows the real solution?
    Thanks
    Michel

    JediKnight wrote:I didn't find it in AUR
    What search term did you use??  Here is monodevelop-git already in the AUR.
    It seems it may have been abandonded, but perhaps you could take over that package rather than starting a new one.
    Additionally, a patch is applied in that PKGBUILD.  Perhaps that could be needed to solve your problem.

  • Creating an executable jar-file including a custom package

    I am trying to learn how to create executable jar-files. I have managed this with a single class. However having a class which is an extention of another class which in turn belongs to custom package, I can't make it work.Running the program normally is not a problem. I don't think the problem is the actual code, but I will include it here anyway. I create the jar-file using:
    jar -cmf Direkt2b.txt Direkt2b.jar *.class
    where Direkt2b.txt is just:
    Main-Class: Diriekt2b
    Only the main class-file is included this way. Copying the other file to the same directory before creation doesn't help either. There is no error messages, the jar-file just refuses to run no matter what.
    The main-class:
    import java.awt.*;
    import extra.*;
    class Direkt2b extends ExtendedFrame {
         Font f;
         Direkt2b() {
              f = new Font("SansSerif", Font.BOLD, 24);
              setBackground(Color.yellow);
              setSize(400,150);
         public void paint(Graphics g) {
              g.setFont(f);
              g.setColor(Color.blue);
              g.drawString("V?lkommen till Java Direkt", 45, 100);
         public static void main (String[] arg) {
              Direkt2b d2 = new Direkt2b();
              d2.setVisible(true);
    The help-class:
    package extra;
    import java.awt.*;
    import java.awt.event.*;
    public class ExtendedFrame extends Frame {
         private static boolean first = true;
         private boolean isFirst = first;
         public ExtendedFrame() {
              addWindowListener(theListener);
              first=false;
         WindowAdapter theListener = new WindowAdapter () {
              public void windowClosing(WindowEvent e) {
              dispose();
              if (isFirst)
                   System.exit(0);
    }

    My problem wasn't really getting more than one class in a jar-file,
    but rather that my jar-file with multiple classes wouldn't execute.
    Reading the original post I realized that maybe I was unclear about that.
    However I have solved the problem now so for anybody reading this
    thread in the future I will tell you how.
    The general setting is this: You have a bunch of self-made help-classes
    organized in some classdirectory somewhere in the filesystem. You use these
    in your programming from time to time. You have set a classpath-varible
    in your OS such that Java could find your help-classes.
    Now you want to create executable jar-files so that you could publish your work.
    My problem was that while I added all needed classes in a jar-file, the main-class
    couldn't find the others because they were referenced incorrectly. The solution I
    came up with may not be elegant, but it works. I copied the main-class and all directories
    (only one in my case) just as they appear in the classpath-directory, to the same temporary
    directory. Then I created the jar-file from there, using: jar -cmfv Direkt2b.txt Direkt2b.jar Direkt2b.class extra/*.class
    I suspected that incorrect referencing was the problem and I tried several variations on the theme above
    before giving up and writing the first post. Part the problem was that I didn't get any error messages,
    just an annoying error-sound double-clicking the jar-file. I learned later that you could run jar-files from
    the command -prompt using: java -jar myjarfile.jar. This way you get a more useful response.
    I guess there is a way to include the classpath instead somehow, but I will use my method for now.
    I hope this was helpful to somebody.

  • JAR File problems

    Hello,
    I have a jar file with some code I wrote that accesses a jar file from a 3rd party. I want to include the 3rd party jar files inside my jar file. So I basially have a jar file with my code (unjarred) and include the 3rd party jar files in my jar. In my MANIFEST.MF file I have properly set the Main-Class property correctly, as well as the Class-Path property. I have set my Class-Path value to 3rdparty.jar which is the jar file at the root directory of my jar. When I run my jar file I get a NoClassDefFoundError saying the 3rdparty jar file is not found. I have added a new line at the end of my MANIFEST.MF file, and am actually using ant to create my MANIFEST.MF file. When I unjar my file everything looks correct. What is the problem here? I have made sure the 3rd party classes that my code access are in the jar. What could I be doing wrong??

    Standard Java does not support placing a jar file within another jar.
    You can search for 3rd-party alternatives, ow write your own custom classloader.

Maybe you are looking for