8 Replies Latest reply: Aug 6, 2012 5:52 PM by EJP RSS

    edit the jar and rebuilt problem.

    svn123
      hi experts,

      i had ah
      C:\Documents and Settings\Administrator\Desktop\gnatt.jar file when i extract the file means i get those folder

      folder names :
      .data folder
      gantt folder
      META-INF folder
      .data folder holds 00000000
      C:\Documents and Settings\Administrator\Desktop\.data\00000000
      00000000.jdb
      je.lck
      
      gantt folder holds some class file 
      C:\Documents and Settings\Administrator\Desktop\gantt
      GanttChart.class
      
      META-INF holds signature files
      C:\Documents and Settings\Administrator\Desktop\META-INF
      MANIFEST.MF
      Rx.DSA
      Rx.SF
      i decompile the .class into .java .

      i edited something GanttChart.java compile it in . C:\Program Files\Java\jdk1.6.0\bin javac GanttChart.java

      everything is fine.

      now thing is i want rebuit as gnatt.jar with consists of those things.
      .data folder
      gantt folder 
      META-INF folder 
      
      .data folder holds 00000000
      C:\Documents and Settings\Administrator\Desktop\.data\00000000
      00000000.jdb
      je.lck
      
      gantt folder holds some class file 
      C:\Documents and Settings\Administrator\Desktop\gantt
      GanttChart.class
      
      META-INF holds signature files
      C:\Documents and Settings\Administrator\Desktop\META-INF
      MANIFEST.MF
      Rx.DSA
      Rx.SF
      for creating jar i did like this
      C:\Program Files\Java\jdk1.6.0\bin>jar -cf gantt.jar *.class

      but the problem is : i cant get all of those files as if first i extractred. can anyone guide me step by step.

      if i create signature bla bla error. am not sure i created correct way

      can anyone help me. how to do my desired result.

      thanks&&REgards
      subu.
        • 1. Re: edit the jar and rebuilt problem.
          EJP
          i decompile the .class into .java.
          Why? This is a very bad start to any problem.
          for creating jar i did like this
          C:\Program Files\Java\jdk1.6.0\bin>jar -cf gantt.jar *.class
          Wrong. You need the jar file to contain everything it originall contained, not just the .class file. So you need to adjust your 'jar' command line accordingly.
          but the problem is : i cant get all of those files as if first i extractred.
          I doubt that is the real problem. More probaby your new .jar file doesn't work because it is missing all those other files.
          if i create signature bla bla error. am not sure i created correct way
          What is 'bla bla' supposed to convey to us?
          can anyone help me. how to do my desired result.
          What desired result?

          There is very little information here and what there is is very misleading.
          • 2. Re: edit the jar and rebuilt problem.
            tschodt
            Just use an archive editor like 7-Zip or TotalCommander
            grab a copy of the original jar file and replace the class files.
            • 3. Re: edit the jar and rebuilt problem.
              svn123
              sorry experts,
              i decompile the .class into .java. Why? This is a very bad start to any problem.
              i had only class file. no source file so i use some cavaj software to get java source file to change something.


              for creating jar i did like this C:\Program Files\Java\jdk1.6.0\bin>jar -cf gantt.jar *.class
              Wrong. You need the jar file to contain everything it originall contained, not just the .class file. So you need to adjust >your 'jar' command line accordingly.
              yes got me correctly. so, what i did extract the jar file edit something on source complie it. and i want rebuilt same jar with speficied folder. the speficied folder are created at jar creation.

              so problem is jar creation. how to create jar with specified folders.


              but the problem is : i cant get all of those files as if first i extractred. // ----leave this statement. wrongly wrotten.
              I doubt that is the real problem. More probaby your new .jar file doesn't work because it is missing all those other files.
              if i create signature bla bla error. am not sure i created correct way
              What is 'bla bla' supposed to convey to us?
              tampered or passw0rd incorrect.

              can anyone help me. how to do my desired result.
              What desired result?
              simple,
              i get gantt.jar and extracted and edited one of the source and compile it.
              so my desired result.
              rebuilt jar with all specificied folder(as i mentioned).



              There is very little information here and what there is is very misleading.
              sorry am new to this jar creation and creating sign. so i can able to convey what did. i didnt right way.
              • 4. Re: edit the jar and rebuilt problem.
                svn123
                can you explain little more.
                am new i cant catch your point.
                • 5. Re: edit the jar and rebuilt problem.
                  svn123
                  please expert. :(

                  i didnt know how to do this
                  So you need to adjust your 'jar' command line accordingly.
                  can you show the way.
                  • 6. Re: edit the jar and rebuilt problem.
                    gimbal2
                    subu123 wrote:
                    please expert. :(

                    i didnt know how to do this
                    So you need to adjust your 'jar' command line accordingly.
                    can you show the way.
                    Don't knowing is not a problem, then you look for information and you obtain the knowledge.

                    http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jar.html
                    • 7. Re: edit the jar and rebuilt problem.
                      svn123
                      Don't knowing is not a problem, then you look for information and you obtain the knowledge.
                      http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jar.html
                      sir,

                      i think i may not get you correctly :(

                      simple jar creation i know, but while creating jar some sign operation have to take place.

                      why am saying means while extracting the original jar means i get some x.sf and x.dsa and some lock files .lck file

                      when i creating jar and i extract suffesfully but thing is i had only manifest file. i did not how to perform sign operation.

                      i read some Oracle docs to perform sign operation but they are some tampered or passw0rd incorrect.

                      so i did nt know where am?

                      can anyone guide me step by step.
                      • 8. Re: edit the jar and rebuilt problem.
                        EJP
                        Look up the jarsigner tool in the Javadoc.