🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.api
5 messages
5 total messages Started by Petar Popara Tue, 03 May 2005 09:48
java.exe -jar my.jar
#94
Author: Petar Popara
Date: Tue, 03 May 2005 09:48
18 lines
1602 bytes
    I have compressed my project and all dependency jars in my.jar archive. 
If I run it like this from CMD line:

java.exe -jar my.jar

    then an error occur saying that it can't find log4j's Logger class:

Exception in thread "main" java.lang.NoClassDefFoundError: 
org/apache/log4j/Logger

    I have included log4j package in my.jar, but the problem is that I don't 
know how to specify where it is inside my.jar. I think -classpath param is 
only for files on my disk (file system) and not inside my jar archive 
(my.jar). I've tried this, but still the same error:

java.exe -classpath "lib/log4j-1.2.8.jar;lib/...other jars here..." -jar 
my.jar 
Re: java.exe -jar my.jar
#95
Author: Arthur Ore
Date: Tue, 03 May 2005 19:18
30 lines
2083 bytes
I seem to recall, a few years ago when I tried to manually generate a 
manifest for a jar file that I got the same error.
See http://java.sun.com/docs/books/tutorial/jar/manifest/appman.html
and note :- Warning: The text file must end with a new line or carriage 
return.

If my memory is correct, this is what caused the problem for me.

Arth
"Petar Popara" <none> wrote in message 
news:427748b8@newsgroups.borland.com...
>
>    I have compressed my project and all dependency jars in my.jar archive. 
> If I run it like this from CMD line:
>
> java.exe -jar my.jar
>
>    then an error occur saying that it can't find log4j's Logger class:
>
> Exception in thread "main" java.lang.NoClassDefFoundError: 
> org/apache/log4j/Logger
>
>    I have included log4j package in my.jar, but the problem is that I 
> don't know how to specify where it is inside my.jar. I think -classpath 
> param is only for files on my disk (file system) and not inside my jar 
> archive (my.jar). I've tried this, but still the same error:
>
> java.exe -classpath "lib/log4j-1.2.8.jar;lib/...other jars here..." -jar 
> my.jar
> 
Re: java.exe -jar my.jar
#96
Author: Alexey N. Solofnenko
Date: Tue, 03 May 2005 19:48
27 lines
2017 bytes
Java cannot open jar files from inside of other jars. You have two 
options - unjar log4j.jar and put its files into your jar (with your 
manifest) or add Class-Path property into your jar file manifest and 
ship two jar files.

- Alexey.

Petar Popara wrote:
>     I have compressed my project and all dependency jars in my.jar archive. 
> If I run it like this from CMD line:
> 
> java.exe -jar my.jar
> 
>     then an error occur saying that it can't find log4j's Logger class:
> 
> Exception in thread "main" java.lang.NoClassDefFoundError: 
> org/apache/log4j/Logger
> 
>     I have included log4j package in my.jar, but the problem is that I don't 
> know how to specify where it is inside my.jar. I think -classpath param is 
> only for files on my disk (file system) and not inside my jar archive 
> (my.jar). I've tried this, but still the same error:
> 
> java.exe -classpath "lib/log4j-1.2.8.jar;lib/...other jars here..." -jar 
> my.jar 
> 
> 
Re: java.exe -jar my.jar
#99
Author: Adrian P.
Date: Wed, 04 May 2005 14:47
28 lines
1898 bytes
Petar Popara wrote:

>    I have compressed my project and all dependency jars in my.jar archive. 
>If I run it like this from CMD line:
>
>java.exe -jar my.jar
>
>    then an error occur saying that it can't find log4j's Logger class:
>
>Exception in thread "main" java.lang.NoClassDefFoundError: 
>org/apache/log4j/Logger
>
>    I have included log4j package in my.jar, but the problem is that I don't 
>know how to specify where it is inside my.jar. I think -classpath param is 
>only for files on my disk (file system) and not inside my jar archive 
>(my.jar). I've tried this, but still the same error:
>
>java.exe -classpath "lib/log4j-1.2.8.jar;lib/...other jars here..." -jar 
>my.jar 
>
>
>  
>

I have something like your application and java CAN use a jar library 
from inside your application jar. I'm using JBuilder Archive builder. 
I've selected the Include All Dependencies option in Archive Builder. 
Try this way..
Re: java.exe -jar my.jar
#100
Author: Petar Popara
Date: Thu, 05 May 2005 12:39
6 lines
1276 bytes
> I have something like your application and java CAN use a jar library
> from inside your application jar. I'm using JBuilder Archive builder. I've 
> selected the Include All Dependencies option in Archive Builder. Try this 
> way..
Yes, but I can't use it, because some .jars are signed. :( 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads