JAR file with 3rd party package

Hello.
I am sorry if similar question has been asked many times. But I really have no idea to make the JAR work...
I have downloaded dom4j package into my Windows XP machine. And put the file to my C:\j2sdk1.4.0\jre\lib\ext\. Then I develop my application in other directory. Is there a way to edit the manifest file such that the JAR file can contain all the classes including classes from dom4j, such that I can run the application in other machine that without dom4j's jar file in the ext directory?? Thank you very much.

why not?
1. extract dom4j.jar
2 add all extracted files to your own .jar file..
everything will be ok.
The following may help you..
JavaJar(written by java) can compress and decompress jar,war, ear and.zip...
it can deal with manifest file and executable .jar file .specially.
may download from http://www.qwerks.com/download/4114/JavaJar.zip
the tool is very verygood tool.
but the homepage(www.pivotonic.com) of JavaJar cannot be accessed.
it is funny.
good lucky.

Similar Messages

  • Packaging  jar  file with classes

    Hi experts,
    I want to clarify a problem in relation with packaging .class files in jar file making
    it jar executable.I was able to achieve this when number of classes are limited and confined to only a single program.However recently i developed a software
    which is very much like SQL*Plus and retriee my company database using screen buffer management and i have handled almost all the issues.
    But so long to execute this program i am typing
    java <Program name>.It is using Oracle as backend.
    I tried to package Oracle driver files in jar using
    jar -cmf manifest.mf sqlpad.jar *.class Oracle\
    where Oracle directory contains all the class files in separate folders like
    Oracle\javax etc
    I get a jar file with hefty MBs size.It is executable too.But when i try to connect to
    database, i get message Oracle driver class is not found.
    In what way should i package it as jar file ?

    I wouldn't add the drivers to the JAR itself. Instead, I'd suggest one of the following:
    1.) Add classpath entries into your manifest file pointing to the drivers' JARs
    2.) Create a batch file for starting that contains a call to "java -classpath ..."
    3.) Add some way to your app to configure additional classpaths at runtime and use a URLClasssLoader (and a wrapper class for the driver for registering with the DriverManager) that loads the driver's class

  • ANE with 3rd party libraries

    Short Version:  How does one package 3rd party dylib dependencies with an ANE on MacOS?
    Extended Version:
    I have an ANE that dynamically links with 3rd party libraries.  I am working on MacOS.
    My ANE framework dylib file links with the 3rd party library dylib.  However, when I package a bundle application with the ANE, the ANE fails to initialize, throwing an Error: "ArgumentError: Error #3500".  I have inferred that the issue is failure to find and link my 3rd party library dylib.
    If I run my AIR app from a Working Directory that contains the 3rd party library, everything works.  This implies that the linker is only looking in the Current Working Directory and not the locations of the 3rd party dylibs.
    I have included my 3rd party dylibs with my ANE framework, for instance:
    MyANE.framework/MyANE
    MyANE.framework/Resources/3rdparty.dylib
    I have used otool to inspect the linkage for MyANE.framework/MyANE:
    MyANE:
              libMyANE.dylib (compatibility version 0.0.0, current version 0.0.0)
              @rpath/Adobe AIR.framework/Versions/1.0/Adobe AIR (compatibility version 1.0.0, current version 1.0.0)
              ./3rdparty.dylib (compatibility version 1.0.0, current version 1.0.0)
          /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)
              /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
    Ok, you see that it wants to load from CWD.  I tried changing the 3rdparty.dylib linkage, as so:
    install_name_tool -change ./3rdparty.dylib @loader_path/Resources/3rdparty.dylib MyANE
    but the application displays exactly the same behavior:  It only works if I run from the folder containing 3rdparty.lib.
    Are there some kind of additional platform options I have to set while packaging the ANE?
    Thanks!
    JW

    Hello,
    I assume your client is standalone (or runs outside of the WLS JVM) if so you will need to put the required jars on your clients classpath.
    cheers
    Hussein Badakhchani
    www.orbism.com

  • Where to install 3rd party packages

    Good evening...
    i just downloaded the regex package from jakarta (jakarta-regexp-1.2) and un-zipped to some directory on my harddrive.
    but is that really what i wanted to do? where do you usually install 3rd party classes and their documentation?
    i realize for distribution my application jar will have to include the jakarta-regexp-1.2.jar; this question is more about what's the best way to set-up the development environment. just wondering if there's some standard that i should adhere to make my life easier when using other people's libraries.

    There are 2 jre's, C:\jdk1.2.2\jre is the one you want to develop with. The othere one is for windows and ie when they need to run a java program (don't worry about this one).
    To setup the development environment, make sure that javac and java are in your PATH variable. I suggest making an environment variable JAVA_HOME=C:\jdk1.2.2 and setting your path to PATH=%JAVA_HOME%\bin;%PATH% . If you need an applet to use the 3rd party package, it's better to use the plug-in and point it to use the C:\jdk1.2.2\jre.
    Good luck,
    Bud

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

  • Unable to open files from 3rd party websites/applications

    Hi all,
    My new macbook arrived with QT 7.0.4, I used it perfectly for a week with no problem, but now after carrying out a 'software upgrade' via system preferences to QT 7.1.1 I now find that Quicktime will not open hardly anything!!!! Not bad considering Apples information at the download window states that 7.1.1 was implemented to fix bugs that prevented QT from opening files in 3rd party applications. Whats going on?.......
    In the mean time I've had to carry out a system reboot to go back to QT 7.0.4 and now its back to how it should be. What version of Quicktime 7 am I going to have to wait for before this issue if rectified?
    Cheers
    Smarteee

    Thanks all

  • Exporting a jar file with its libraries

    Hi there,
    I have problem while exporting jar files with Eclipse.My program uses db2driver libraries and i want to make stay these library files while exporting the main program but there is no choice to make it like that. And when i execute my program jar file it throws a class not found exception for db2drivers ...
    How can i pack the jar files with my program jar?
    Thanks for help.

    Hi Peter,
    I made the changes but still got the problem...
    here is my .classpath file:
    <?xml version="1.0" encoding="UTF-8"?>
    <classpath>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    <classpathentry exported="true" kind="lib" path="db2jcc_license_cu.jar"/>
    <classpathentry exported="true" kind="lib" path="db2jcc.jar"/>
    <classpathentry kind="output" path="bin"/>
    </classpath>
    when i execute my jar file it throws a ClassNotFoundExeption for DB2Drivers which are in db2jcc.jar ...(my startng class is at src package)
    Thanks..

  • How to run jar file with classpath?

    Hi, all,
    I have some package in my project, with which I have a java help jar file as classpath, when I run my project, I need the jh.jar file in directory /jar/jh.jar.
    Now, I bundled all my class packages into a jar file, my.jar, together with the /jar directory. When i run my jar file with command:
    java -jar my.jar
    It tells me couldn't find javahelp class.
    What shall I do? How can I create my jar file with the jh.jar?
    Thanks in advance.

    Thanks, hjembaek,
    But it doesn't work for me. I am running in windows, it still generate the error:
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/help/HelpSet
    at own.gui.OwnMenuToolBar.getOwnHelpBroker(OwnMenuToolBar.java:560)
    at own.gui.OwnMenuToolBar.addHelpMenu(OwnMenuToolBar.java:327)
    at own.gui.OwnMenuToolBar.getOwnMenuBar(OwnMenuToolBar.java:188)
    at own.gui.OWNDPTool.initGui(OWNDPTool.java:55)
    at own.gui.OWNDPTool.<init>(OWNDPTool.java:39)
    at own.gui.OWNDPTool.main(OWNDPTool.java:100)
    Here is my command to generate the jar file:
    jar cfm Own.jar temp.txt help own log others
    temp.txt is the file including the main class and class path information
    I have help folder, log folder and own package, others is directory that has the jar file(others/jh.jar)

  • I want to make use of Axis1_2 jar file with latest jdk

    hi, Good Moring
    i have developed an application by using axis1_2 with JDK 1.4. its working fine and everything good. but now the issue is they want upgrade latest JDK 1.6, when i tried to upgrade to latest JDK 1.6, its showing an error that enum is a keyword from jdk1.5 onwards.
    in my axis 1_2 jar file enum is a package name. so can any body help how to solve this problem please.

    if go for updated axis, there are lots changes are there, they have included so many packages and they have changed many package names too. and i have to include many of other jat files too.
    an at the sam etime i have to chage in my application package names and in class files too. if its like that i have to develop again new Application.

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

  • Installing a JAR file with NAL

    This is in reference to my previous message about trying to use NAL to get
    to a URL with System Rights...
    In addition to having to install Java to use our new webpage, there is a jar
    file that has to get pushed out, too.
    It's not available as an executable, but, is there anyway to push out a jar
    file with NAL? Does it need to be run, or, just copied somewhere, and, if
    so...where?
    Thanks!

    We have an AGFA Imaging system that puts digitized x-rays, CAT-scans, etc.,
    up on a webserver, so that docs all over our hospital can pull them up and
    look at them.
    The previous system HAD to use the MSJVM, but, last Saturday they upgraded
    the system (not really telling us the requirements ahead of time...<G>), and
    it had to use the Sun JRE. Sooo....I had to setup an AppObj last Sunday to
    push out Java to all workstations, so went to Java.com and downloaded the
    latest version, 1.5.x
    Well...of course they had to use a certain version, 1.4.1_01, and, it
    wouldn't work with 1.5.x at all, so, I pushed that out, then it turned out
    that they use a product from Germany (AGFA, you know) named JacoZoom, and a
    jar file is asked to be run by the users when they first login to the
    website, and, of course...you have to be an Administrator.
    Our VA Security Managers like to over-protect us, so, the German site
    hosting JacoZoom is blocked, and, rather than drive home and download what I
    needed, I thought it would be easier just to push out the URL with System
    Rights temporarily (you understand that by this time, Monday afternoon, all
    our 400 doctors were up in arms because they couldn't view any images), and
    then the trying to push the URL just didn't work.
    Sooo...I drove home and got the JacoZoom product (had to buy it), which is a
    large executable containing several JAR files when exploded, one of which
    was the one that was being pushed out. Running the executable didn't do the
    trick (not sure why), and the JAR wouldn't run, even manually, but, I
    FINALLY found an email from another tech going through the same hassle, and,
    all he did was push a different JAR file to the \lib\ext folder in the JRE
    1.4.1_01 folder...and it worked.
    I did that, and, it worked, and deployed it all over the building.
    Welcome to my world--and, I'm not complaining, because with SMS (which we
    have to run, but don't use), I'd still be configuring the deployment
    package.
    Thanks.
    "Anders Gustafsson" <[email protected]> wrote in message
    news:[email protected]...
    > Bill Bradley,
    >> I pushed it to all sorts of locations, without luck. Do you have to RUN
    >> Jar
    >> files, somehow?
    >
    > It depends on what it is. A jar file is just a PKZIP file with java
    > classes. Is
    > this part of a greater something?
    >
    > - Anders Gustafsson, Engineer, CNE6, ASE
    > NSC Volunteer Sysop
    > Pedago, The Aaland Islands (N60 E20)
    >
    > Novell does not monitor these forums officially.
    > Enhancement requests for all Novell products may be made at
    > http://support.novell.com/enhancement
    >
    > Using VA 5.51 build 315 on Windows 2000 build 2195
    >

  • How can I get a single jar file with NetBeans?

    How can I get a single jar file with NetBeans?
    When I create the project I get these files:
    dist/lib/libreria1.jar
    dist/lib/libreria2.jar
    dist/software.jar
    The libraries that have been imported to create the project are in separate folders:
    libreria1/libreria1.jar
    libreria2/libreria2.jar
    libreria1, libreria2, dist folders are all located inside the project folder.
    I added the following code to the build.xml:
    <target name="-post-jar">
    <jar jarfile="dist/software.jar">
    <zipfileset src="${dist.jar}" excludes="META-INF/*" />
    <zipfileset src="dist/lib/libreria1.jar" excludes="META-INF/*" />
    <zipfileset src="dist/lib/libreria2.jar" excludes="META-INF/*" />
    <manifest>
    <attribute name="Main-Class" value="pacco.classeprincipale"/>
    </manifest>
    </jar>
    </target>
    Of course there is also the project folder:
    src/pacco/classeprincipale.form
    src/pacco/classeprincipale.java
    Can you tell me what is wrong? The error message I get is as follows:
    C:...\build.xml:75: Problem creating jar: archive is not a ZIP archive BUILD FAILED (total time: 2 seconds)

    This is not a NetBeans forum, it is a JDeveloper forum. You might want to try http://forums.netbeans.org/. I also saw your other question - try looking in the New to Java forum: New To Java

  • XML File to 3rd Party Provider w/o any Middleware

    Hi
    I have a requirement wherein we are required to send XML files to 3rd Party Supply chain provided w/o using any middleware in most secured form. The Customer is on ECC5.
    One of options i could think about is as mentioned below.
    -  file based and using SFTP to send the XML file to 3rd Party provider
    Could you please let me know if their's any other alternate approach to meet this strange requirement.
    PS : 3rd party provider can provide webservice. But the question is how do we consume this into ABAP envirnoment and call them into ABAP COde. Any pointers on this as well would be really helpful
    Thanks

    Hi,
    I remember working on ECC5.0 and consuming a web service to create an ABAP Proxy.
    @ Ravi
    Refer the below link for consuming a web service and creating an ABAP proxy.
    http://help.sap.com/saphelp_nw04/helpdata/en/bf/d005244e9d1d4d92b2fe7935556b4c/frameset.htm
    Regards,
    Chen

  • Connecting my iPhone 4S with 3rd party composite cable; error "accessory not supported by iphone".  Sound comes through and it charges but NO Video???

    Connecting my iPhone 4S with 3rd party composite cable; error "accessory not supported by iphone".  Sound comes through and it charges but NO Video???  I have verified the cable, I can play video with sound from iPod Nano 4th gen.

    composite don't support mirror so it will only display on the tv when the app being used support tvout option
    the build in video app does so it should display on the tv at least my composite cable does with my iphone4
    the audio always works it's pretty much works like a headset

  • How to handle 2 or more .jar files with an applet

    Hey out there
    I have created an ftpClient application that uses "jakarta ftpClient". It works fine as an JFrame application � But when I converted the Application into an JApplet I get the following Exception:
    java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient
    I have bundled the main application into a .jar file (Application,jar). But I don't know how to handle the 2 jakarta .jar files with my JApplet??
    I Tried to append the 2 jakarta .jar files to the Application,jar with the following code:
    jar cvf Application.jar 1.class 2.class�. commons-net-1.4.1.jar jakarta-oro-2.0.8.jar
    But with the same result / Exception (I have signed the Jar file!)
    Can anyone help me

    Hi i have a question with your application can you down- or upload more files at the same time? Because i'm having problems with my ftp application.
    Here is the link with my problem maybe you can help me. I will be very pleased when you can help me.
    http://forum.java.sun.com/thread.jspa?threadID=5162042&tstart=0
    Thx
    Satanduvel

Maybe you are looking for

  • My iphone 4s is locked from itunes

    they disabled my phone nd I took it took it to a store nd they said im locked from itunes

  • Borders for documents

    Does anyone know of any downloadable extra styles for borders to add to documents in Pages? I used a double border in Microsoft Word that did not transfer into Pages. Only choices in Pages were single line, dashed line or dotted line. Any suggestions

  • Setting default for scanned photos

    I have a Canon LiDe 90 scanner,...I scan photos and save them as a jpg file, but the default program for all the files are either preview or Photoshop. I'm looking for a way to select all the files and set them to iPhoto. I can do them one at a time,

  • Trying to help a friend out with scripting problems in PS CS4

    My friend at work has a mbp-c2d. He has scripting errors come up in photoshop when using Contact sheet II, photomerge, or HDR. He has recently upgraded from CS3 to CS4 and has had the same problem in both. He can goto the scripts in Applications- Pho

  • Software update failure in N73

    Hi...I have an N73 Music Addition...i bought it in 2007 and have not been able to update the software yet beacuse everytime i connect it with the Computer thru Data cable,the phone automatically gets switched off...Can anyone help sort this out.... R