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 7410229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:12:14+00:00 2026-05-29T06:12:14+00:00

I have written a Java program which I package and run from a JAR

  • 0

I have written a Java program which I package and run from a JAR file. I need to have some user-changeable configuration files which are simply text lines of:

key = value

format. To load these files I used the class described here. When I run my program through Netbeans IDE all works fine as I have included the directory where I store the configuration files in the Project properties.

The problem comes when I build my application into a JAR file. As I want the configuration files to be user-editable I keep them OUTSIDE of the JAR but in the same directory but now when I run my application from the command line it cannot find the configuration files. If I manually add the files to JAR file at the ROOT folder then all is well.

So how can I tell Java to look outside of the JAR for my loadable files? The -classpath option has no effect.

  • 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-29T06:12:15+00:00Added an answer on May 29, 2026 at 6:12 am

    I resolved it by referring to this question. I Added the current directory to the MANIFEST file of the jar and it works.

    Why is the -classpath option ignored in this case I wonder? Security?

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

Sidebar

Related Questions

I have written a program which reads input from csv file and its working
I've written a Java program which scrapes some content from a web page. It
I have a program which i have myself written in java, but I want
I have written a java applet which opens a JFrame (so when run in
I have written a small java application for which I need to obtain performance
I'm modifying a java program which was written in 2004 using javaw.exe from J2re1.4.2_03.
I have written a program in Java to read in a text file of
i have written a java program which currently runs as a desktop app, it
I have written a program in Java which creates a socket connection for a
I have written some piece of code for my program in Matlab 7.10.0 which

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.