Article View: borland.public.jbuilder.java.api
Article #99Re: java.exe -jar my.jar
From: Adrian P.
Date: Wed, 04 May 2005 14:47
Date: Wed, 04 May 2005 14:47
28 lines
1898 bytes
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..
Technical Details
Message-ID:
<4278e09e$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<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: Wed, 04 May 2005 17:47:52 +0300 From: "Adrian P." <adrian@idsys.ro> User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en 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=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 82.208.172.135 Message-ID: <4278e09e$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1115218078 82.208.172.135 (4 May 2005 07:47:58 -0700) Lines: 28 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail