7 Replies Latest reply: Aug 8, 2007 3:47 PM by 807605 RSS

    JAR files

    807605
      I read the tutorials on extracting Jar files but I am finding difficulties performing the actual extraction.

      This is what I did:
      I open command prompt and open the directory where the jar is located. Then I type:
      jar xf MyClass.jar
      This didn't work so then I tried
      java jar xf MyClass.jar
      That also didn't work so I tried
      java -jar xf MyClass.jar
      And that also didn't work.

      Can anyone see the problem?

      Thank you.
        • 1. Re: JAR files
          807605
          I read the tutorials on extracting Jar files but I am
          finding difficulties performing the actual
          extraction.

          This is what I did:
          I open command prompt and open the directory where
          the jar is located. Then I type:
          jar xf MyClass.jar
          This didn't work so then I tried
          java jar xf MyClass.jar
          That also didn't work so I tried
          java -jar xf MyClass.jar
          And that also didn't work.

          Can anyone see the problem?

          Thank you.
          Define "didn't work". Does the jar "work" when you rename it as a .zip file and open it with Windows Explorer?
          • 2. Re: JAR files
            807605
            All the classes extract when I zip it and open it with Window Explorer. But I can't seem to extract the files through command prompt. When I say didn't work, I mean that no files are extracted.
            • 3. Re: JAR files
              807605
              Try
              jar xvf MyJar.jar
              Where is your jar coming from? Did you make it, or get it elsewhere?
              • 4. Re: JAR files
                807605
                Why when i made jar file whit NET BEANS my listeners whit database jobs doesn't work. It works just the listeners whit the oder events.
                • 5. Re: JAR files
                  807605
                  Did you ever get this resolved? I'm having the same problem. I get 'jar is not recognized as an internal or external command..."
                  • 6. Re: JAR files
                    800306
                    Did you ever get this resolved? I'm having the same
                    problem. I get 'jar is not recognized as an internal
                    or external command..."
                    That's because your PATH environment variable does not include <my_jdk_home_directory>/bin.
                    • 7. Re: JAR files
                      807605
                      also, you might actually want to READ the tutorial ; )
                      http://java.sun.com/docs/books/tutorial/deployment/jar/unpack.html