Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Jar problem

2 views
Skip to first unread message

Daniel

unread,
Mar 1, 2005, 11:19:53 AM3/1/05
to
Hi all!
I'm using JBuilder X to help me make executable jars. Anyway I've now
decided to include help pages in javahelp format. So far so good. As I
would like to have just one jarfile I thought I'd configure JBuilder
to include "all dependecies" from the javahelp lib. And sure it puts
all the files there, BUT the file is not executable! Or actually it
is, but I get a security exception. If I reduce the include filter to
"used classes and known resources" the file is executable but I can
not view any help pages. Can someone help me here? What am I missing?

the exception I get is:

Exception in thread "main" java.lang.SecurityException: invalid SHA1
signature file digest for javax/help/
at
sun.security.util.SignatureFileVerifier.verifySection(SignatureFileVerifier.java:321)
at
sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:172)
at
java.util.jar.JarVerifier.processEntry(JarVerifier.java:239)
at java.util.jar.JarVerifier.update(JarVerifier.java:194)
at java.util.jar.JarFile.initializeVerifier(JarFile.java:300)
at java.util.jar.JarFile.getInputStream(JarFile.java:362)
at
sun.misc.URLClassPath$5.getInputStream(URLClassPath.java:616)
at sun.misc.Resource.getBytes(Resource.java:57)
at
java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)

regards
Daniel

SPG

unread,
Mar 1, 2005, 4:35:13 PM3/1/05
to

"Daniel" <daik.n...@mds.nospam.mdh.se> wrote in message
news:c95921t2n7g888ci2...@4ax.com...

Hi Daniel,

Some external jar files are built so that you cannot include them inside
another jar file.
I would suggest that you do not import the contents of the help jar into
your jar, but simply distribute the jar with your package and add it to the
classpath when you run the app..

Steve


Daniel

unread,
Mar 2, 2005, 3:29:49 AM3/2/05
to
On Tue, 01 Mar 2005 21:35:13 GMT, "SPG"
<steve.g...@nopoo.blueyonder.co.uk> wrote:

>Hi Daniel,
>
>Some external jar files are built so that you cannot include them inside
>another jar file.
>I would suggest that you do not import the contents of the help jar into
>your jar, but simply distribute the jar with your package and add it to the
>classpath when you run the app..

okay, that sounds okay to me. So I distribute it in the form of two
jars. When I try this it refuses to find any javax.help classes.
I added this to the mainmethod before any object creation to help
solve this problem:
System.setProperty("java.class.path",System.getProperty("user.dir")+"\\jh.jar;"+System.getProperty("java.class.path"));

but it doesn't help. So how do I specify that the classpath includes
the "external" jar?
I have tried to put ".;./jh.jar" in the manifiest file but it doesn't
help either..

In an ideal world I wouldn't have to ask the user to do anything, but
run the program, no setup or anything, is that not possible?

/daniel

SPG

unread,
Mar 2, 2005, 6:32:45 AM3/2/05
to

"Daniel" <daik.n...@mds.nospam.mdh.se> wrote in message
news:p3ua21pn9j2mgb0ri...@4ax.com...

Daniel,

I think you need to add this to your manifest..

Class-Path: <your relative path here>/jh.jar


It may be that this jh.jar also has other external deps though.

Steve


Daniel

unread,
Mar 2, 2005, 7:51:22 AM3/2/05
to

I have tried that. I tried with ./ (since it is in the same dir as the
executable jar) but it doesn't work.

>It may be that this jh.jar also has other external deps though.

possible, but from the documentation it says it contains all I need.
also I made a .bat file that contains the classpath and the jh.jar and
does not run a jar-file but my mainclass directly, and it works.

so it seems that it is some problem with the relative path.
I'm not entireley sure how this works.
in the manifiest . means the jarfile itself. so how do I reference a
different file in the same dir as the jar-file?
I just tried with ../jh.jar thinking that maybe that would reference
the dir just ourside the jar, but it did not work either.
I'm quite at loss here.

/daniel

0 new messages