Packaging JARs in Eclipse

I currently use the Eclipse SDK and I have a project that is using an external JAR to perform operations.
My question is how I can package that JAR so that it will work when I export this code to a JAR of its own.
In the end, I would like to have one file I can execute (a JAR) and have my application run... however right now it cannot because it can't run any of the classes in the JAR library I am using.
Can anyone tell me how to export a JAR in Eclipse, and keep this other JAR inside it?

I'd even appreciate any tips to do this by hand...
worst comes to worse I guess I can use an installer =/ But I'm really trying to avoid that.

Similar Messages

  • Importing JAR into Eclipse.

    Hi. I am an experienced Java programmer, however I can't import the Java Servlet JAR into the Eclipse IDE. I import it into a new project I created called 'Java Servlet'. The packages show up, however I cannot see any of the .class files. None of the .class files that are supposed to be seen are available to my code. What's going on? Thanks. I'm new to Eclipse, but am an avid Visual Age for Java developer.

    To use any JAR in eclipse, you need to add it to a given project's build path.
    Right click on the project, choose Preferences (or Settings, or Options..... I don't have the IDE in front of me and I can't remember exactly what the menu is).
    Choose the Build Path option in the tree.
    One of the tabs in the resulting preferences dialog allows you to add libraries. Choose "External JAR" and navigate to the appropriate JAR. Note that you can also set up user variables that, in turn, point to a given JAR. This can be useful for multi-workstation development.
    If you are doing a bunch of servlet development, you might want to check out the open source Tomcat integration for Eclipse. It provides some extremely nice debugging and project management capabilties (and automagically configures a Tomcat context for each of your projects).
    Do a google on "tomcat eclipse" and you'll find it soon enough.
    Cheers!
    - K

  • Issue with Packaged Jars added to project from resource Palette

    Hello!
    I am using Jdeveloper 11.1.2.2.
    I started this post thinking there was an issue having to do with packaging jars that refer to other libraries (see post Are Libraries Required?
    Now I realize it is a different issue (although that other post is relevant).
    Issue: I create a package -- a template in this case.
    I deploy it in my file system and then load it into the resource palette as a file system connection.
    I create a new application. From the resource palette, I add the jar to the view controller project, and am able to use the template in jsf files. No problem. Runs fine.
    then I load the application into subversion or I move the whole application to another directory on my computer.
    When I open the moved application (or do a checkout from subversion), I open the jsf that contains a reference to the jar, the design view is completely blank. Going to the source, I see my original code, but there are red signals in the upper-right signifying an error.
    If I run the application without fixing it, I get an error saying the template cant be found, Also, when I deployed to a standalone weblogic server, I get the same error (see the post above for this error).
    I open the project properties. The ADF Library is in the "Libraries and Classpath" and pressing edit, I can see the correct reference to the path of the jar.
    To make the application work, I have to remove the ADF Library (or at least the reference when pressing edit) and then from the resource palette, add it again to the project.
    IS THIS NORMAL? Am I doing something wrong with the initial packaging of the jar? Should I change some setting somewhere?
    How am I supposed to deploy to weblogic?
    The other posting shows an error output if I try to run the application before fixing the jar reference. I got the same darn error when deploying to weblogic.
    Would appreciate any help!
    Stuart
    Edited by: Stuart Fleming on Nov 18, 2012 4:45 AM

    Timo,
    thank you for your reply. I actually created a youtube video on this, available here: http://youtu.be/ERyLngq9hlI
    Since the video might be a little tedious to view, Here are the details. You can jump to the exciting parts of the video, if you want:
    Here is what I did:
    1. I cleaned out my system directory and the temp directory on my computer.
    2. Opened the application containing my template. Deleted the existing jar file.
    3. Started taking video....
    4. (From 40 seconds into the video) Created the jar file again.
    5. (2:55 minuts into video) Closed template applcation and Created new fusion application.
    6. (4 minutes into the video) Created model
    7. (4:15 minutes into video) in view controller added template, created a jsf page.
    8. (5 minutes into the video) Created Security and users.
    9. (6:30 minutes into the video) Created a task flow, with jsff in it, with a form on the jsff. Assigned Security to objects.
    *10. (7 minutes into the video). Ran JSF successfully.*
    11. (7:40 minutes into the video). Closed application. Copied the entire application into two directories.
    12. (8 minutes into video) Opened the first copied video. You can see that the jsf page is not accessing the template. Reviewed the View Controller project Libraries and classpath. Removed the library, re-added the jar from the resource palette. Worked fine.
    13. (9:30 minutes into video). Opened the 2nd copy of the file I intend for subversion. Showed the jsf page and the error it displays when open (same as in first copied application).
    Load application into subversion.
    14. (10 minutes into video). Check out application
    15. (10:15 minutes into video). Open JSF file. The reference to the template jar file is reading properly.
    16. (11 minutes into video). Load the original working copy into subversion.
    17. (11:30 minutes into video). Check out from subverion, but the check out failed.
    18. (12 minutes into video). Check out, and look at the jsf.  The page shows fine.
    Timo, I think this might be reported as a bug. You ought to be able to move files around on your computer. Also, the first time I checked the application out from subversion, the jsf page did not read the template.
    ALSO, when I tried to deploy the application (that contained the reference to the template jar file to weblogic), I got the same error when I ran the jsf
    first lines of that error:
    Error 500--Internal Server Error
    java.io.FileNotFoundException: /WEB-INF/ssfTemplate/SSFTemplate.jsf Not Found in ExternalContext as a Resource
    at com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:224)
    Thank you for your time and commitment!
    Stuart
    Edited by: Stuart Fleming on Nov 18, 2012 10:13 AM

  • How to create runnable JAR in Eclipse

    I have a project in Eclipse with many classes.
    Whenever I try to create a runnable JAR, the JAR file created always contains all the classes of the project, regardless whether they are really used or not.
    Is it possible to create a runnable JAR in Eclipse, excluding the classes of the project which are not strictly necessary for a given launch configuration?

    krige wrote:
    I have a project in Eclipse with many classes.My condolences on using a build system that apparently has grabbed you by the short & curlies. That can be painful.
    Note that:
    1) Eclipse can use Ant style build.xml files for controlling most aspects of a build (that are worth mentioning).
    2) We provide no support for Eclipse on these groups, but since Ant typically defers to a core set of tools in the SDK, you can usually get away with asking an Ant related question.

  • Runnable JAR from Eclipse with DLL

    Hi,
    Is it possible to export a runnable jar from Eclipse that includes and uses a dll?
    My simple application uses an 'external' API - JIntelliType - a jar file and a dll belongs to it.
    I can run the project fine from Eclipse, but I can't export it to runnable jar. I am a bit lost among classpath, path, build path, native library location, referenced library,..
    But maybe it doesn't matter because after trying to look this question up on the net, I am not sure if it is possible to do it with Eclipse (not without additional plugin at least).
    Could somebody please help me with this?
    Thank you in advance!
    lemonboston

    Your question is that of deployment. In Eclipse you setup your development environment to include native binaries in the projects working directory. As soon as you leave Eclipse you do not have its facilities anymore and you need to make do with what the JDK has to offer you.So your real question is: I have a jar and a DLL, the jar depends on the DLL. How do I run the application such that the DLL can be loaded by it?
    The answer is: you can provide through a system property (java.library.path) which directory Java (and ultimately the operating system) should scan for native binaries, or you can simply put the DLL in the same directory as the jar. The current working directory (the directory where Java is invoked) is always on the binary search pat of the operating system.
    The documentation for the java tool is here:
    http://download.oracle.com/javase/6/docs/technotes/tools/windows/java.html
    To pass a system property as a parameter you would do something like:
    java -Djava.library.path=path/to/libs -jar yourjar.jar

  • How to run the package programs in eclipse ?

    hi all,
    how to run the package programs in eclipse ?
    plz clarify...
    regards
    balakrishna.m

    package source code is
    package package1;
    public class ClassaA
              public void displayA()
                   System.out.println("class A");
         }java source code is import package1.ClassA;
         class Packagetest1
              public static void main(String args[])
                   ClassA objectA = new ClassA();
                   objectA.displayA();
         }if i write the notepad means its executing successfully..
    but in eclips is not working..
    plz help me..

  • Runnable JAR in Eclipse

    Hi,
    I'm trying to make a runnable JAR in Eclipse, but I don't know how to limit which libraries or other source codes to be included inside. Does anyone know how to do this? The JAR I'm making is 13.6 MB, much bigger than I think it should be.
    Thanks.

    You can create a runnable jar file only when u have a public class with main method as a entry point of java Application.Always create runnable jar file when u r using GUI in ur java application.
    Steps which r required in Eclipse for creating runnable jar file as herein after provided
    1-Right click on your project and select export option.A export window will get pop-up.
    2-Select jar file option from the poped-up window which will be in java option of window.
    3-After Clicking JarFile option a new window will get pop-up.
    4-Select the export destination for ur jar file and click next.
    5-After clicking the next a new screen you will see, click on next button again.
    6-Now u will see a new screen which has a field name as "Main Class" browse for your main class of appliaction.main class is once which has main method.
    7-Now select finish.
    U hav done..
    now double click on your created jar n u will see the output.....
    if u hav any other problem...than let me know
    Regards,
    Ashvani Kumar

  • ClassNotFoundException using Packages / JARs

    I have a program that I wrote that is essentially a remote desktop connection, except that it can control any number of computers that connect to the server program. It simply assumes each computer is setup exactly the same and only uses a screenshot feedback from one of the computers. The following files are involved, and all located in the same directory "RemoteControl"
    Directory: RemoteControl
    RCServer.java   - The server program
    RCClient.java   - The client program
    Resolution.java - Object containing information about the client's resolution
    ScreenShot.java - Object containing a Screenshot of the client's computer
    MyAction.java   - Object that dictates what action needs to be performedWhen the client connects to the server, the server writes a blank Resolution object to the client, which the client completes and sends back to the server. Outside of a package/JAR file, everything works just fine. However, when I add the line
    package RemoteControl;To each of the files above, compile them, and create 2 jar files like so:
    jar -cmf0 manifest.txt RCClient.jar RemoteControl
    jar -cmf0 manifest.txt RCServer.jar RemoteControlWith the manifest containing:
    Main-Class: RemoteControl/RCClientWith the blank line at the end (replace RCClient w/ RCServer when creating the server jar file), the server program starts up just fine, and so does the client portion. However, when the client actually connects to the server, and the server writes the Resolution object, I receive a "ClassNotFoundException". I extract all the files from the newly created JAR files (jar xf RCClient.jar/RCServer.jar) and they contain all the necessary files (and both JARs are identical with the exception of the manifest data).
    Looking at the stacktrace, the only line number it gives (rest are all Unknown Source/Native Method) points to the middle line in the following:
    System.out.println("starting thread loop - before reading object");
    Object tmp = in.readUnshared();
    System.out.println("object was read");And the console output stops at "starting thread loop - before reading object" before printing the stacktrace. Incase needed, in.readUnshared(); is an ObjectInputStream.
    My initial guess was something to do with resources in a JAR file, since in the past, I've had to use "getClass().getResource("images/gifIcon.gif");" to get an image within the JAR file to load during the application, however my research has told me all class files within the JAR are automatically loaded (assuming they are in the same directory at the main class), and that the Class-Path line in a manifest is only needed when you try to access classes within other JARs.
    Any ideas?
    Thanks in advance.
    Brad

    Here's the output from "jar -tf RCClient.jar"
    META-INF/
    META-INF/MANIFEST.MF
    RemoteControl/
    RemoteControl/BGPanel.class
    RemoteControl/Client.class
    RemoteControl/images/
    RemoteControl/images/gifIcon.gif
    RemoteControl/MyAction.class
    RemoteControl/MyAction.java
    RemoteControl/RCClient$1.class
    RemoteControl/RCClient.class
    RemoteControl/RCClient.java
    RemoteControl/RCServer.class
    RemoteControl/RCServer.java
    RemoteControl/RCServerGUI.class
    RemoteControl/Resolution.class
    RemoteControl/Resolution.java
    RemoteControl/ScreenShot.class
    RemoteControl/ScreenShot.java
    RemoteControl/ShowMessageListener.classAnd the output from "jar -tf RCServer.jar"
    META-INF/
    META-INF/MANIFEST.MF
    RemoteControl/
    RemoteControl/BGPanel.class
    RemoteControl/Client.class
    RemoteControl/images/
    RemoteControl/images/gifIcon.gif
    RemoteControl/MyAction.class
    RemoteControl/MyAction.java
    RemoteControl/RCClient$1.class
    RemoteControl/RCClient.class
    RemoteControl/RCClient.java
    RemoteControl/RCServer.class
    RemoteControl/RCServer.java
    RemoteControl/RCServerGUI.class
    RemoteControl/Resolution.class
    RemoteControl/Resolution.java
    RemoteControl/ScreenShot.class
    RemoteControl/ScreenShot.java
    RemoteControl/ShowMessageListener.classShortly after posting this question, I removed all the package declarations and deleted the class files and recompiled and I started getting the NoClassDefFoundError even though the .class file was in the same directory (not using a jar at this point), so I decided to revert back to earlier versions of the files above. When I compiled them and successfully ran them, I repeated the steps outlined in my OP and it started working, even within a JAR file. So, sadly I cannot provide a stacktrace anymore, but my problem's somehow solved.
    Note: The JARs that weren't working had the same output as above, which leads me to believe...
    Other than missing a few JOptionPane debugging prompts, the only possible difference I could think of is perhaps the Resolution object the server and client were using, were in different packages (or more specifically, one was in a package, one was not). Even though I did exactly the steps in my OP, I'm not going to rule out a possibility that somewhere, something wasn't over-written like it was supposed to (since I was compiling both the java files and the jars w/o deleting any previous .class/.jar files).
    And thanks for both the hasty reply, as well as informing me about the -tf option, that's a bit quicker than extracting the files and looking at the structure myself.

  • How to use loadjava tool to regard file in other packages/JARs?

    How do I have to set the options for the loadjava tool when I have a Java class that uses classes of another package/JAR (which I have developed by myself). I thought it was just to create a JAR containing my Java class as well as the JARs containing the other packages/classes being imported in my Java class. and then:
    loadjava -u user/passwd@hostname:1521:xxx -v -r C:\Temp\MyJAR.jar
    but I always get
    cannot find symbol    :    class MissingClass

    This is the wrong forum!
    1. Repost the question in the Database JVM forum
    Java in the Oracle Database
    2. Edit this thread and post the link to the new one and direct people to follow up there
    3. Mark this thread ANSWERED so people will follow up in the other forum.
    When you post there provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION) and review Chapter 11 Schema Objects and Oracle JVM Utilities in the Java Developers Guide
    http://docs.oracle.com/cd/B28359_01/java.111/b31225/cheleven.htm#CACFHDJE
    see '-recursivejars' in the Argument Summary section.
    >
    -recursivejars
    Normally, if the loadjava tool encounters an entry in a JAR with a .jar extension, it will load the entry as a resource. If this option is specified, then the loadjava tool will process contained JAR files as if they were top-level JAR files. That is, it will read their entries and load classes, sources, and resources.

  • Problem exporting JAR using Eclipse with JNIlib

    Hi all,
    I have a java application that is using an external JAR. The external JAR is coupling with a JNIlib.
    When I 'export' my application to a runnable JAR in Eclipse, the external JAR is extracted and included in my runnable JAR. However, when I execute the runnable JAR, some functions of the application is not working due to missing library. After I put JNIlib into my Java/Extension, the runnable JAR then works fine.
    I want to distribute the JAR to other people, but I can't ask them all to put JNIlib in their Java/Extension.
    Does anyone have an idea? I am a novice to Java, it took me awhile to figure out how to create a runnable JAR.
    Thank you very much.
    Eagle.

    first , it says unable to access jar file .
    upon deeper inspection i found that background processes is created behind thus the jar file been activated but the UI doesnt show up? any more idea of where my codes gone wrong? which seems perfect for me
    anyway thanks but i still .. it says unable to access jar file

  • Packaging JAR's using Ant in Eclipse

    Hey,
    I'm new to Ant, and xml for that matter. I need to rmi compile & package a set of simple classes whose objects call eachother remotely. I need seperate jars for a "server" and one for "client" containing whatever classes are needed for each. Using Ant the classes should be compiled, packaged into the jars and then the jars should be copied to some other specified directory. And of course, the jars should be executable.
    The files I use are AddressBook (interface extends Remote), AddressBookImpl (extends UnicastRemoteObject implements AddressBook), BuddyInfoInterf (interface extends Remote), BuddyInfo (the implementation, extends Unicast... implements BuddyI...), and AddressBookUser.
    The AddressBook is created on the server-side (in main() found in AddressBookImpl) and is populated with BuddyInfo's also created server-side.
    AddressBookUser is just the client accessing some info from ABook or BInfo.
    So, anyway, here's the xml file I've written to do the tasks assigned. The classes compile fine, and the jar files seem to contain the proper files. My problem is that the jar files don't execute properly. The main() in AddressBookImpl creates the ABook and binds it to the rmiregistry. When I run the server.jar that is "initially" created during the process (the one in the base dir) it works fine but this only seems to work correctly because it's in the same dir as all of the compiled classes. The copied jar file in the other directory, or even if I manually copy the server.jar file in the base dir to some other dir, causes an exception when trying to bind the AddressBook to the registry saying it can't find a stub that is definitely located in the jar. And I'm running the rmiregistry in whatever dir the server.jar is in each time:
    Exception in thread "main" java.rmi.ServerException: RemoteException occurred in
    server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is:
    java.lang.ClassNotFoundException: AddressBookImpl_Stub
    at sun.rmi.server.....
    <?xml version="1.0"?>
    <project default="packaging">
    <!-- Change location(s) to desired path(s) where client and/or
    server jar files should be copied to, else will create folders
    "client" and "server" in project directory and copy them to
    there. -->
    <property name="serverDir" location="./server"/>
    <property name="clientDir" location="./client"/>
    <!-- performs all tasks -->
    <target name="packaging">
         <!-- Compiles all files in project directory. Necessary for
         AddressBookUser.java to be compiled -->
         <javac srcdir="."/>
         <!-- RMI compiles AddressBookImpl & BuddyInfo -->
         <rmic classname="AddressBookImpl" base="."/>
         <rmic classname="BuddyInfo" base="."/>
         <!-- Creates server jar file -->
         <jar destfile="./server.jar" basedir="." includes="**.class" excludes="AddressBookUser.**">
              <manifest>
                   <attribute name="Main-Class" value="AddressBookImpl"/>
                   <attribute name="Class-Path" value="."/>
              </manifest>
         </jar>
         <!-- Creates client jar file -->
         <jar destfile="./client.jar" basedir="." includes="**.class" excludes="AddressBookImpl.** BuddyInfo.** **Skel.class">
              <manifest>
                   <attribute name="Main-Class" value="AddressBookUser"/>
                   <attribute name="Class-Path" value="."/>
              </manifest>
         </jar>
         <!-- copy jar files to specified directories -->
         <copy file="./server.jar" todir="${serverDir}"/>
         <copy file="./client.jar" todir="${clientDir}"/>     
    </target>
    </project>
    Sorry bout the length. Just want to cover my bases. Thanks for any help.

    I am also having problem in building server.jar file using Ant. I am using EJB jar file in my web application, this jar file is called remotely from server to client. Client.jar file working correctly but the server.jar file contains error which is given below:
    15:30:47,296 WARN [verifier] EJB spec violation:
    Bean : Server
    Section: 22.2
    Warning: The Bean Provider must specify the fully-qualified name of the Java cla
    ss that implements the enterprise bean's business methods in the <ejb-class> ele
    ment.
    Info : Class not found on 'com.ejb.ServerBean': No ClassLoaders found for: com.ejb.ServerBean
    15:30:47,296 ERROR [MainDeployer] Could not create deployment: file:/C:/jboss-4.0.4.GA/server/default/deploy/server.jar
    org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
    In above error, "Class not found on 'com.ejb.ServerBean' " is given. Will there be all the classes of EJB jar file in server.jar ? I think only the interface class file i.e. Server.class and serverHome.class must be included, am I correct or not?
    Also the build.xml which I am using for creating server.jar is given below:
    <project name="ServerEJB" default="make_server_jar" basedir=".">
    <!-- Initialization variables -->
    <property environment="env" />
    <property name="app.name" value="${ant.project.name}"/>
    <property name="source.dir" value="ejbModule"/>
    <property name="build.dir" value="build"/>
    <property name="classes.dir" value="${build.dir}/classes"/>
    <property name="distribution.dir" value="dist"/>
         <property name="server.ejb.jar.name" value="server.jar"/>
    <target name="clean" description="Deletes compiled and generated code">
    <delete dir="${build.dir}"/>
    </target>
    <target name="make_server_jar" depends="" description="Builds a server.jar with stubs for apps to use">
    <mkdir dir="${distribution.dir}" />
    <jar destfile="${distribution.dir}/${server.ejb.jar.name}" basedir="${classes.dir}">
         <exclude name="**/*Bean.class"/>
    </jar>
    </target>     
    </project>
    I am using server.jar file in server as interface which will remotely call client.jar which will be kept at client location.
    Anybody, can you provide me with the solution for this problem?...
    Thank you.

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

  • Compiling with external JARs using Eclipse

    I've spent 3 days on this and I still don't seem to be any nearer solving the problem. I am using a couple of external JAR files within my project and everything is working fine within the IDE, it's when I come to compile my own JAR that I'm having problems. I've tried created my JAR by choosing file->export, but it doesn't seem to pull in the external JARs. My class paths must be correct as I can run it within the IDE, but I'm missing something.
    Next I discovered ANT and had a play with that. After some toil I got it to generate a JAR, but it has two problems. 1. The manifest file cannot be found, but let's forget about that for now, as I haven't really looked into it. 2. The generated JAR is only 250Kb, when (if the external JARs are packaged with it) it should be closer to 5Mb. Again I've set my class paths in the External Tools dialog, but still nothing.
    Could someone please try and point me in the right direction. I've even spent a couple of hours at Borders reading up on ANT and Eclipse, that where my ANT script came from, but it hasn't got me the result I need. If it's any help my build.xml is below
    <?xml version="1.0" encoding = "UTF-8"?>
    <project name="C_G" default="Main Build" basedir=".">
        <property name="bin" location="bin"/>
        <property name="src" location="."/>
        <property name="jardir" location="${bin}/lib"/>
        <property name="jarfile" location="${jardir}/c_g.jar"/>
        <property name="build.compiler"
        value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
        <target name="Main Build" depends="Initialize, Compile, Jar">
            <echo message="Ant Building"/>
        </target>
        <target name="Initialize">
            <delete dir="${bin}"/>
            <delete dir="${jardir}"/>
            <mkdir dir="${bin}"/>
            <mkdir dir="${jardir}"/>
        </target>
        <target name="Compile" depends="Initialize">
            <javac srcdir="${src}"
                destdir="${bin}">
            </javac>
        </target>
        <target name="Jar" depends="Initialize, Compile">
            <jar destfile="${jarfile}" basedir="${bin}"/>
        </target>
    </project>

    Damn it, so I do have to tackle the 'manifest not
    found problem' first then. I would have though
    Eclipse would have made a better job at making the
    manifest file.All I can say: RTFM. This is not an Eclipse support forum. Maybe it does, and you use some incorrect settings.
    I just placed it into the root of the JAR, but when I
    run it can't find itIt doesn't belong there. It goes into a directory named META-INF

  • What is the differences between Ant build jar and eclipse export jar ?

    I have tried the eclipse export method to generate a jar file, however, it doesn't work with my server. But when I write a ant build file to create jar file. It works!!
    Does any buddies know why?

    Difference betwen JAR AND WAR
    .jar files: These files are with the .jar extension. The .jar files contain the libraries, resources and accessories files like property files.
    .war files: These files are with the .war extension. The war file contains the web application that can be deployed on the any servlet/jsp container. The .war file contains jsp, html, javascript and other files for necessary for the development of web applications.
    Source:
    http://forum.java.sun.com/thread.jspa?threadID=485823&messageID=2273976
    The main difference between a JAR and a WAR is that a JAR is not really a single purpose format, while a WAR is. With a JAR file, you can package lots of different things. Usually you package up Java classes, but you could put pretty much anything into a JAR file, and you can create JARs that have whatever files and directory formats you want. For instance, Oracle (at least in 8.1.x) actually uses JAR files to distribute the Oracle software on the install CDs, and IBM uses them to distribute an installable version of the documentation for WebSphere. Technically you can put JSP pages, HTML pages, servlet classes, etc. in a JAR, but you generally don't -- you use a WAR.
    WAR files are JAR files with a specific format. This format is defined in the servlet spec (which you can look at on the java.sun.com site). Essentially, the WAR file is a standard format for web applications that has specific directories and specific files. This includes a WEB-INF directory, a WEB-INF/web.xml file used to describe the application, a WEB-INF/lib directory for JAR files used by the application, and a WEB-INF/classes directory for class files that aren't distributed in a JAR. You would put the pages (JSPs and HTML) in the WAR as well. Then, you can distribute your application as one file, instead of as a collection of images, HTML pages, and Java classes.
    Source:
    http://www.theserverside.com/discussions/thread.tss?thread_id=10905
    Message was edited by:
    lochdsmile

  • How to use a packaged Jar File?

    Greetings to everyone reading this post!
    I have a query about a thing that seems to be basic but I don't know how to accomplish, here it goes:
    I have packaged a Simple application into a Jar file. this application contains a package like this:
    lib.demo, inside this package I have a Class named MyClass with some simple methods like this one:
    public void sayHi(String name){
    //implementation here
    }Now, I would like to Know how to use the Method sayHI(String name) from an entirely different Project. I have successfully included the Jar File as a Library(in the new Project), but I have I no Clue on How to invoke a Class inside my Jar library, and more Importantly, a method.
    Could anybody help me?

    if the "project" (not a Java-related system, it's IDE-specific) already includes the JAR file in its classpath (library), then all you need is to import the package/class and invoke the method, as such:
    // in your client code:
    import lib.demo.*;         // or, import lib.demo.MyClass;
    public class Test {
      public void inAMethod() {
        MyClass myC = new MyClass();
        myC.sayHi("say hi"); 
    }simple.

Maybe you are looking for

  • HP Notebook - 15-ac043tu - NOT ABLE TO INSTALL WIFI DRIVERS FOR WINDOWS 7 -64 BIT

    I baught HP Notebook - 15-ac043tu. I am not able to install wifi drivers in windows 7 home edition . I have downloaded all drivers from HP Link shown below, http://support.hp.com/in-en/drivers/selfservice/hp-15-ac000-notebook-pc-series/7771404/model/

  • Master-detail form in HTML DB

    Is there any way to create a master form with multiple detail tabs on the same page? This can be easily done in Oracle Forms by creating a master block and several child blocks on the same form. Thanks.

  • PDF quick look in mail app

    Somehow, the quick look (or quick preview) of PDF files has gone corrupt on mail app. When I receive an email with a PDF attached, I used to be able to tap on the file and read it right away. Now I can't!!! Weird characters appear, as if I try to ope

  • SmartLine class

    Hi, I am trying to make a SmartLine class that knows its color, location and size, but I am having some trouble. It supposed to be modeled after this SmartEllipse class but for SmartLine (doesn't have all the methods in it) it's giving errors in the

  • Is there a USB2 hub that can be connected on FW port?

    Since there is a USB2 and FW hub for Mac Mini, which as far as I am aware connects on USB2 port (or maybe requires two feeds?), I am curious to know if the above exists. This would solve my problems of lack of USB ports on iMac and use the FW port I