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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:23:20+00:00 2026-05-25T03:23:20+00:00

I know that there are other questions out there targeting the same issue but

  • 0

I know that there are other questions out there targeting the same issue but the thing is that the solutions don’t work for me.
I have a little tool that is supposed to read files I want to have and package as resources and relies on other projects (I am using Eclipse Helios) which I’d love to have as jars instead of single classes.

As an application within Eclipse I can access my resources via

String path = MyClass.class.getClassLoader().getResource("resources/" + name + ".SOURCE").getPath();
System.out.println(path);
File file = new File(MyClass.class.getClassLoader().getResource("resources/" + name + ".SOURCE").toURI());
defaultSource = readSOURCEFile(file);

if and only if I place the resources folder under the output path (the compiled sources) NOT if I place it in my src folder.

When I package the project, resources in the root folder or in the classes folder are not packaged at all. If I have the resources in my src folder it get’s packaged under src/resources.

I use Export – Runnable Jar, what am I doing wrong?
If I try with Export – Jar, I can package my sources and resources properly but I have issues with setting the main class and can’t execute the jar. The Manifest is correct and the class is there :-(.

Second problem: In the packaged jar I get the error: URI is not hierarchical (after I moved the resources within the jar manually I could execute the jar)

Thanks in advance!

I have linked the sources into the workspace is that an issue?

  • 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-25T03:23:21+00:00Added an answer on May 25, 2026 at 3:23 am

    Mark the resource folder under your project’s root folder as a “Source Folder” in Eclipse (right click on the folder, go to “Build Path” > “Use as source folder”). Then read the resources like this:

    InputStream is = MyClass.class.getClassLoader().getResourceAsStream(name + ".SOURCE");
    BufferedReader reader = new BufferedReader(new InputStreamReader(is));
    String line = reader.readLine();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that there are other questions that deal with this error, but those
I know there are many other questions out there, but I can't seem to
Does anyone know there have any other way that (by not using json_encode and
I know that there are lots of examples out there on this, but they
I know that there are many Delphi database related questions available, but I'm considering
I know that there are a quite a few questions on this out there
I know there are other questions covering this topic, but none seem to fit
I know that there are lots of questions on SO very like this but
I know there maybe similar questions out there, but I still cannot find the
I know there have been a few other people asking this question, but my

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.