Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to recompile a .jar file?

Reply
Thread Tools

How to recompile a .jar file?

 
 
Adam Jiang
Guest
Posts: n/a
 
      01-29-2007
This is the situation.
I got a two .jar files, one of which contained the classes and another
one contained the source code related with certain class. When I put
them in an eclipse project, and add source code for the class-jar file
with source-jar file, I can view the code without modifying.
Is this source read-only?
How can I modify these code and then recompile this .jar file?

 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      01-29-2007
On Jan 29, 8:04 pm, "Adam Jiang" <(E-Mail Removed)> wrote:
> This is the situation.
> I got a two .jar files, one of which contained the classes and another
> one contained the source code related with certain class. When I put
> them in an eclipse project, and add source code for the class-jar file
> with source-jar file, I can view the code without modifying.
> Is this source read-only?
> How can I modify these code and then recompile this .jar file?


I imagine the IDE will *not* be able to edit the
source files while they are in an *archive*.

If you expand the archive out to 'loose files' on
the local file system, and check they do not
have the 'read only' attribute set (it is uncommon),
the IDE should be able to edit them.

You will probably need to reconfigure the project
to work with the new arrangement, but that is a
matter between you and your IDE.

Andrew T.

 
Reply With Quote
 
 
 
 
ceasaro
Guest
Posts: n/a
 
      01-29-2007


On Jan 29, 10:12 am, "Andrew Thompson" <(E-Mail Removed)> wrote:
> On Jan 29, 8:04 pm, "Adam Jiang" <(E-Mail Removed)> wrote:
>
> > This is the situation.
> > I got a two .jar files, one of which contained the classes and another
> > one contained the source code related with certain class. When I put
> > them in an eclipse project, and add source code for the class-jar file
> > with source-jar file, I can view the code without modifying.
> > Is this source read-only?
> > How can I modify these code and then recompile this .jar file?I imagine the IDE will *not* be able to edit the

> source files while they are in an *archive*.
>
> If you expand the archive out to 'loose files' on
> the local file system, and check they do not
> have the 'read only' attribute set (it is uncommon),
> the IDE should be able to edit them.

To expand them you can use any program which understand the zip format
cause a jar file is simply a zip archive.
>
> You will probably need to reconfigure the project
> to work with the new arrangement, but that is a
> matter between you and your IDE.
>
> Andrew T.


 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      01-30-2007
On Jan 30, 7:59 am, "ceasaro" <(E-Mail Removed)> wrote:
....
> To expand them you can use any program which understand the zip format
> cause a jar file is simply a zip archive.


But note that it is dangerous to *make* jar's using
'any old' zip tool. A lot of them have non-standard
compression, and the way they write the zip
archives is much less stringent than the format
used by the jar tool, and Java.

Andrew T.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Do I need to recompile if I make a small change Simon Harvey ASP .Net 1 02-13-2004 09:17 AM
Auto Recompile aspx when binaries change stuart Dee ASP .Net 1 01-19-2004 04:54 PM
to recompile VB code with .NET SDK vgv888 ASP .Net 3 08-22-2003 02:02 PM
why vs.net always recompile the projects that are compiled? Dai Hao ASP .Net 3 08-15-2003 05:36 AM



Advertisments