Image

Imagestipe wrote in Imagejava_dev 🤔curious

Log4j Question

I've just finished the first version of a project I've been working on and would like to be able to bundle it up to try out a simple distribution. I've zipped it up in a jar file and have specified the "Default Class" property in the manifest so that you should be able to simply type "java -jar domain.jar" to run the program.

I've used Log4j in the development of the program, so it needs to be present for the program to run. I don't expect most people who try to use this (it's a game) will have Log4j installed, so I'd like to include it in my jarfile and list it in the classpath in the manifest so that everything gets found automagically.

I was fairly certain you could include jar files within jar files, but I can't figure out how to reference the nested jars in the classpath. When I try just adding "log4j-1.2.8.jar" to the classpath, it looks for it in the same directory as my main jar file. "domain/log4j-1.2.8.jar" and "domain.jar/log4j-1.2.8.jar" don't seem to work either.

Any ideas?