Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #11275

Re: Strange problem with .jar and .class files

From Lew <noone@lewscanon.com>
Newsgroups comp.lang.java.programmer
Subject Re: Strange problem with .jar and .class files
Date 2012-01-12 08:14 -0800
Organization albasani.net
Message-ID <jen0tr$5f1$1@news.albasani.net> (permalink)
References <86312e3c-b1cd-47d6-819f-5337ac665d00@t13g2000yqg.googlegroups.com> <jemu3c$tdf$1@dont-email.me>

Show all headers | View raw


Jeff Higgins wrote:
> Eric Tonissen wrote:
>> I have a Java program normal running. I needed some .class files from
>> another project, builded an .jar file from it, added this to the
>> classpath and it works.
>>
>> But now we decided not to use the .class files anymore but to make a
>> copy from the corresponding sources to my own project.

Why?  Why?

>> So I did. But now I have a lot of compile errors about sources which
>> it also needs ?

And there's the "why not".

> The third party project you are attempting to build has dependencies which the
> compiler cannot resolve is the way I read this so far.
>
>> I unzipped all the .jars files on the class path, but they are also
>> not in here.
>
> You are not able as yet to find the required dependencies.

And you are not following a good strategy.

>> Is it possible that the compiler includes information into the .class
>> files, so it doesn't need the other .class files anymore?
>
> No, if I understand the question to be "has the third party packager's build
> or packaging process hidden the required dependencies in some other class file".
>
> You must find the required dependencies and add them to your build and
> packaging process.

But basically unpacking from a JAR and repacking into a different one is not a 
good practice.  It defeats the whole point of JARs, and as the OP has found, 
opens a world of hurt trying to recapitulate everything that went into the JAR 
build.  And if the JAR is third party, you really have to watch out for 
intellectual property rights.  OP, why in the frak are you going down such an 
unproductive path?

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Strange problem with .jar and .class files Eric Tonissen <EricTonissen@zonnet.nl> - 2012-01-12 03:40 -0800
  Re: Strange problem with .jar and .class files Jeff Higgins <jeff@invalid.invalid> - 2012-01-12 10:33 -0500
    Re: Strange problem with .jar and .class files Lew <noone@lewscanon.com> - 2012-01-12 08:14 -0800
      Re: Strange problem with .jar and .class files Jeff Higgins <jeff@invalid.invalid> - 2012-01-12 12:34 -0500
        Re: Strange problem with .jar and .class files Lew <lewbloch@gmail.com> - 2012-01-12 13:42 -0800
          Re: Strange problem with .jar and .class files Jeff Higgins <jeff@invalid.invalid> - 2012-01-12 19:38 -0500
            Re: Strange problem with .jar and .class files Lew <noone@lewscanon.com> - 2012-01-12 21:05 -0800
              Re: Strange problem with .jar and .class files Jeff Higgins <jeff@invalid.invalid> - 2012-01-13 03:41 -0500
                Re: Strange problem with .jar and .class files Jeff Higgins <jeff@invalid.invalid> - 2012-01-13 04:08 -0500
                Re: Strange problem with .jar and .class files Lew <noone@lewscanon.com> - 2012-01-13 07:40 -0800
                Re: Strange problem with .jar and .class files Jeff Higgins <jeff@invalid.invalid> - 2012-01-13 12:55 -0500
                Re: Strange problem with .jar and .class files Lew <lewbloch@gmail.com> - 2012-01-13 15:34 -0800
                Re: Strange problem with .jar and .class files Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-01-13 21:45 -0400
  Re: Strange problem with .jar and .class files Roedy Green <see_website@mindprod.com.invalid> - 2012-01-12 09:40 -0800
  Re: Strange problem with .jar and .class files Eric Tonissen <EricTonissen@zonnet.nl> - 2012-01-13 02:24 -0800
    Re: Strange problem with .jar and .class files Lew <noone@lewscanon.com> - 2012-01-13 07:42 -0800
      Re: Strange problem with .jar and .class files Jeff Higgins <jeff@invalid.invalid> - 2012-01-13 13:18 -0500
        Re: Strange problem with .jar and .class files Lew <lewbloch@gmail.com> - 2012-01-13 15:40 -0800

csiph-web