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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:35:27+00:00 2026-05-13T12:35:27+00:00

Our project in eclipse approximately shows the following folders: application – src – JRE

  • 0

Our project in eclipse approximately shows the following folders:

application
    - src
    - JRE System Library [1.6]
    - Referenced Libraries
    - lib
    - rsc

In our project, we would like to use File > Export… > Executable JAR

Well that works fine, with some exception: If we want to run our application.jar, we still need to copy the folder rsc/ in the same location as application.jar.

In rsc/, we have other folders for separation of the different parts.
Basically, we load the pieces using the code (well a bit altered, but the path style is correct)

strUrl = "file:rsc/properties/Constants.properties";
url = new URL(strUrl);
ImageIcon icon = new ImageIcon(url);

I could rightclick on rsc/ > Build Path > Use as Source Folder.

But this doesn’t work either because eclipse doesn’t automatically copy the rsc folder into the bin/-folder. And then we cannot run it anymore from terminal (not packaged into jar)

EDIT: why is eclipse unable to handle this correctly? Why does it have problems with “nested” output folders? In the Source-tab of the Build Path dialog, I could easily add the rsc/-folder with the output folder set to bin/rsc/, but it doesn’t seem to be able to put nested folders…


EDIT 2: Now I’ve been able to create an xml-file to build the stuff with ant, and somehow managed to include the rsc-folder right into the jar. Still doesn’t run due to the same errors. Do I really need to check the resources paths whether they’re in a JAR or not? The JAR’s content is now the following:

META-INF/
META-INF/MANIFEST.MF
configurator/
controller/
editor/
gui/
logic/
networking/
rsc/
rsc/gamesettings/
rsc/levels/
rsc/pics/
rsc/properties/
util/

but Java still hates me and throws java.io.FileNotFoundException: rsc/properties/Constants.properties with a stacktrace of around 100 lines.


anybody an idea how to do it? thx & regards

  • 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-13T12:35:27+00:00Added an answer on May 13, 2026 at 12:35 pm

    If you mark rsc as a source folder Eclipse will copy its contents to the output directory. Or you could just move rsc under src if you want to group the resources in the output.

    Then you can use Class.getResource("/properties/Constants.properties") or Class.getResource("/rsc/properties/Constants.properties") and it will work regardless if your app is packaged as a jar or running from the source.

    As a sidenote, the file: protocol works only with normal files, to access files inside the jar you’d have to use something like new URL("jar:file:app.jar!/rsc/properties/Constants.properties").

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

Sidebar

Related Questions

Our project is an Eclipse RCP application using Hibernate as an ORM. I recently
We have the following scenario with our project: A core web application packaged as
Most of our Eclipse projects have multiple source folders, for example: src/main/java src/test/java When
Working under linux for our developement, I have an Eclipse Makefile C Project and
Our project constitutes of many modules (e.g. a HR management system containing modules like
There are few open source projects/APIs/libraries that we use in our project ( Spring,
I am using Eclipse 3.5 for several different Java/JSP projects. All of our project
I'm adding an eclipse project to our existing code-base, and I'd like to know
We currently have one dynamic web project (our main web application) already setup on
Our Project is using CVS and its is integrated from eclipse and so we

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.