About jar files??

Hi guys if I make a jar file of all the class files of my beans , utility classes and servlets and put it inside /WEB-INF/lib and make a war file of my application, would my application recognize those class files in the same way it does when class files are simply placed inside /WEB-INF/classes??Or I shall have configure the path of the jar file.Please help me...

Why you to go multiple steps manually for creating war file for your application,
better you to build xml and use with ant ,

Similar Messages

  • Firefox display message about jar:file

    I keep getting this kind of message form firefox The server at jar:file:///C:/Program%20Files/Mozilla%20Firefox/omni.ja!/chrome/browser/content/browser/undefinedapis.google.com_/apps-static/_/js/gapi/plusone/rt=j/ver=ac0_f7pcZ3I.en./sv=1/am=!9WWg3hgFJrKAVXxNQA/d=1/rs=AItRSTNQEWCijTH9DiJZUYVR1HwlNqxcoQ/cb=gapi.loaded_0 appears to be down or nonexistent.
    This happens whenever my internet connection is down. It is annoying though that even though there is now an internet connection, because the address is different from the original, I could not access the site that I want. Further, there are times that I only realized the reason why I can't access the site after so many minutes wasted. How can I get rid of this?

    I am wary about updating since I heard that higher versions of firefox take a lot of memory space, which will decrease my PC's performance. Is this true? Or is there a way to update w/o having to sacrifice PC's decrease speed? Thanks again for your help.

  • About Jar file

    Hii all........
    can anyone tellme that how i can create a jar file for a java project...and if created whatis the benefit for us.............
    thanx in advance..............

    puboo wrote:
    hey i've the same problem..
    i.ve created the jar file.. for example my class file is Test.class
    My mainfest file contains
    Main-class : Test.class
    when type the command to create the jar file ... jar cfm Myjar.jar Mainfest.txt
    That command you stated? ... it lacks the class Test. Unless you made a typo here, what you need to do is this:
    jar cfm Myjar.jar Mainfest.txt *.classAlso, please note that you can view the contents of your .jar file afterward by dropping it onto WinZip (or other zip utility); or just use the command: jar tf Myjar.jar
    it creates the jar file when try to open that it says the Test.class is not exist.. but the file is still there and it works when call the java Test command???
    what can i do

  • Need help about jar file again!!

    I want to make some of my package used as library. And also put my application into executable jar file. I edited following codes:
    uner path: D:\dd\b\b1
    package b.b1;
    public class Son
         int x = 10;
         public Son(){
         public int getX(){
              return x;
    under path D:\b\b2
    package b.b2;
    import b.b1.Son;
    public class Father
         public Father(){
         public static void main(String[] args)
              Son son = new Son();
              System.out.println("Hello World!"+son.getX());
    Then I used jar tool make two jar files and also make one of then has specified main class Manifest.mf.
    Here is my steps:
    D:\bb>edit kk.txt
    D:\bb>jar cmf kk.txt father.jar .\b\b2
    D:\bb>jar cf son.jar .\b\b1
    D:\bb>java -jar -classpath .;son.jar father.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: b/b1/Son
    at b.b2.Father.main(Father.java:13)
    I really do not know what's going on?
    Interesting thing is I can get this result:
    D:\bb>java -classpath .;son.jar b.b2.Father
    Hello World!10
    And if the father.jar does not depend on son.jar,
    it is also works.
    Thanks in advance.

    I believe when you run with the -jar option, the classpath setting is ignore and you have to specify classpath in the manifest file.
    From JDK Doc:
    Class-Path :
    The value of this attribute specifies the relative URLs of the extensions or libraries that this application or extension needs. URLs are separated by one or more spaces. The application or extension class loader uses the value of this attribute to construct its internal search path.
    Sounds like you can specify a different path than the current directory, but you have to know beforehand what that path is.

  • Question about classpath and jar file

    I have a jar file (actually jhall.jar, the java help jar file). How do I uses its classes if I don't want to add it to the classpath. Currently, I have the jar file in the same directory as all my other classes.

    it simply adds secondjar.jar into firstjar.jar, rather
    than extracting secondjar.jar's files and put it into
    firstjar.jar. How would I be able to do that?Don't do either of them. Distribute the two jar files separately, and in the manifest of the one which is meant to be your executable jar file, put a Class-Path: entry that refers to the other one. Look at the latter parts of the tutorial about jar files:
    http://java.sun.com/docs/books/tutorial/jar/basics/
    PC²

  • Using .jar files

    I was able to use .jar files in Java programs that I write on my computer. I could write a program that used an import statement to bring in classes contained in a .jar file.
    One day, I was trying to incorporate a jar file folder directly into my windows operating system by using the environmental variable called CLASSPATH. Unfortunately, I made the mistake of screwing up my PATH variable. I fixed my PATH variable back up by adding the directory to the bin folder inside of the Java folder as is described commonly by the documentation for installing the Java SE on windows computer.
    Since that day, I have not been able to use .jar files using an import statement. My computer is unable to find the .jar files even if I specify the exact directory. Even the IDE(netbeans) that I use is unable to find and use .jar files. I have found that I can open up .jar files and pull the contents that I need out of said .jar files, but I have a project that does not allow me to open up the .jar files and extract the needed classes.
    I have googled this problem so much that I have read hundreds of posts about .jar files, and I cant find anyone in a situation that is similar to mine. If I take my files to another computer with Java SE installed, then my source code can access the .jar files just fine. For some reason, my work computer seems to hate using .jar files. I have no idea what could be the problem. There is no information in the java documentation on troubleshooting with this problem, and the most confusing part is that it worked perfectly fine until That one day
    Does anyone have any ideas?
    Specific technical details:
    I need to pull the Stopwatch.class file from a stdlib.jar file. In the past I had done this by using an import statement inside of my program:
    "import stdlib.Stopwatch; "
    Using this command to compile:
    "javac -cp .;(directory path to .jar file); source.java"
    This used to work. Now when using the javac command I get error messages
    1. Error points directly to import statement. Arrow directed at the period after stdlib.
    "cannot find symbol"
    2. Error message pointing to all instances of the class that I was attempting to import into my program.
    Thanks for reading
    Edited by: 955611 on Aug 28, 2012 7:22 PM

    I read your post. I want to compile this project by using the "-classpath" option in the javac command. After screwing up important system variables once, I do not want to continually have to play with system variable in order to compile projects. To quote from the website that you linked:
    Using the JDK tools' -classpath option
    The JDK tools java, jdb, javac, and javah have a -classpath option which replaces the path or paths specified by the CLASSPATH environment variable while the tool runs. This is the recommended option for changing class path settings, because each application can have the class path it needs without interfering with any other application.
    The runtime tool java has a -cp option, as well. This option is an abbreviation for -classpath.
    For very special cases, both java and javac have options that let you change the path they use to find their own class libraries. The vast majority of users will never to need to use those options, however.
    Clearly, the "-classpath" option in the javac is intended to replace the need to play with important system variables. I guess my post boils down to the question of "Why doesn't this command work for me?". I followed your suggestion by removing the bin directories and adding the stdlib.jar directory directly into the system variable itself. Here is the following output from my command prompt:
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
    C:\Documents and Settings\Lelo>E:
    E:\>cd Programs\Java
    E:\Programs\Java>javac testy.java
    testy.java:1: error: package stdlib does not exist
    import stdlib.Stopwatch;
    ^
    1 error
    E:\Programs\Java>echo %CLASSPATH%
    C:\Program Files\Java\jre6\lib\ext\QTJava.zip;E:\Programs\Java\stdlib.jar;
    E:\Programs\Java>javac -classpath .;E:\Programs\Java\stdlib.jar; testy.java
    testy.java:1: error: package stdlib does not exist
    import stdlib.Stopwatch;
    ^
    1 error
    E:\Programs\Java>
    I still received the same errors. It seems that even adding the directories into the system variable will not work for me.

  • ...Simplest way to make Jar Files...

    I know there have been numerous questions about jar files and that this has probably been answered before. I am using Forte to develop a program. The program runs fine in Forte, and I used the jar packager to create a jar file. When I double click this file, nothing happens though. I can execute other jar files I have downloaded from the net, but for some reason the ones I create don't work. What is the simplest way to package the classes into a jar file so that I can run my program when I double click it?

    I don't know about double-clicking it to run - that involves making a file association (in Windows) to associate a program with a file type - although I assume you've already done this if you doubleclick others and they run.
    In the case with your own jars it sounds like you need to add a manifest file with the 'Main-class' attribute set to the name of the class that you want to run from the jar.
    eg
    Main-class: YourPackage.YourClass
    The manifest.mf needs to be in a meta-inf dir inside your jar.
    If you open your other jars that do work you will see an example of the manifest.mf file, and the 'Main-class' attribute.
    Also - check in the jdk docs in the tools section - this should tell you all you need to know about the 'jar' tool.
    Hope this helps,
    Kevin Hooke

  • Running scripts, bat files, etc from a jar file

    Hello,
    Does anyone know of a way, or even if it is possible to run a script or batch file from a jar file?
    For instance, lets say I have a batch file that I can run from the command prompt by typing :
    myBatchFile.bat
    and now I write a very simple java app that will do the same:
    public class Test {
    public static void main(String[] args) {
    try {
    Runtime rt = Runtime.getRuntime();
    Process p = rt.exec(�myBatchFile.bat�);
    } catch (Exception e) {
    e.getMessage();
    The above app will work as long as the batch file is in the current directory, but how or can I make it work if I stick the batch file in a jar file along with the app?
    I tried using the manifest file with no luck.
    I tried creating a URI to the jar file, wrapping it in a File and then passing that File to the exec method also with no luck.
    I searched all the forums on Sun but came up with nothing.
    I performed a google search also with no luck.
    Does anyone have the answer to this? Even if I can get a definitive �No it can�t be done� answer. Although I would think that it should be able to be done.
    Thanks

    Hi,
    you cannot execute anything being inside a jar-file. The OS doesn't know anythig about jar-files and cannot look inside one to find the program/script/batch you want to execute.
    You could do a workaround by extracting the file from the jar-file before calling exec(). But normally OS dependent files should not be inside a jar-file and remain in a own directiory.
    Andre

  • How do you make a jar file for your program?

    Title says it all - I don't have software that automatically does it for me.
    Using text pad :O

    Everything you always wanted to know about JAR files, but were afraid to ask:
    http://java.sun.com/docs/books/tutorial/deployment/jar/index.html

  • What is a jar file

    hello
    i'm a recent oracle developer.
    i hear about jar files
    what is the jar file and how can i create it
    thanks

    As far as forms on the web is concerned- the Jar files you come across : like f90all.jar is basically a zip file of java classes - each java class is responsible for drawing a screen item (like a button or a text field).
    Regards
    Grant Ronald
    Product Management

  • JAR file not running.

    My name is Pradipto.I make one JAR file which contains some third
    party classes.Actually i am using jdom classes for parsing xml.As i am running jar file it is showing error that jdom classes not found.
    I set classpath for jdom classes also included jdom jar/class files to jdk classpath but still it is not running.Pl help me and tell me where to set classpath for jdom?
    Thanx

    Hi all,
    I am sorry that the reply I posted here was supposed to be send to http://forums.java.sun.com/thread.jsp?forum=31&thread=294049 - a million appologies!
    Putting the required jar files within JRE installations (installed extensions) will require you to make these changes to all machines you are going to run your application - in some cases this might not be a feasible solution. Instead you can bundle the required jars along with your application (after verifying that its permissible to do so), and refer these jar files in the manifest of the executable jar file you are creating.
    See http://java.sun.com/docs/books/tutorial/ext/index.html to know about extension mechanism and http://java.sun.com/docs/books/tutorial/jar/index.html to know about JAR files.
    Launching an executable JAR file might not work on some platforms and also on the type of JRE installation you did. If everything else fails, try a JRE reinstall! :)
    HTH,
    Binil

  • How to inform the client when the jar files is updated?

    I have a question about jar file updatation by web start, please help me.
    If a client's jar file is updated in Web server and automatically downloaded to local cache, how the client know which jar file is updated?. If I want to do some special operation after updating a appointed jar file, how can I do?

    Contrary to common popular belief, this forum is not a free 'I will look up/abstract the documentation on your behalf' forum.
    You can look up sqlnet.expire_time on http://tahiti.oracle.com or may be even Google will work.
    Please do not abuse this forum by asking doc questions.
    Sybrand Bakker
    Senior Oracle DBA

  • Modify the jar file content !!

    hi , i have a jar file that i want to add a class to it ... can anyone help ?

    What about JAR Files?
    The Java ARchive (JAR) format is based on the standard ZIP file format with an optional manifest file. If you wish to >create JAR files or extract files from a JAR file from within your Java applications, use the java.util.jar package, which >provides classes for reading and writing JAR files. Using the classes provided by the java.util.jar package is very similar >to using the classes provided by the java.util.zip package as described in this article. Therefore, you should be able to >adapt much of the code in this article if you wish to use the java.util.jar package. http://java.sun.com/developer/technicalArticles/Programming/compression/

  • Mak a jar file

    hello,
    i've been working with java and java servlet for a while, but i've no clue about jar files. my question is, how do i make a jar file? is a jar file a compressed version of multiple class files or what? thanks for any advice.

    OK, here's a link to learning about JAR files - this should help you master all you'd need to know to work with jars.
    http://developer.java.sun.com/developer/Books/javaprogramming/JAR/basics/
    Rather than provide you with a brief explanation here, i guess visiting the link and learning all thats there would be more helpful.
    Hope the above helps.
    John Morrison

  • Question about Java Applet Jar file signing.

    These questions pertain to Java 6 Standard Edition 1.6.0_22-b04 and later.
    I have gone through the Oracle Java Tutorial for generate public and private key information
    to sign a jar file, and how to sign the jar itself, all at
    [http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html|http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html]
    , and seek some clarification on the following related questions:
    -In order to "escape" the java applet sandbox that exists around the client's
    copy of the applet running in their web browser, ie.
    (something forbidden by default), is verification of the signed applet enough, or is a policy file required
    to stipulate these details?
    -using the policytool policy file generator, what do I need to add under "Principals"
    (if anything) when dealing with a Java applet? Are Codebase and SignedBy simply author information?
    -If I choose to use a java.security.Permission subclass object set up in equivalent fashion within the Applet,
    which class within the Applet jar do I instantiate that object in? Does it need to be mentioned
    in the applet's jar Manifest.MF file?
    -Is the "keystore database" a java language service/process which runs in
    the Server's memory and is simply accessed and started by default
    by the client verifier program (appletview/web browser)?
    -The public key certificate file (*.cer) is put in the webserver directory holding
    the Applet jar file (ie. Apache Tomcat, for example).
    -Presumably, the web browser detects the signed jar
    and certificate file, and provides the browser pop up menu asking the user
    about a new, non recognised certificate (initially).
    Is this so?
    -With this being the case, can the applet now escape
    the sandbox, be it with or without the stipulated
    policy permissions?

    848439 wrote:
    -In order to "escape" the java applet sandbox that exists around the client's
    copy of the applet running in their web browser, ie.
    (something forbidden by default), is verification of the signed applet enough, or is a policy file required
    to stipulate these details?Just sign the applet, the policy file is not necessary.
    -Is the "keystore database" a java language service/process which runs in
    the Server's memory and is simply accessed and started by default
    by the client verifier program (appletview/web browser)?No.
    -The public key certificate file (*.cer) is put in the webserver directory holding
    the Applet jar file (ie. Apache Tomcat, for example).No. For a signed Jar, all the information is contained inside the Jar.
    -Presumably, the web browser detects the signed jar
    and certificate file, and provides the browser pop up menu asking the user
    about a new, non recognised certificate (initially).
    Is this so?No. It is the JVM that determines when to pop the confirmation dialog.
    -With this being the case, can the applet now escape
    the sandbox, ..Assuming the end-user OK's the trust prompt, yes.
    ..be it with or without the stipulated
    policy permissions?Huh?

Maybe you are looking for

  • Send E-mail with payment advice to several address

    Hi Experts In our company in USA we set a payment through ACH, for it we need to send a payment advice to the vendor after we run process in F110, that process is run properly but the problem is we need to send some mails to more than one receiver, a

  • Open Search Results in client application

    Hi, I try to use the following post http://richardstk.com/2013/10/25/open-sharepoint-2013-search-results-in-the-client-application/ in order to open search results in client application. 1. Can someone help where should i add the statement ctx.Script

  • How can I use the scan to email preference?

    I'm trying to scan to email, but am not able to, how can I do this?

  • FRM-40010:can not read form

    FRM-40010:can not read form/appstest/cmwprodappl/po/11.5.0/forms/us/nwasa.fmx how can i resolve this error please tell me

  • Outlook 2010 hangs when loading in "processing"

    After upgrading from Windows 7 home to ultimate I am having problems with Outlook 2010.  When staring the program hanks up on "processing" Any idea what I can do to resolve this problem? Pheresisman