How to include external jars - URGENT...

Hi:
I am using Eclipse for development.
My application uses some external jars.
This step is simple in Eclipse, one simply indicates where the jars are to the IDE.
However, when I make an executable JAR file from my project, those external JARs are not included.
So when I run my program, everything is fine until the parts that uses the external JARs.
Does anyone know how to include them outside of Eclipse platform?
I am going to see my client in an hour and of course I can't bring my source and install an Eclipse at my client's computer to show them my demo...
please help... thanx...

You add those external jars to the classpath or the jars classpath if you're running the program from a jar. Or put the external jar to JAVA_HOME\lib\ext (IIRC)

Similar Messages

  • How to include external .jar libraries

    hi,
    I'd like to use an external .jar library in my Java program.
    I import the package in the source code.
    But where do I have to specify the file location of the .jar file. Do I have to add its directory to the PATH environment variable or somewhere else??? So far I've done this only in Eclipse, but now I'm working in a pure linux environment... with no IDE.
    Thanks :)

    Or specify the classpath completely when you run javac.
    For example to compile a class called Foo in the current directory which uses classes from an external jar file I would say
    javac -cp .:../../whatever.jar Foo.javaAnd if Foo has a main() class:
    java -cp .:../../whatever.jar Foo(If you are working with a number of projects each with lots of classes and lots of (different) jars, it might be time to look at Ant.)

  • How to include external files in JSP

    hi,
    How to include external files like image or javascript in to jsp pages.
    I am using MVC frame work. So i have to use request dispatcher. While calling the pages trough dispatcher the external files are missing from the output. Also am using tomcat as server,web.xml(deployment descriptor ) is also configured.
    regards
    sree

    When you use the request dispatcher, the relative path for all your ressources becomes the relative path of your calling serlvet and not the JSP/servlet that you call. Make sure to use the full relative path such as:
    /PATH_TO_YOUR_DIRECTORY/myRessource.ext
    NOT
    SOME_DIRECTORY/myRessource.ext
    Jeff

  • ANT how to include NetBeans Jar  files in my script of ANT ??

    ANT how to include NetBeans Jar files in my script of ANT ??

    I mean the library say swing layout ...
    which is SwingLayOuts1.0.jar ...
    in side this there is folder org.jDesktop....
    I want this folder in my jar file ...
    also ....
    My question ... i know the path of the jar file of NetBeans .... i can copy that ...dirctly ... but if m using Netbeans editor ... can i give NetBeans class to my jar command for ANT...........

  • How to use external jars in NW2004

    Hello Experts,
    can i use the same approach mentioned in the below Weblog for using the external jars in NW2004.
    /people/bertram.ganz/blog/2008/11/24/how-to-use-external-jar-files-in-web-dynpro-development-components
    and if not then what will be the best way to achieve it in  NW2004.
    Please provide your inputs on above.
    Regards,
    Siddharth

    Hi Sidharth,
    If you are using web dynpro DC perspective then you need to follow the following points to use the external jar files in it.
    1. Create a external library project.
    2. copy the external jars in the library folder os the projects.
    3.) Select all the jars from the u201CLibrariesu201D folder, Right click and then select Development Component and click on Add to Public Part
    4.Select the first Radio Button (Provides an API)and give some nameto it.
    5. Repeat the step no 3 but now select the second radio button other than as selected in step no 4.
    6. Now build your lirary DC.
    7. Now create a j2ee DC project.
    8. ) Expand the node DC Definition and Right Click on Used DC. Select Add Used DC.
    9. Select the External Library DC with build time dependency.
    10.Right click on the J2EE DC and then select Development Component followed by Build
    11. Right click on the J2EE DC and then select Development Component followed by Deploy
    now you can use both the libary DC and the j2ee DC in your web dynpro DC as used DC.
    But if you have created a web dynpro project only(but not DC) than you can directly add the external jars in java build path
    hope this will help
    regards
    Narendra
    Edited by: Narendra Singh on Oct 27, 2009 11:22 AM

  • How to include external style sheet

    Hi !!
    Can any one explain how to include external style sheet.

    Anil,
    Simply include the css file as I demonstrated in my last post and then reference one the css classes by name in the "styleClass" attribute of the component. So, if the css file that have included in my JSP file (as demonstrated in the prev post) contains a class like:
    .spicyPink {
    color:#FF1CAE;
    font-weight:bold;
    Then I would simply reference this class in the component as folows:
    <af:outputText value="Pretty In Pink" styleClass="spicyPink"/>
    However, you can also add styling to a component inline and accomplish the same task:
    <af:outputText value="Pretty In Pink" inlineStyle="color:#FF1CAE;
    font-weight:bold;"/>
    The thing to remember is that other than the use of styleClass and inlineStyle, referencing and including css in your JSP/JSPX pages is really no different that used in an HTML page.
    Here is reference to help you along:
    http://www.w3.org/TR/REC-CSS1#containment-in-html
    --RiC                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to include other jars when using servicegen

    I have been trying to use servicegen with regular java classes but I can't figure
    out how to include other jars that the webservice class uses?
    How is this supposed to be done?

    SQL> set null <<NULL>>
    SQL> select distinct comm from emp
      2  /
        COMM
           0
         300
         500
        1400
    <<NULL>>
    5 rijen zijn geselecteerd.So I probably don't understand the question. Could you post a small test case showing the behaviour you described?
    Regards,
    Rob.

  • Problem using Jar to include external jars in an application

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

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

  • How to add external jars when deploying webapp via worksop for wls 9.2

    While attempting to deploy my web application using Workshop for WLS 9.2, WLS complains it is unavailable to resolve references to a 3rd party JAR(tomhawk.jar) which is being referenced by the JSPs. I have added the JAR via the J2EE module dependancy tab in workshop but that does not seem to be helping the deployment.
    If i build the web application outside workshop and include the tomhawk.jar in the WEB-INF/lib folder of the deployed WAR file, the app works fine.
    I have attempted to copy the tomhawk.jar into the <domain>/lib folder and restart the weblogic server. But this does not seem to help resolve the references.
    Any clues on how i could achieve iterative deployments via workshop for WLS 9.2 pickup references to external JARs being referenced by the JSPs.
    Thanks
    Ramdas

    Raj,
    Thanks for your suggestion. The link that you sent out was useful. I was actually able to get the webapp to resolve its references to the 3rd party classes by adding the tomhawk.jar as an external jar via the "build path" property for the web project. I tested this by running the app in the WLS instance hosted by workshop and looks like the JAR from the build path gets somehow referenced during run time too. Not sure how this works?
    Thanks
    Ramdas

  • How to include another .jar package in an applet jar package

    Hi, I'm using Eclipse to write an applet which needs some other .jar packages to support it. I add them as external jar package in project properties. In eclipse, everything works fine when I compile and run. But I when export the applet to .jar and try to run in browser, it doesnt work.
    I think probably because I didnt export the packages that the applet requires to run. However I cant find a way to export these packages together with the applet to a final .jar file.
    Anyone knows how to solve this ? plz help. thx you in advance

    Hi, I'm using Eclipse to write an applet which needs
    some other .jar packages to support it. I add them as
    external jar package in project properties. In
    eclipse, everything works fine when I compile and
    run. But I when export the applet to .jar and try to
    run in browser, it doesn't work.
    I think probably because I didn't export the packages
    that the applet requires to run. However I cant find
    a way to export these packages together with the
    applet to a final .jar file.
    Anyone knows how to solve this ? plz help. thx you in
    advanceHi all,
    I have been having the same problems too but came to realize that it is quite difficult getting your applet to work in most cases when using external jars. I found out thet you will have to create the directory hierarchy with the necessary imported classes used by your applet. and then create a new jar file that you will use in the codebase tag.
    For example:
    /* Java code snippet */
    import org.apache.XmlRpcClient;
    public MyApplet extends JApplet {
    //..... Rest of your code ......
    }/* End of snippet */
    You would then have to create a the directory structure:
    org
    _apache
    ___xmlrpc
    Then place all the required classes imported from within (Sometimes it is easier to just add all the classes to save time but lose space i.e. larger jar files).
    Execute the jar command (please adjust as needed to your requirements):
    jar cvf any_name.jar *.class org/
    After signing the applet it may solve your problem. Since I'm working with XmlRpc I still have a lot of problems. If anyone has any advice or tips, please share.
    Thank you

  • Including External JARs for Java Application in OC4J

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

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

  • How to use external jar in a program

    I am writing a java program which requires The class org.apache.commons.lang.StringUtils and the method StringUtils.upperCase(). I have downloaded the commons-lang-2.1.jar jar and put it in the lib directory under my project directory.
    But while compiling the program I am getting an error like this :
    package org.apache.commons.lang does not exist
    and can not find symbol , symbol : variable StringUtils
    Could anyone suggest me what to do so that the program compiles without error?

    I am using command line javac tool.
    Could you tell me how to tell compiler to include the
    jar.javac -classpath /some/directory/commons-lang-2.1.jar;(other required paths and/or jars) files to compile go here
    Please read tutorials too.
    http://java.sun.com/docs/books/tutorial/
    I would also suggest a good build tool called Ant.
    http://ant.apache.org/
    Message was edited by:
    warnerja

  • How to  include external javascript and css resources to a jsf?

    I need to include external css and javascript files to my jsf page. Using the code below does not work because all the styles on the css page are ignored and the functions within the js files are not executed.
    <link rel="stylesheet" type="text/css" href="/resources/styles/style.css" />
    <script language="JavaScript" src="/resources/javascript/util.js"></script>When I try to execute any js function within a script tag on a jsf page I get an object expected error.
    I googled about my problem and found this piece of code for importing styles for an external css.
    <style type="text/css">
    @import url("/resources/styles/style.css");
    </style>How could I add an external javascript file to my jsf?

    Used the relative urls in my first post as well as these, and both were not working.
    <link rel="stylesheet" type="text/css" href="./resources/styles/style.css" />
    <script language="JavaScript" src="./resources/javascript/util.js"></script>The ./ tells that the external file can be found by starting at the current directory and working down the path to the specified file. This is my directory structure. Index.jsf is the file that references the external js and css files.
    -Webcontent
    |_index.jsf
    |_resources
    |__styles
    | |__style.css
    |__javascript
    |__util.js
    Either way I still can't reference the files that I need. Calling a javascript function results in an object expected error, and the styles are ignored.
    If I include the js file directly in the jsf then I can get it to work. I don't want to do this because I have created a handful of seperate js files, and do not want to include all of them in one page. I am using myfaces and tomahawk if that helps.

  • How to include external .js file into .ear file using NetBean 5.5.1?

    is it possible to include external .js file into .ear file using NetBean 5.5.1? if not, then where should I placed the external .js file and how to write the src="xxx" element? (that is , how to write the path of "xxx"?)
    I am using JBOSS 4.2.2 GA as server
    thx!!

    Even this is also not possible because, the code in that package is developed by DWR and i am just adding it to my lib folder and importing the respective classes. In the same manner i need to include the *.js* file in the JSP.It took me about 3 minutes reading through the [DWR Getting Started|http://getahead.org/dwr/getstarted] page to learn that you don't have to do any of that. Perhaps you should read that page?

  • How to call external jar files in EJB project for CE

    Hi,
    I would be thankful if someone could help me with this -
    I need to call the external jar files into my EJB project - Here is what I have done and am getting runtime exception as  -
    java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/glance/pdf/pt/PTDoc
    1. Created a EJB  project" HelloWorld "  using Java perspective in NWDS 7.1 called with client as HelloWorldClient and EAR project as HelloWorldEAR.
    2. Am working on HelloWorld project (1st one).
    3. In my code I am instantiating a class which is a class in one of  the external jar file that I need to refer in my project.
    4. I have set the Java Build path but it works only for the compile time and fails during runtime.
    5. Have read I need to create external library DC and refer in my project "HelloWorld".
    Can anyone help me with exact steps what needs to be done - during creation of external library project and then for my "HelloWorld" EJB project. How would I be able to reference or set the external library project in my EJB project?
    Looking forward to hear from experts.
    Thanks,
    Shiv
    Edited by: Shiv Khullar on Aug 30, 2010 9:39 PM

    Hi Edson,
    I tried it , but it still gives me runtime exception.
    javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/glance/pdf/pt/PTDoc
    java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/glance/pdf/pt/PTDoc
    Steps I performed are -
    1. Created a library project and created 2 Public parts "Compilation" and "Assembly"
    2. Build the library project.
    Now in my EJB project using Project Explorer - set the classpath and added both compilation jar and assembly jar files.
    This is how the classpath entries for external library looks like -
    <classpathentry kind="lib" path="/LocalDevelopmentLocalDevelopmentexternallibrarypdftoolsforwatermarkingdemo.sap.com/gen/default/public/WatermarkAssembly/lib/java/demo.sap.comexternallibrarypdftoolsforwatermarking~WatermarkAssembly.jar"/>
         <classpathentry kind="lib" path="/LocalDevelopmentLocalDevelopmentexternallibrarypdftoolsforwatermarkingdemo.sap.com/gen/default/public/WatermarkCompilation/lib/java/demo.sap.comexternallibrarypdftoolsforwatermarking~WatermarkCompilation.jar"/>
    I have also added the jar files I used in my external library project as "User Library" from Java Build Path . I dont do it , then the code fails during compilation itself.
    Regards,
    Shiv

Maybe you are looking for

  • Trying to install Creative Cloud Packager.

    Runs for a while then error message A12E1 appears.  What am I doing wrong? I clicked on the Get Started button from the email after paying for our user license for Creative Cloud. All previously installed Creative Cloud trial products have been unins

  • Text in Text File Can't be Loaded into a TextArea

    I am trying to do a very simple task: load the text contained in a text file to a TextArea. The file in question indeed exists. Below is my code. I hope someone can point out why the TextArea remains empty. TIA, mlavie The code: <?xml version="1.0" e

  • ITunes 7 and 4 speakers

    Hello there. I have 4 Altec Lansing speakers hooked up to my computer with a suboofer. Does iTunes support quadraphonic sound output? I can only get my songs to play through 2 speakers. I would ike all my songs to output to all 4 speakers, but I can'

  • TimeCapsule ethernet throughput slow

    Hi Guys, I'm having trouble that's similar but slightly different to a lot of the posts already here. I have a 500GB TimeCapsule and use it as a wireless access point. It is connected via Cat5e cable to a 1gb switch which is then connected to my ADSL

  • Displaying the Oracle Forms 10g

    Hi Everyone, I need help on this one. I am currently running Oracle Forms 10g and I want to display the Calendar object on an item in my module. I have attached the relevant libraries i.e Calendar and added the program units as required so in my modu