How to include third party .jar files into my jar file

Hi,
how do i include a open source third party jar file into an executable jar?
i have a class called BlogBox.java and it uses org.apache.commons.net.ftp.FTPClient, i want to create an executable file, where do i put the .jar file containing FTPClient aka Apache Commons Net?
currently i'm getting the following error from when executing my BlogBox.jar
C:\MyJava\BlogBox>java -jar BlogBox.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient
at blogbox.BlogBox.<init>(BlogBox.java:27)
at blogbox.BlogBox.main(BlogBox.java:103)
Any suggestions? i have searched google and this forum but could not find the solution to my problem, thanks
[edited msg] do i need to add the classpath at execution or something of the apache commons net library?
Message was edited by:
gekkokid

When you use an executable jar the normal class path
is ignored, but you can put a classpath inside the
jar. The usual trick is to place the library jar
files in a directory inside the application directory
and direct the manifest file to it. The manifest file
live in the jar inside the META-INF directory and
it's called manifest.mf
The two heavilly used entries are Main-class: and
Class-path: lines. Class-path just has a
comma-separated list of library paths.
The jar utility has a special option to load it up.Thanks :) I created a "/lib" directory, placed in the packages in there and redirected the Class-Path: lib/commons-net-1.4.1.jar
and it works,
thank you everyone :)

