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

  • SEARCH
  • Home
  • 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 5951673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:34:16+00:00 2026-05-22T17:34:16+00:00

I am trying to configure the classpath of a JAR so that my ResourceBundle

  • 0

I am trying to configure the classpath of a JAR so that my ResourceBundle can pick up property files from it.

If I run it from the .class files and specify the -cp flag it works fine, and System.err.println(System.getProperty("java.class.path")); will print the path specified in the -cp flag.

If I try and create a jar file for it, System.err.println(System.getProperty("java.class.path")); always prints the path of the jar file, and the property files aren’t picked up.

It seems if you are running it as a jar file you can’t specify the -cp flag (which was what I was hoping, as it’s common to switch which property files are being used). I’ve tried specifying it in the jar manifest instead, but it’s still not working.

Here is the code and manifest from a test jar that doesn’t seem to work:

public final class Test {
    public static void main(final String[] args) {
        System.err.println(System.getProperty("java.class.path"));
    }
}

 

Manifest-Version: 1.0
Created-By: 1.6.0_20 (Sun Microsystems Inc.)
Main-Class: Test
Class-Path: /home/ajanuary/Projects/test/

edit
The original path was rather meaningless so I changed it. I want to point to a directory which the ResourceBundle can find the property files in.

  • 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-22T17:34:17+00:00Added an answer on May 22, 2026 at 5:34 pm

    The problem was that I also had an index file. If you have an index file, the Class-Path will be ignored.

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

Sidebar

Related Questions

I am trying to configure my xmonad.hs so that when I start my session
I am trying to configure the CLIENTS table on my database such that if
I am trying to configure the Ethernet interfaces in an Arista Switch that is
In my Websphere Portal environment, I'm trying to configure a bean that uses a
I'm trying to configure build.xml files for build forge, but it seems like I
Trying to configure Jenkins CI. Currently just running it from the .war (eventual intention
Trying to configure apache2 to load example.com/forum/ from a different document root, relative to
I am trying to configure returned data from $.ajax() by jQuery... My example is
I'm trying to configure Netbeans for automatically upload PHP files to an SFTP server
I am trying to configure Velocity to read the template file from the filesystem

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.