Unable to execute java file which uses log4j through jar file where as the same file getting executed via eclipse.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Friday, October 31, 2008 07:37 AM

Tried executing java files which uses log4j in eclipse. It goes smoothly where as tried jarring the java classes and ran the jar which throws exception saying unable to find the logger class. But the log4j jars and xml files are in the classpath.I am unable to figure out where am making a mistake. Tried in n number of ways to tackle it but could not resolve my issue.
Would be thankful if someone answers my question.

Re: Unable to execute java file which uses log4j through jar file where as the same file getting executed via eclipse.

Posted By:   Robert_Lybarger  
Posted On:   Monday, November 3, 2008 08:54 AM

If you made an executable jar and are using "java -jar foo.jar" then did you put the classpath entries into the jar file's manifest? (Executable jars only look there for the classpath information.) If however you are just doing "java -cp foo.jar;bar.jar package.Class" then your classpath is simply not setup properly. In just about any case when you ask online, *paste the exact error message* to the forum too. Otherwise we're just guessing, and I don't have a lot of time to waste guessing.
About | Sitemap | Contact