🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #96

Re: java.exe -jar my.jar

#96
From: 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 
> 
> 
Technical Details
Message-ID: <4277d5a7$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!pd7cy2so!shaw.ca!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <427748b8@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1089d0,16a3ebffbd1a4075
X-Google-Attributes: gid1089d0,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Tue, 03 May 2005 12:48:56 -0700
From: "Alexey N. Solofnenko" <trelony@mail.ru>
User-Agent: Mozilla Thunderbird 1.0+ (Windows/20050502)
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.api
Subject: Re: java.exe -jar my.jar
References: <427748b8@newsgroups.borland.com>
In-Reply-To: <427748b8@newsgroups.borland.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 208.200.221.5
Message-ID: <4277d5a7$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1115149735 208.200.221.5 (3 May 2005 12:48:55 -0700)
Lines: 27
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!pd7cy2so!shaw.ca!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail