Changed .Jar files

I tried downloading a .jar file but accidently changed to Open with: wordpad
How can I change it back to its previous form?

Hi,
Right click the file, choose “properties” ,choose “change” choose an option to open with.Or ”More Options“ ,“Look for another app in this machine”  ,navigate to an app to open this file.
Best regards

Similar Messages

  • Jar file and image

    Hi, i have a problem with my desktop swing app. A splash screen i added at the start of application.
    I created a exe file form jar, and There is a image file(jpg) on splash. In netbeans i put image in a images
    folder ( src, images, build ... folders at the same place). And builded it, then i changed jar file to exe.
    If i dont add my images folder at the same place with exe file it doesnt work.
    How can i hide these images in exe???
    is there anybody give advices??

    Here is code, with a lot of shortcuts, but showing how to properly load an image included in a JAR:
    package jGetResource;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.image.BufferedImage;
    import java.io.IOException;
    import javax.imageio.ImageIO;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class jGetResource {
      public jGetResource(){
        try{
          BufferedImage bi = ImageIO.read(this.getClass().getResource("image/myImage.jpg")); //this is the line you need--the rest is just shortcut code not meant as what you should do in your project.
          new MyJFrame(bi).setVisible(true);
        }catch(IOException e){
          System.out.println(e.toString()); //remember ALWAYS ALWAY ALWAYS report failure--otherwise how to do you know why it's not working?
      public static void main(String[] args) {
        new jGetResource();
      class MyJFrame extends JFrame{
        BufferedImage bi;
        MyJFrame(BufferedImage bi){
          this.bi = bi;
          this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          this.setSize(new Dimension(bi.getWidth(), bi.getHeight()));
          this.setResizable(false);
        public void paint(Graphics g){
          g.drawImage(bi,0,0,this);
    }Note: to include your image (image/myImage.jpg) in the JAR, drag and drop the folder containing the image into the package for your project.
    Also please note: this is a shortcut--Since bi is drawn directly onto the JFrame, paint has to be extended because it is the outer most container--no JPanel or other component to display is used. Also setSize is used instead of setPerferredSize as this is the outermost container and no layout manager is in effect. Also pack() is not used as this is the outer most container and no ordering of contents is needed. Also note super.paint(g) is not called as this is a one time use container--show it and close it.

  • Is it Possible to Change the Jar File Names After Downloading at Client

    Hi. All
    Here I am tring to Rename Jar file Names once after JWS Downloads at Client Place. But I don't know how to do this. I Searched in so many Blogs and Forums, but i failed to get Solution for this. As when JWS downloads Jars from server, its changes file names (prefixes with "RM" and "RT"). So same way i want to change once after it downloads files. Can any body tels how to dot this. Really ... Help is appriciated
    Thnx a lot for reading the above
    Sreedhar P

    Note from other posts:
    The content and format of the cache will and do change from version to version of javaws. It is highly unadvisable to build into you application relying on the location or format.
    That being said, for 1.4.2 or 1.5.0, the location was as given: "C:\Documents and Settings\<UserID>\Application Data\Sun\Java\Deployment\cache\javaws", and in long path below that depending on the URL of the resource.
    For version 6, the cache is in : "C:\Documents and Settings\<UserID>\Application Data\Sun\Java\Deployment\cache\6.0" and then in a directory below that named "0" thry "63", depending on the hash of the URL of the resource. The name will be completely obscure, there will be one binary index file with "idx" extension, and then the actual resource will be the file of the same name w/o any extension.
    /Andy

  • Jar:// protocol corrupting stream when jar file changes

    We've implemented a custom classloader that allow it to be given multiple directories to search for classes including any jar files within the root of the directory.
    So if there are any Jars in the given directory then it will search in these jars for the class.
    Here lies the problem. To implement the findResources method in the classloader we need to pass back a URL object to this jar for the resource that we want.
    So for example if we want myText.properties that lives in the file myJar.jar then the classloader will find this jar and pass back a URL of jar://myJar.jar/!myText.properties.
    Then we can do a
    in=url.getInputStream();
    in.read(); which works fine.
    Now the problem.
    if we now update the jar file and create a new classloader object and go through finding this resource. When we try to read the inputstream we get the following exeption :
    java.util.zip.ZipException: invalid block type
         at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:137)I've narrowed it do to the JarURLConnection Stream handler. Seems that this is half caching or something.
    Here is a code sniped to reproduce the error.
    for(int a=0;a<2;a++){
            try {
              URL u=new URL("jar: " + new File("d:/myJar.jar").toURL() + "!/" + "myText.properties");
              JarURLConnection juc=(JarURLConnection)u.openConnection();
              InputStream in=juc.getInputStream();
              System.out.println(in.read());
              in.close();
               catch (Exception ex) {
                 ex.printStackTrace();
              System.out.println("Change the Jar file to a newer version you have 10seconds");
              synchronized (this) {
                try {
                  this.wait(10000);
                catch (InterruptedException ex1) {
          }So if you use one Jar version you'll get an output. Then it will wait 10seconds while you change or update your Jar and then it will go round again and produce the execption.
    This is happening on both 1_3_1_08 and 1_4_1_02.
    Any help would be appriciated.
    Cheers
    Johnnyfp

    I've seen a very similar result from using URL.openStream(). Start with two copies of 'yourJar.jar', but change the manifest of one to make it a different size.
    String jarName = "yourJar.jar";
    String containedFile = "META-INF\MANIFEST.MF"; // for example
    URL jarUrl = ...make an url from jarName and containedFile
    InputStream is = jarUrl.openStream();
    byte[] bytes = ...read the bytes...
    is.close();
    println( 'bytes found: " + bytes.length );
    Put this code into a method and put a call to it in a loop with XXX second sleep.
    This will work with either jar file. But if either jar is replaced by the other during sleep (simulating hot deployment), a ZipException is thrown, invalid block type.
    Each new iteration starts fresh with string names, the code doesn't explicitly retain any other references from one iteration to the next. There's no URLConnection on which to setUseCaches().
    The work-around for this is to avoid URL. Replace the 'URL...' and 'InputStream...' lines above with
    JarFile jf = new JarFile( jarName );
    InputStream is = jf.getInputStream( containedFile );
    and the same hot deployment scenario works.
    I've seen the same results with Sun 1.4.1_02, 1.4.2_01, 1.5.0 (beta) and IBM 1.3.1.

  • How to change the icon of the jar file w/o changing the windows setting

    I may be in wrong forum/area but I am not sure.
    I have created a windows executable jar file. Functionally it works fine. I can double click it to start my app. I want to change the icon of the jar file. I know I can change the icon for .jar extension in windows, but I want to be able to give a seperate icon for just this one file.
    All windows applications have thier own icon like Word, Excel etc. Is there any way I can do this for java apps? Also could this icon be kept consistent across platform say if I copy my app to linux? (Assuming it is not made for any particular os.)
    I am sure someone has come across this before.
    Thanks in advance.

    AFAIK you cannot specify an icon for a jar file. You can, however, specify an icon for a Frame using the setIconImage() method. This will have the effect of showing the icon in the taskbar for instance.

  • Critiical - Oracle Contract Breach by Changing Logo, frmall_jinit.jar file?

    Hi Guys,
    We want to display our own logo instead of ORACLE logo in forms runtime applet that is loaded in web browser.
    I know how to do it, adding the logo in frmall_jinit.jar file and in formsweb.cfg, setting logo=<our logo>.
    And this is working perfectly fine.
    The query i have is -
    By doing so do we breach Oracle's contract? As we are modifying a jar file provided by them?
    Thanks!
    Av.
    Edited by: Avi4Ora on Aug 5, 2010 2:01 PM

    Ahhh, I thought you wanted to know if it is allowed to change the frmall_jinit.jar to add your own logo hence the link to the documentation ;).
    So you are saying you are replacing the oracle_logo.gif located in /forms/icons? This doesn't sound right as to my mind that's misusing of the Corporation Name "Oracle" (on the other side I'm just a developer, not a lawyer).
    But anyway: if you change the logo via formsweb.cfg (logo=something) to something else, and pack your image in a different jar file you should be good in my mind. They give you the possiblities to change the logo of your forms app and they document it. Sounds valid to me (again: developer, not lawyer).
    cheers

  • Does applicaton code requires recompile on changing a jar file

    Hi
    Does the application code requires a recompile if a jar used by it undergoes change(but its interface remains same)
    Or same ? in different way jar file are statically or dynamically
    Bye
    gene

    Does the application code requires a recompile if a
    jar used by it undergoes change(but its interface
    e remains same) No.

  • Apps 11.5.10.2: change the digital signature in jar files

    Hi,
    if you you change the digital signature in jar files, what needs to be updated? Regenerate all forms etc?
    This is Apps 11.5.10.2 on AIX.
    Thanks,
    Helmut

    You only need to regenerate all product JAR files via adadmin.

  • Jar files missing when changing the desc  prop under room maintenance

    Hi
    I have a requirement to restrict the length of the
    description under room template maintenance ---> General Tab --> Description .
    I am downloading the com.sap.netweaver.coll.appl.ui.room.par and i done some modification in the Information control class file of  com.appl.ui.room.roominformation_api.jar jar file.
    I think its no suggestable to made the modification to the orginal par file.
    anyone can please help in the above problem.  and also let me know whether its the correct way of proceeding.
    Thanks in Advance

    no update yet. I'm gonna run the tool that is suggested, but I have no other issues with any previous patch. I thought the content of the file I added to my post would have ring a bell to somebody, who had the same problem, but it seems like I was wrong. I'll post once I run the tool suggested in the note
    thx all

  • How to modify a specific class in jar file ?

    I've downloaded a jar file for applet, the jar file works fine... but when I extract a specific class file from the jar file and just recompie it from my IDE (Eclipse) without even making any change and then compress again jar class files including the new modified class file instead of the old one (without any modifications to other classes)... then I get
    (NoSuchMethodError ) exception whenever methods of other classes are invoked from within the modified class !!
    ...The manifist file of the jar file reads the following line
    Created-By: 1.4.0_01 (Sun Microsystems Inc.)
    I thought it means that jar class files were built using JDK 1.4.0_01 ...I used JDK 1.5.0_01 in my IDE...
    I thought JRE incompatiblity was the reason of the problem so I downloaded JRE 1.4.0_01 and used it to build this class file... but i got the same exception..
    so what is the main reason of the problem ? ...should I make changes to IDX files accompanying applet jar files ??
    If no, then how can I overcome this problem and be able to change and rebuild a specific class from this jar file ?
    (I cannot rebuild all classes in jar because there are errors I cannot resolve !!)

    Could you please clarify: do you want to run your project or a project from an independent jar?
    In the first case just select Run Project from the project context menu or select a class with main method and click Run File in the class context menu.
    Regarding the second case:
    - I don't think there is such a feature in the IDE (running third party jars is not an IDE function). Could you explain why you need this?

  • Loading jar files at execution time via URLClassLoader

    Hello�All,
    I'm�making�a�Java�SQL�Client.�I�have�practicaly�all�basic�work�done,�now�I'm�trying�to�improve�it.
    One�thing�I�want�it�to�do�is�to�allow�the�user�to�specify�new�drivers�and�to�use�them�to�make�new�connections.�To�do�this�I�have�this�class:�
    public�class�DriverFinder�extends�URLClassLoader{
    ����private�JarFile�jarFile�=�null;
    ����
    ����private�Vector�drivers�=�new�Vector();
    ����
    ����public�DriverFinder(String�jarName)�throws�Exception{
    ��������super(new�URL[]{�new�URL("jar",�"",�"file:"�+�new�File(jarName).getAbsolutePath()�+"!/")�},�ClassLoader.getSystemClassLoader());
    ��������jarFile�=�new�JarFile(new�File(jarName));
    ��������
    ��������/*
    ��������System.out.println("-->"�+�System.getProperty("java.class.path"));
    ��������System.setProperty("java.class.path",�System.getProperty("java.class.path")+File.pathSeparator+jarName);
    ��������System.out.println("-->"�+�System.getProperty("java.class.path"));
    ��������*/
    ��������
    ��������Enumeration�enumeration�=�jarFile.entries();
    ��������while(enumeration.hasMoreElements()){
    ������������String�className�=�((ZipEntry)enumeration.nextElement()).getName();
    ������������if(className.endsWith(".class")){
    ����������������className�=�className.substring(0,�className.length()-6);
    ����������������if(className.indexOf("Driver")!=-1)System.out.println(className);
    ����������������
    ����������������try{
    ��������������������Class�classe�=�loadClass(className,�true);
    ��������������������Class[]�interfaces�=�classe.getInterfaces();
    ��������������������for(int�i=0;�i<interfaces.length;�i++){
    ������������������������if(interfaces.getName().equals("java.sql.Driver")){
    ����������������������������drivers.add(classe);
    ������������������������}
    ��������������������}
    ��������������������Class�superclasse�=�classe.getSuperclass();
    ��������������������interfaces�=�superclasse.getInterfaces();
    ��������������������for(int�i=0;�i<interfaces.length;�i++){
    ������������������������if(interfaces[i].getName().equals("java.sql.Driver")){
    ����������������������������drivers.add(classe);
    ������������������������}
    ��������������������}
    ����������������}catch(NoClassDefFoundError�e){
    ����������������}catch(Exception�e){}
    ������������}
    ��������}
    ����}
    ����
    ����public�Enumeration�getDrivers(){
    ��������return�drivers.elements();
    ����}
    ����
    ����public�String�getJarFileName(){
    ��������return�jarFile.getName();
    ����}
    ����
    ����public�static�void�main(String[]�args)�throws�Exception{
    ��������DriverFinder�df�=�new�DriverFinder("D:/Classes/db2java.zip");
    ��������System.out.println("jar:�"�+�df.getJarFileName());
    ��������Enumeration�enumeration�=�df.getDrivers();
    ��������while(enumeration.hasMoreElements()){
    ������������Class�classe�=�(Class)enumeration.nextElement();
    ������������System.out.println(classe.getName());
    ��������}
    ����}
    It�loads�a�jar�and�searches�it�looking�for�drivers�(classes�implementing�directly�or�indirectly�interface�java.sql.Driver)�At�the�end�of�the�execution�I�have�found�all�drivers�in�the�jar�file.
    The�main�application�loads�jar�files�from�an�XML�file�and�instantiates�one�DriverFinder�for�each�jar�file.�The�problem�is�at�execution�time,�it�finds�the�drivers�and�i�think�loads�it�by�issuing�this�statement�(Class�classe�=�loadClass(className,�true);),�but�what�i�think�is�not�what�is�happening...�the�execution�of�my�code�throws�this�exception
    java.lang.ClassNotFoundException:�com.ibm.as400.access.AS400JDBCDriver
    ��������at�java.net.URLClassLoader$1.run(URLClassLoader.java:198)
    ��������at�java.security.AccessController.doPrivileged(Native�Method)
    ��������at�java.net.URLClassLoader.findClass(URLClassLoader.java:186)
    ��������at�java.lang.ClassLoader.loadClass(ClassLoader.java:299)
    ��������at�sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
    ��������at�java.lang.ClassLoader.loadClass(ClassLoader.java:255)
    ��������at�java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
    ��������at�java.lang.Class.forName0(Native�Method)
    ��������at�java.lang.Class.forName(Class.java:140)
    ��������at�com.marmots.database.DB.<init>(DB.java:44)
    ��������at�com.marmots.dbreplicator.DBReplicatorConfigHelper.carregaConfiguracio(DBReplicatorConfigHelper.java:296)
    ��������at�com.marmots.dbreplicator.DBReplicatorConfigHelper.<init>(DBReplicatorConfigHelper.java:74)
    ��������at�com.marmots.dbreplicator.DBReplicatorAdmin.<init>(DBReplicatorAdmin.java:115)
    ��������at�com.marmots.dbreplicator.DBReplicatorAdmin.main(DBReplicatorAdmin.java:93)
    Driver�file�is�not�in�the�classpath�!!!�
    I�have�tried�also�(as�you�can�see�in�comented�lines)�to�update�System�property�java.class.path�by�adding�the�path�to�the�jar�but�neither...
    I'm�sure�I'm�making�a/some�mistake/s...�can�you�help�me?
    Thanks�in�advice,
    (if�there�is�some�incorrect�word�or�expression�excuse�me)

    Sorry i have tried to format the code, but it has changed   to �... sorry read this one...
    Hello All,
    I'm making a Java SQL Client. I have practicaly all basic work done, now I'm trying to improve it.
    One thing I want it to do is to allow the user to specify new drivers and to use them to make new connections. To do this I have this class:
    public class DriverFinder extends URLClassLoader{
    private JarFile jarFile = null;
    private Vector drivers = new Vector();
    public DriverFinder(String jarName) throws Exception{
    super(new URL[]{ new URL("jar", "", "file:" + new File(jarName).getAbsolutePath() +"!/") }, ClassLoader.getSystemClassLoader());
    jarFile = new JarFile(new File(jarName));
    System.out.println("-->" + System.getProperty("java.class.path"));
    System.setProperty("java.class.path", System.getProperty("java.class.path")+File.pathSeparator+jarName);
    System.out.println("-->" + System.getProperty("java.class.path"));
    Enumeration enumeration = jarFile.entries();
    while(enumeration.hasMoreElements()){
    String className = ((ZipEntry)enumeration.nextElement()).getName();
    if(className.endsWith(".class")){
    className = className.substring(0, className.length()-6);
    if(className.indexOf("Driver")!=-1)System.out.println(className);
    try{
    Class classe = loadClass(className, true);
    Class[] interfaces = classe.getInterfaces();
    for(int i=0; i<interfaces.length; i++){
    if(interfaces.getName().equals("java.sql.Driver")){
    drivers.add(classe);
    Class superclasse = classe.getSuperclass();
    interfaces = superclasse.getInterfaces();
    for(int i=0; i<interfaces.length; i++){
    if(interfaces[i].getName().equals("java.sql.Driver")){
    drivers.add(classe);
    }catch(NoClassDefFoundError e){
    }catch(Exception e){}
    public Enumeration getDrivers(){
    return drivers.elements();
    public String getJarFileName(){
    return jarFile.getName();
    public static void main(String[] args) throws Exception{
    DriverFinder df = new DriverFinder("D:/Classes/db2java.zip");
    System.out.println("jar: " + df.getJarFileName());
    Enumeration enumeration = df.getDrivers();
    while(enumeration.hasMoreElements()){
    Class classe = (Class)enumeration.nextElement();
    System.out.println(classe.getName());
    It loads a jar and searches it looking for drivers (classes implementing directly or indirectly interface java.sql.Driver) At the end of the execution I have found all drivers in the jar file.
    The main application loads jar files from an XML file and instantiates one DriverFinder for each jar file. The problem is at execution time, it finds the drivers and i think loads it by issuing this statement (Class classe = loadClass(className, true);), but what i think is not what is happening... the execution of my code throws this exception
    java.lang.ClassNotFoundException: com.ibm.as400.access.AS400JDBCDriver
    at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:140)
    at com.marmots.database.DB.<init>(DB.java:44)
    at com.marmots.dbreplicator.DBReplicatorConfigHelper.carregaConfiguracio(DBReplicatorConfigHelper.java:296)
    at com.marmots.dbreplicator.DBReplicatorConfigHelper.<init>(DBReplicatorConfigHelper.java:74)
    at com.marmots.dbreplicator.DBReplicatorAdmin.<init>(DBReplicatorAdmin.java:115)
    at com.marmots.dbreplicator.DBReplicatorAdmin.main(DBReplicatorAdmin.java:93)
    Driver file is not in the classpath !!!
    I have tried also (as you can see in comented lines) to update System property java.class.path by adding the path to the jar but neither...
    I'm sure I'm making a/some mistake/s... can you help me?
    Thanks in advice,
    (if there is some incorrect word or expression excuse me)

  • Program will run with errors, but not at all in a .jar file

    First off, here is my program right now:
    import java.io.*;
    import java.util.*;
    import javax.swing.JOptionPane;
    public class prune
        public static void main(String args[])
            String steamid="",time="";
            BufferedReader infile = null;
            BufferedWriter outfile = null;
            FileReader fr = null;
            FileWriter wr = null;
            StringTokenizer strtk = null;
            String line = null;
         JOptionPane.showMessageDialog
          (null, "Vault.ini Pruner v2");
         String filepath = JOptionPane.showInputDialog("Enter the filepath to your vault.ini file.");
         String strdeletenumber = JOptionPane.showInputDialog("Enter the number that vault entries under will be deleted");
         int deletenumber = Integer.parseInt(strdeletenumber);
            try
                infile = new BufferedReader(new FileReader(filepath));
                outfile = new BufferedWriter(new FileWriter(filepath));
            catch(IOException ioe)
                JOptionPane.showMessageDialog
          (null, "Can't open vault.ini:" + ioe);
            try
                while((line=infile.readLine())!=null)
                    strtk = new StringTokenizer(line);
                    steamid = strtk.nextToken();
                    time = strtk.nextToken();
                    if(Integer.parseInt(time)>=deletenumber)
                        outfile.write(steamid);
                        outfile.write(" ");
                        outfile.write(time);
                        outfile.newLine();
            catch(IOException ioe)
                JOptionPane.showMessageDialog
          (null, "Error:" + ioe);
            try
                outfile.close();
                infile.close();
            catch(IOException ioe)
               JOptionPane.showMessageDialog
          (null, "Error:" + ioe);
                System.exit(0);
    }The program is supposed to open a vault.ini file and delete entries with a number lower than specified.
    Vault files are set up like this:
    STEAMID:X:XXXX 100000
    Right now if I run the program through command prompt it erases both the vault.ini and new vault.ini. I am also trying to put it in an executable jar file and when I do that I get a "Failed to load main class manifest attribute" error. Any ideas on what is causing this?

    I don't know what is happening. I put your exact code into a small build environment and used a build file for ant that I have and it works just fine. Manifest files are a total pain which is why I use a tool to generate it. I know that the last line has to be blank and that no line can be over a certain length.
    You've now spent several days avoiding ant and I got it running with ant in about 3 minutes. I'm really missing something.
    For reference, the build file is below should you change your mind. Put your prune.java in a new directory named "src" and save this file below as build.xml in the parent directory of "src". Run the program with java -jar lib/prune.jar
    <project name="jartest" default="main" basedir=".">
    <!-- location properties -->
        <property name="src.dir" location="src" />
        <property name="dest.classes.dir" location="classes" />
        <property name="dest.lib.dir" location="lib" />
    <!-- value properties -->
        <property name="dest.lib.name" value="prune.jar" />
        <property name="main.class" value="prune" />
    <!-- compile time value properties -->
        <property name="compile.debug" value="true" />
        <property name="compile.optimize" value="false" />
        <property name="compile.deprecation" value="true" />
        <property name="compile.source" value="1.4"/>
        <property name="compile.target" value="1.4"/>
    <!-- build -->
        <target name="main" depends="compile,jar" />
        <target name="compile">
            <mkdir dir="${dest.classes.dir}"/>
            <mkdir dir="${dest.lib.dir}"/>
            <javac srcdir="${src.dir}"
                         destdir="${dest.classes.dir}"
                         debug="${compile.debug}"
                         deprecation="${compile.deprecation}"
                         optimize="${compile.optimize}"
                         source="${compile.source}"
                         target="${compile.target}" >
            </javac>
        </target>
    <!-- clean -->
        <target name="clean">
            <delete dir="${dest.classes.dir}"/>
            <delete dir="${dest.lib.dir}"/>
        </target>
    <!-- jar -->
        <target name="jar" depends="compile">
            <jar destfile="${dest.lib.dir}/${dest.lib.name}"
                    basedir="${dest.classes.dir}">
                <manifest>
                    <attribute name="Built-By" value="${user.name}"/>
                    <attribute name="Main-Class" value="${main.class}" />
                </manifest>
            </jar>
        </target>
    </project>

  • Adding JAR file to project

    Hi All
    How can i add jar to my project environment.
    Actually what i did was.
    Created one folder called "JavaWork" like d:\JavaWork
    and put the jar file into this folder and wrote a test class which is importing some classes from the jar file.
    how to use jar ? Please someone help me.
    Thanks in advance
    Shan

    `man jar`
    jar(1) jar(1)
    NAME
    jar - Java archive tool
    SYNOPSIS
    jar [ -C ] [ c ] [ f ] [ i ] [ M ] [ m ] [ O ] [ t ] [ u ]
    [ v ]
    [ x file ] [ manifest-file ] destination input-file
    [ input-files ]
    DESCRIPTION
    The jar tool is a Java application that combines multiple
    files into a single JAR archive file. It is also a gen-
    eral-purpose archiving and compression tool, based on ZIP
    and the ZLIB compression format. However, jar was
    designed mainly to facilitate the packaging of Java
    applets or applications into a single archive. When the
    components of an applet or application (.class files,
    images and sounds) are combined into a single archive,
    they can be downloaded by a Java agent (like a browser) in
    a single HTTP transaction, rather than require a new con-
    nection for each piece. This dramatically improves down-
    load time. The jar tool also compresses files, which fur-
    ther improves download time. In addition, it allows indi-
    vidual entries in a file to be signed by the applet author
    so that their origins can be authenticated. The syntax
    for the jar tool is almost identical to the syntax for the
    tar(1) command. A jar archive can be used as a class path
    entry, whether or not it is compressed.
    The three types of input files for the jar tool are:
    o Manifest file (optional)
    o Destination jar file
    o Files to be archived
    Typical usage is:
    example% jar cf myjarfile *.class
    In this example, all the class files in the current direc-
    tory are placed in the file named myjarfile. A manifest
    file is automatically generated by the jar tool and is
    always the first entry in the jar file. By default, it is
    named META-INF/MANIFEST.MF. The manifest file is the
    place where any meta-information about the archive is
    stored. Refer to the Manifest Format in the SEE ALSO sec-
    tion for details about how meta-information is stored in
    the manifest file.
    To use a pre-existing manifest file to create a new jar
    archive, specify the old manifest file with the m option:
    example% jar cmf myManifestFile myJarFile *.class
    When you specify cfm instead of cmf (that is, you invert
    the order of the m and f options), you need to specify the
    name of the jar archive first, followed by the name of the
    manifest file:
    example% jar cfm myJarFile myManifestFile *.class
    The manifest uses RFC822 ASCII format, so it is easy to
    view and process manifest-file contents.
    OPTIONS
    The following options are supported:
    -C Changes directories during execution of the jar com-
    mand. For example:
    example% jar uf foo.jar -C classes *
    c Creates a new or empty archive on the standard out-
    put.
    f The second argument specifies a jar file to process.
    In the case of creation, this refers to the name of
    the jar file to be created (instead of on stdout).
    For table or xtract, the second argument identifies
    the jar file to be listed or extracted.
    i Generates index information for the specified jar
    file and its dependent jar files. For example,
    example% jar i foo.jar
    would generate an INDEX.LIST file in foo.jar which con-
    tains location information for each package in foo.jar and
    all the jar files specified in foo.jar's Class-Path
    attribute.
    M Does not create a manifest file for the entries.
    m Includes manifest information from specified pre-
    existing manifest file. Example use:
    example% jar cmf myManifestFile myJarFile *.class
    You can add special-purpose name-value attribute
    headers to the manifest file that are not contained
    in the default manifest. Examples of such headers
    are those for vendor information, version informa-
    tion, package sealing, and headers to make JAR-bun-
    dled applications executable. See the JAR Files
    trail in the Java Tutorial and the JRE Notes for
    Developers web page for examples of using the m
    option.
    O Stores only, without using ZIP compression.
    t Lists the table of contents from standard output.
    u Updates an existing JAR file by adding files or
    changing the manifest. For example:
    example% jar uf foo.jar foo.class
    adds the file foo.class to the existing JAR file
    foo.jar, and
    example% jar umf foo.jar
    updates foo.jar's manifest with the information in
    manifest.
    v Generates verbose output on stderr.
    x file
    Extracts all files, or just the named files, from
    standard input. If file is omitted, then all files
    are extracted; otherwise, only the specified file or
    files are extracted.
    If any of the files is a directory, then that direc-
    tory is processed recursively.
    EXAMPLES
    To add all of the files in a particular directory to an
    archive:
    example% ls
    0.au 3.au 6.au 9.au at_work.gif
    1.au 4.au 7.au Animator.class monkey.jpg
    e.au 5.au 8.au Wave.class spacemusic.au
    example% jar cvf bundle.jar *
    adding: 0.au
    adding: 1.au
    adding: 2.au
    adding: 3.au
    adding: 4.au
    adding: 5.au
    adding: 6.au
    adding: 7.au
    adding: 8.au
    adding: 9.au
    adding: Animator.class
    adding: Wave.class
    adding: at_work.gif
    adding: monkey.jpg
    adding: spacemusic.au
    example%
    If you already have subdirectories for images, audio
    files, and classes that already exist in an HTML direc-
    tory, use jar to archive each directory to a single jar
    file:
    example% ls
    audio classes images
    example% jar cvf bundle.jar audio classes images
    adding: audio/1.au
    adding: audio/2.au
    adding: audio/3.au
    adding: audio/spacemusic.au
    adding: classes/Animator.class
    adding: classes/Wave.class
    adding: images/monkey.jpg
    adding: images/at_work.gif
    example% ls -l
    total 142
    drwxr-xr-x 2 brown green 512 Aug 1 22:33 audio
    -rw-r--r-- 1 brown green 68677 Aug 1 22:36 bundle.jar
    drwxr-xr-x 2 brown green 512 Aug 1 22:26 classes
    drwxr-xr-x 2 brown green 512 Aug 1 22:25 images
    example%
    To see the entry names in the jar file using the jar tool
    and the t option:
    example% ls
    audio bundle.jar classes images
    example% jar tf bundle.jar
    META-INF/MANIFEST.MF
    audio/1.au
    audio/2.au
    audio/3.au
    audio/spacemusic.au
    classes/Animator.class
    classes/Wave.class
    images/monkey.jpg
    images/at_work.gif
    example%
    To display more information about the files in the
    archive, such as their size and last modified date, use
    the v option:
    example% jar tvf bundle.jar
    145 Thu Aug 01 22:27:00 PDT 1996 META-INF/MANIFEST.MF
    946 Thu Aug 01 22:24:22 PDT 1996 audio/1.au
    1039 Thu Aug 01 22:24:22 PDT 1996 audio/2.au
    993 Thu Aug 01 22:24:22 PDT 1996 audio/3.au
    48072 Thu Aug 01 22:24:23 PDT 1996 audio/spacemusic.au
    16711 Thu Aug 01 22:25:50 PDT 1996 classes/Animator.class
    3368 Thu Aug 01 22:26:02 PDT 1996 classes/Wave.class
    12809 Thu Aug 01 22:24:48 PDT 1996 images/monkey.jpg
    527 Thu Aug 01 22:25:20 PDT 1996 images/at_work.gif
    example%
    If you bundled a stock trade application (applet) into the
    following jar files,
    main.jar buy.jar sell.jar other.jar
    and you specified the Class-Path attribute in main.jar's
    manifest as
    Class-Path: buy.jar sell.jar other.jar
    then you can use the i option to speed up your applica-
    tion's class loading time:
    example$ jar i main.jar
    An INDEX.LIST file is inserted in the META-INF directory
    which will enable the application class loader to download
    the right jar files when it is searching for classes or
    resources.
    SEE ALSO
    keytool(1)
    JAR Files @
    http://java.sun.com/docs/books/tutorial/jar/
    JRE Notes @
    http://java.sun.com/j2se/1.3/runtime.html#exam-
    ple
    JAR Guide @
    http://java.sun.com/j2se/1.3/docs/guide/jar/index.html
    For information on related topics, use the search link @
    http://java.sun.com/
    13 June 2000 jar(1)

  • Browse and handle jar files?

    I´m going to make a little app to help some morons I know. Pretty much what I want it to do is to make you able to browse files on your HDD and then move them into a .jar file. I know terminal commands for this but is there a way to make it really easy for my friends.
    I dunno if this helps but when I do it thought terminal I first unarchive the .jar, change content and then compress it and move it back.
    Is this possible?

    I still don't think it's good for morons to create .jar files...
    set javrfile to quoted form of (POSIX path of (choose file with prompt ".jar file:" of type {"jar"}))
    set filestoadd to choose file with prompt "files to add:" with multiple selections allowed
    set filestoadd_unixpaths to {}
    repeat with filetoadd in filestoadd
    set filetoadd to quoted form of (POSIX path of filetoadd)
    set filestoadd_unixpaths to filestoadd_unixpaths & filetoadd
    end repeat
    set AppleScript's text item delimiters to " "
    set filestoadd_unixpaths to filestoadd_unixpaths as text
    set AppleScript's text item delimiters to ""
    display dialog (do shell script "jar vuf " & filestoadd_unixpaths)

  • Help adding new files to Jar file.

    I am new to Java and am having problems haveing our Web App work after I have recreated the JAR file...this is what I did...
    Changed to the following directory at a dos prompt:
    D:\jdk1.3.1_01\bin
    Ran the following to extract the files from the jar file.
    jar xvf app2.jar
    ...this created 5 directories with various files.
    copied new and updated graphic files to
    D:\jdk1.3.1_01\bin\app2\images
    Recreated the jar file using the following command (pv com javavp meta-inf borland are the 5 directories that were extracted from the original jar file above):
    jar.exe cvf app2.jar pv com app2 meta-inf borland
    I now have a new jar file that is a similar size, so it looks good, but when I put it in our web site, it does not recognize certain frames (that get information from the database) that it did before (the frames are blank)
    Any thoughts on what I am doing wrong?
    Also, are there any Windows programs that i can use to make this easier instead of using the dos commands?
    Thanks...

    To change the contents while inside a java program, you might be able to use Runtime.exec(String[]). Make the array with "jar.exe" as the first index, flags in the second, and remaining arguments in the remaining indecies.

Maybe you are looking for

  • SOAP Receiver Error: HTTP Error response for SOAP Request

    Hi gurus, I'm facing a weird error in File --> PI 7.31 java only --> soap receiver proxy. The other interfaces runs well. just one get the the following error: Exception caught by adapter framework: java.io.IOException: Error receiving or parsing req

  • Airplay dropping and netgear6250

    i have a 2014 macbook air and the most recent apply tv. both are up to date in terms of software. i recently upgrade my router from a netgear wndr3400 to a netgear r6250 which has the most current firmware. i use the apple tv primarily for streaming

  • FCP5 and Kona 3 Card

    I am working on a FCP5 system with a Kona 3 card installed. The company has used this card for some time with great success for SD projects. They are making the tranfer to HD projects. They are shooting HDCAM. I have been able to get the video signal

  • Elements and RAW

    I have a Elements 6 (I know I should update it, but that will come later).  Is there anyway I can upload RAW files to Elements 6? Thanks - Barry

  • Crystal Reports Java Viewer

    I need to be able to view web reports of a payroll aplication. The payroll vendor told me that I need to install a Crystal Reports with the java viewer component. I am not going to develop I just need to view web reports. Which Crystal Reports versio