
Signature
Knute Johnson
email s/nospam/knute/
On Nov 27, 10:59 pm, Knute Johnson <nos...@rabbitbrush.frazmtn.com>
wrote:
> > I am trying to use the SplashScreen feature in Java 6, and it works
> > when I use the -splash parameter passed to the JVM. However, when I
[quoted text clipped - 23 lines]
> Knute Johnson
> email s/nospam/knute/
Ah, yes.../lib is contained within the project JAR. Something like
this...
Project.jar
- compiled.code.packages.and.stuff
- lib
- Project_Resources.jar
There is a configuration file, as well as a C++ launcher to read that
configuration file outside of the Project.jar. The C++ launcher was
created so a splash screen could be shown, but now that Java does it,
I think I can get rid of the C++ launcher if I can figure out this
problem.
Lew - 28 Nov 2007 04:46 GMT
>>> MANIFEST file:
...
>>> Class-Path: lib/Project_Resources.jar
Knute Johnson wrote:
>> How can you have a Class-Path: of lib/Project_Resources.jar? Is lib in
>> the project jar? I don't think you can do that. Of course I could be
>> totally confused :-).
The manifest Class-Path entry refers to a JAR on the local (i.e., deployment)
platform, not within the JAR whose manifest this is. In other words, the
referenced JAR is external to the referencing JAR.
> Ah, yes.../lib is contained within the project JAR.
The manifest file's Class-Path entry does not refer to directories within the JAR.
<http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html>
> Note : The Class-Path header points to classes or JAR files on the local network,
> not JAR files within the JAR file or classes accessible over internet protocols.
[quoted text clipped - 3 lines]
> you cannot use the Class-Path header in MyJar.jar's manifest to load classes
> in MyUtils.jar into the class path.

Signature
Lew
Jason Cavett - 28 Nov 2007 13:38 GMT
> >>> MANIFEST file:
> ...
[quoted text clipped - 24 lines]
> --
> Lew
Wow. I can't believe I made that beginner mistake (already knew that
too - /lib/Project_Resources.jar exists outside my Project.jar).
Anyway, it seems like from Owen's response, there's no way for the
classloader to know about files in other JARs, so I have to put the
splashscreen image within my main JAR file.
Alright, thanks for the help everybody.
Owen Jacobson - 28 Nov 2007 04:49 GMT
> On Nov 27, 10:59 pm, Knute Johnson <nos...@rabbitbrush.frazmtn.com>
> wrote:
[quoted text clipped - 39 lines]
> I think I can get rid of the C++ launcher if I can figure out this
> problem.
The built-in classloaders in general can't look inside JARs that are
inside JARs. Your Class-Path attribute instead specifies
Project_Resources.jar in the directory lib in the same directory the
Project.jar is in, like so:
foo/
foo/Project.jar
foo/lib/
foo/lib/Project_Resources.jar
It's not terribly hard to write your own classloader that can look
inside a JAR for JARs, but it won't be availalble until after the
splashscreen-displaying code in the JRE has already run. You'll have
to restructure your packaging to use the built-in splash screen.
-O