Similar Messages

  • How to use third party library (like .dll and .lib files) in flascc?

    I have a number of .dll and .lib files of the  third party library, which are generated from C++ code.
    I read about flascc on other web site says:
    "If you want to use third party library in your Flascc project,you must have either the source code or the linkable file which is compiled of the third party library   "
    Dose the linkable file mean .dll file or .lib file?
    AND
    How can I use the fuctions in them in my flascc project.?

    Native code is not interchangeable between platform.
    It means that you can't use library that wasn't build specifically for flascc.
    And when they say linkable files they mean libraries compiled for flascc, not any libraries.
    So if your libs are for windows, no luck, you have to recompile everything

  • How do you turn third-party midi loops into Apple Loops?

    Does anyone know how to turn third-party midi loops into Apple Loops? I've got hundreds of short midi files that I purchased, and I would like to be able to use them in the loop browser of Logic Studio. I tried some of the obvious ways of doing this, like using Apple Loop Utility, but it doesn't seem to recognize .mid files. Seems like .mid files would be right up its alley, so maybe I'm doing something wrong...

    Yes, have the same problem but with wav loops. i have 75000 wav loops from third part and do not find how to "logicized" it. For the moment i can use them into a project but they are not adapting when i change the bpm of the projetc for exemple.
    If you know the solution i would be rescued

  • How can  I include my database file into my jar file?

    Hi,
    I am doing several tests for the jar command....
    I tried to put the database file into my jar file, but when the program run, it just couldn't find the database file, so how may I include the database file into the jar file? Not only that, it also can't find the policy file etc.

    sorry, I think I found the solution, I should have had read the API more carefully.

  • How do you convert a jar file into a java file,  ?

    how do you convert a jar file into a java file ?
    I am new to Java ,but have a little experience in C++ and Visual Basic.
    I want to edit and maybe create my own mobile games that are written or converted into jar files.
    At the moment I am using Java NetBeans , and Easy Java( the java pad).
    However the only solution I tried was to open the JAR file in winrar and see that its made up of png picture files,
    midi music files and class files. Unfortunately when I uncompressed the JAR file , there was NO java file to be seen and the JAVA editors Do not show the class file like a Java file. So why is there no extension Java file in the mobile JAR game ?

    801283 wrote:
    how do you convert a jar file into a java file ?You generally don't. There exist decompilers, but if you're meant to have the source, you should either have it because you are the author, or you should be able to get it from the author.
    I am new to Java ,but have a little experience in C++ and Visual Basic.Does that experience include turning .exe files into C++ code? Because that's the equivalent of what you're asking
    I want to edit and maybe create my own mobile games that are written or converted into jar files.Eh?
    Are you saying you want to take existing games and modify them? If the creators allow you to modify their source, then they'll provide you with that source (the .java files). If you're allowed to add things but not modify, you don't need .java files. Just documentation, which, again, the creators should be providing.
    Or are you saying you want to create your own games and distribute them in jar files? If so, there's no need to turn jars into .java.
    However the only solution I tried was to open the JAR file in winrar and see that its made up of png picture files,
    midi music files and class files. Unfortunately when I uncompressed the JAR file , there was NO java file to be seen and the JAVA editors Do not show the class file like a Java file. So why is there no extension Java file in the mobile JAR game ?Why would you expect there to be one?

  • How to package other jar files into one jar?

    How to package other jar files into one jar? How can i get the class in the inner jar file?

    Generally not a good idea. The Java runtime won't be able to load classes from those "inner" jars, you'd have to write your own classloader to do that. It's not a brilliant idea, generally, anyway, since the point of having lots of jars is to keep your application modular. Bundling them all together like that means you have to re-deploy the whole thing to fix, for instance, one small bug in one small library
    If you really want to do this, there's an Eclipse plugin called FatJar, but I urge you to consider whether you really want to do it first.

  • How to use  third party package in java application

    hi, i am a student , new to java world can any of u tell me how to import third party package in our java application.
    i want to know how CLI is done in java.
    i am going thru this link http://www.codezoo.com/pub/component/5574
    not able to get anything.
    please please help me

    There are two steps -
    1. Import the classes you need from the package(s) using the Java import statement in your classes that need access to them.
    2. include the 3rd part code (one or more .jar files and/or root directories holding the code's package tree and .class files) to your javac and java class path and optionaly to the class path found in your .jar's manifest file.

  • Conversion of a .jar OR a .class file into a .exe  file

    Can anyone tell me as how to convert a .jar OR a .class file into a .exe file
    I need to know as soon as possible.

    Okay I will tell you the steps:
    Look in the top right hand corner of the page.
    There should be a box with a red title line. Inside the
    title should be the letters 'S E A R C and H'.
    In the white part of th box should be a smaller line, in which you can type.
    type in "conversion .jar .class .exe" or some similar string.
    Then click on the button next to the text box.
    Read the page of results you get.
    Click on the first link and read what is said on the connecting page.
    If that doesn't help, use your browser's back button and click on the next link, and repeat util your question is answered.

  • How to invoke third party webservices in oracle apps R12 when wsdl is provided and no SOA server exists

    Hello Everyone,
    I am working on Oracle apps R12 and we don't have any SOA server setup. I got a requirement to invoke a third party webservice and send some of the data from oracle apps database to the third party and they provided the wsdl file to invoke their webservice. How can I achieve this? Any help or suggestions would be greatly appreciated.
    Thanks,
    Ravi

    ca0c5e8e-8457-46de-896f-fd9dcc13299e wrote:
    Hello Everyone,
    I am working on Oracle apps R12 and we don't have any SOA server setup. I got a requirement to invoke a third party webservice and send some of the data from oracle apps database to the third party and they provided the wsdl file to invoke their webservice. How can I achieve this? Any help or suggestions would be greatly appreciated.
    Thanks,
    Ravi
    Ravi,
    I believe you need to have SOA configured with EBS to run those webservices.
    Please log a SR to confirm the same with Oracle support.
    Thanks,
    Hussein

  • Conversion of a .class file into a .jar file

    Conversion of a .class file into a .jar file
    How Will I convert a .class file into a .jar file.
    Pls answer ASAP.

    You don't.
    You add a .class file into a .jar file. You don't convert anything.
    Read the help page for jar for details.

  • HT3964 How to remove third party software?

    How to remove third party software from the MacBook Pro 2011? I have software which is freezing my opening screen.

    If the files came with an uninstaller, use it.  To get rid of all the stragler files most applications leave download a 3rd party uninstaller. 
    AppDelete
    AppZapper
    AppCleaner

  • Urgent  urgent  urgent how to convert 20 ear file into  1 sca file

    hi experts, friends
    help me if are intersted with this question  ( its very urgent )_
    my questions is
    1 . how to convert the 20 ear files into 1 sca file
    2 . how can i do that is there any 3rd party tool is there to convert
    descripation :- i have 20 application which are developed by  ui webdynpro java . 20 application are in .ear
    files, that i can see in sdm tool. now i need to pack or bundil all 20 application or .ear files into 1 .sca file.
    plz help me to resolve this issue
    regards
    raja

    Raja,
    The following conversions are possible:
    PAR to EAR
    EPA to SDA
    EAR to SDA
    SDA to SCA
    Check with this SAP Help to make SDA file first and then
    SDA to SCA.
    [Creation of SDA and SCA Archives|http://help.sap.com/saphelp_nw70/helpdata/EN/a3/782240da03e569e10000000a155106/frameset.htm]
    Check out this SAP Note as well :
    Note 696084 - EP 6.0: How to create SDA files for EPA or PAR files
    You can use the Command Line tool if your environment is SAP NetWeaver 7.1 Composition Environment (CE).
    [Composition Environment Command Line Tool |http://help.sap.com/saphelp_nwce10/helpdata/en/45/5a3613dca22a4ce10000000a11466f/frameset.htm]
    or
    Follow the way mentioned here.
    [Adding Transport Packages to NWDI|http://help.sap.com/saphelp_nw70/helpdata/EN/45/bd060552fd731de10000000a1553f6/content.htm]
    Regards,
    Karthick Eswaran
    Edited by: Karthick Eswaran on Jun 20, 2008 8:50 AM

  • How do I combine 41 PDF files into one PDF file?

    How do I combine 41 PDF files into a single file using ADOBE PDF Pack?

    Hi,
    To combine more than 12 files:
    Please do below to combine files:
    Log into https://createpdf.acrobat.com/signin.html with your Adobe ID and password
    Select "Combine Files" from right pane
    Click "Select Files" button
    Select your files to combine
    Enter a name for combined PDF file
    Click "Combine" button
    Click "Download" button in the progress bar to download the combined file to your computer.
    To combine more than 12 files:
    Combine 1-12th files and name it  “combined 1” for example
    Combine 13-24 files and name it “combined 2”
    Keep doing step #1 and #2 and combine those combined files to combine all your files.
    You can use Acrobat XI Pro to combine multiple files (more than 12 files) by following the steps below and you can download Acrobat XI Pro Trial version from www.adobe.com:
    In Acrobat XI Pro:
    1. Launch Acrobat
    2. Select File menu > Create > Combine Multiple Files into a Single PDF
    3. Click "Add Files" button at top left corner
    4. Select your files to combine
    5. Click "Combine Files" button at bottom of the dialog.
    You can upgrade your subscription to Acrobat Plus and please see more information at https://www.acrobat.com/acrobatplus/en/home.html
    Hisami

  • How do I combine several pdf files into a single file (MAC OS)?

    How do I combine several pdf files into a single file ?
    MAC OS 10.6.8
    Adobe Reader 11.0.10
    Signed: Ken, in Utah

    Not possible with Reader. You need Acrobat or a subscription to something like PDF Pack to do it.

  • How do I convert an audio link into a wav file?

    how do I convert an audio link into a wav file with my Imac?
    A PC user showed me to right click an audio link where it asked if it wanted to save the link as a Wav file?
    I saw this done in front of me. How do I do it with my Mac ?

    This is how to do it in itunes http://support.apple.com/kb/ht1550
    If I view the song in finder, all that i have to do is press command-i and it opens a window. In the section where you view the name and extension I took off the extension (.mp3 in my case) and replaced it with .wav

Maybe you are looking for

  • [SOLVED] issues sshing from some remote hosts

    Had a quick in some of these threads and couldn't find something similar. I am having an issue when it comes to connecting via ssh  from some ip addresses. example from some (very limited) end points, it connects fine including internally to my netwo

  • Took a new photo while in *contact* page; now where is it??

    Today, while inputting a friend's email address, I decided to take a pic to attach to his contact. Normally, I'd take a pic using the Camera app, but since I was already on his contact page, I took it from within the Contacts app, by tapping "add pho

  • JSP display problem with UTF-8 encoding

    Hi, I'm now writing JSP in order to input English, Traditional Chinese and Simplifed Chinese in the same form of the page. I've set the encoding as below: <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> When, I get

  • Cisco ISE - What does "Multiple Matched Rule Applies" mean?

    Hi, In Cisco ISE authroiztion policy configuration, what does the option "multiple matched rule applies" mean? I can understand the "first matched rule", but in "multiple matched rule" how is the "permissions picked if multiple rules match? Or, what

  • Broken iphone

    i broke my iphone, im able to connect it to itunes, listen to music using a headphone with the play button, and the phone rings when someone calls, but its screen IS FULLY GONE, AND doesnt light up,the frame is dent. am i eligible for a discount repl