Re: Strange problem with .jar and .class files
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