Results 1 to 5 of 5
Thread: Jar utility and log4j
- 11-01-2013, 07:52 PM #1
Member
- Join Date
- Sep 2012
- Posts
- 5
- Rep Power
- 0
Jar utility and log4j
Hi, everyone.
I'm new to java and I have this utility java project in Netbeans to which I want to add log4j. The log4j jar is not getting packed inside the utility when this one gets built. Either way I wouln't know where to put it.
AJava Code:NoClassDefFoundError: org/apache/log4j/Logger
I run the utlity with classic java -jar.
Any help would appreciated.
Thank you.Last edited by alexandros; 11-01-2013 at 07:54 PM.
- 11-01-2013, 08:01 PM #2
Re: Jar utility and log4j
The log4j jar needs to be on the classpath when the program is executed. One way is to use the manifest file's Class-Path: entry with the log4j jar.
If you don't understand my response, don't ignore it, ask a question.
- 11-01-2013, 08:06 PM #3
Member
- Join Date
- Sep 2012
- Posts
- 5
- Rep Power
- 0
Re: Jar utility and log4j
Hi, thank you for your response.
My MANIFEST.MF says:
Java Code:Manifest-Version: 1.0 Ant-Version: Apache Ant 1.7.1 Created-By: 1.6.0_01-b06 (Sun Microsystems Inc.) Main-Class: dc.decisor3Batch.util.BatchCopier Class-Path: . lib/log4j-1.2.16.jar X-COMMENT: Main-Class will be added automatically by build
lib folder has the log4j jar
- 11-01-2013, 08:27 PM #4
Re: Jar utility and log4j
When you execute the command: java -jar THEJARFILE.jar
does the folder that holds the file: THEJARFILE.jar contain the lib folder that contains the log4j-1.2.16.jar file?
See: http://docs.oracle.com/javase/tutori...r/downman.htmlLast edited by Norm; 11-01-2013 at 08:33 PM.
If you don't understand my response, don't ignore it, ask a question.
- 11-01-2013, 09:11 PM #5
Member
- Join Date
- Sep 2012
- Posts
- 5
- Rep Power
- 0
Similar Threads
-
log4j not finding log4j.xml "there-aint-no-such-file"
By peri in forum Advanced JavaReplies: 2Last Post: 04-02-2013, 02:04 PM -
Difference between jar file created with the jar utility and the zip utility
By JunkerMartin in forum New To JavaReplies: 6Last Post: 02-04-2013, 12:14 PM -
Synchronization utility to manage locks
By JSL5101 in forum Advanced JavaReplies: 1Last Post: 05-07-2011, 06:43 PM -
Problem on Log4j: How to include custom <filter/> into JBoss (log4j.xml)?
By holyjohn in forum Advanced JavaReplies: 1Last Post: 09-20-2010, 09:32 AM -
XML compare utility
By JMayura in forum Advanced JavaReplies: 0Last Post: 06-08-2010, 02:05 PM
Bookmarks