Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3334268
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:53:10+00:00 2026-05-17T23:53:10+00:00

I have an application contained in A.JAR. This jar has several dependencies so they

  • 0

I have an application contained in A.JAR. This jar has several dependencies so they are specified in the manifest as “lib/B.JAR lib/C.JAR lib/D.JAR”. I have my installation directory with A.JAR, and under it I have the lib directory with the three others.

I go to my installation directory and run “java -jar A.JAR” to run the application, and it starts running. However, it looks for log4j.properties for setting up log4j. Now as far as I know, log4j.properties needs to be in the classpath.

Now let’s suppose I want to run several instances of A.JAR, but with various log4j properties. So I setup 4 installation directories (inst1, inst2,…) and I’ve put A.JAR, a customized log4j.properties and the lib directory in each of them.

  1. Is this the right way to go (forget about the copying itself, I can do this with symlinks)? Maybe there’s a way for telling log4j to look for the properties in a specific place using some define (-D) in runtime?
  2. If what I’ve described is a good setup, how can I actually run it? Java doesn’t “catch” the log4j.properties as part of its classpath. running “java -classpath . -jar A.JAR” wasn’t helpful as well.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:53:11+00:00Added an answer on May 17, 2026 at 11:53 pm

    You can use the log4j.configuration system property to define the properties files you want log4j to use.

    A simple example for a file in some directory would be:

    java -Dlog4j.configuration=file:/c:/foobar.properties YOUR CLASS PATH -jar JAR FILE
    

    For more information check the documentation. Especially check the Default Initialization Procedure section.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Flex application where I'm using a Canvas to contain several other
has anybody tried using a custom classloader with BlazeDS? We have a web application
This is a biggie. I have a well-structured yet monolithic code base that has
an application I have written uses several third party jars. Sometimes only a small
I have a basic executable JAR with manifest.txt containg the MainClass and some other
Let's say I have a container (std::vector) of pointers used by a multi-threaded application.
We have a windows application that contains an ActiveX WebBrowser control. As part of
I have a console application that contains quite a lot of threads. There are
I have a web application (.war) that contains some static files (e.g. MS word
We currently have a quite complex business application that contains a huge lot of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.