L
laredotornado
Hi,
I'm using Java 6. Is it possible to include a JAR file within a JAR
file? Thanks, - Dave
I'm using Java 6. Is it possible to include a JAR file within a JAR
file? Thanks, - Dave
Hi,
I'm using Java 6. Is it possible to include a JAR file within a JAR
file? Thanks, - Dave
I'm using Java 6. Is it possible to include a JAR file within a JAR
file?
I'm using Java 6. Is it possible to include a JAR file within a JAR
file?
Not out of the box.
You can special classloaders that can do such magic, but the
practical solution is to place all the jar files in the file
system.
And actually it do have some advantages because it allow
to update one or more independently of the rest.
Why would you want to?
Actually, you can put a JAR file inside a JAR file, just like you can
put a ZIP file inside a ZIP file. It won't do you much good, but you can
do it.
Everyone assumes the OP wants to use the inner JAR file as a classpath
element, but he didn't actually say that. All he asked was if it's
possible to include a JAR file inside another, and of course that's a
big resounding "Yes".
I'm using Java 6. Is it possible to include a JAR file within a JAR
file? Thanks, - Dave
I assumed that he wanted to execute the code inside the jars
inside the jar.
Arne
Knute said:I did too.
Well, a JAR file is a file, so you can put it in a JAR file. On the
other hand, using a JAR file within another one is a bit of a different
matter....
Donkey said:However, some JEE containers extract all the contents of EAR or WAR
before use.
I don't know of any that don't.
Me neither.
But it would be doable. All that is needed is that the
server comes with a classloader capable of doing it. And
that JSP pages were compiled in memory not to disk.
But the app server vendors can probably not see any reason
to do so.
A big reason not to do so is that it would defeat the role of "deployer"
in their ability to tweak deployment descriptors and property files.
Lew said:I don't know of any that don't.
I'm using Java 6. Is it possible to include a JAR file within a JAR
file? Thanks, - Dave
I don't know of any that don't.
Donkey said:I remember having been with WebLogic, and we had to manually extract our
WAR in that. It supports extracted and unextracted WAR files, but you
have to manually extract if that is a requirement for the application.
That was WebLogic 8.1.
I use WebLogic 10.x and later and they don't do that. You can just
deploy an "unextracted" WAR. It creates a working (extracted) copy in
its temporary directories.
Are you absolutely certain 8.1 didn't do that?
Nope. It's just how I remember. We tried to access "some files in the
war" but could not in WebLogic, in Tomcat t worked. But when we deployed
as an extracted folder, it worked.
Dunno. I was a newbie with J2EE back then (that it is pretty much
different now, I'm a guru)
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.