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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:57:42+00:00 2026-06-15T16:57:42+00:00

I have a project in java, in which I read in some csv-data. I

  • 0

I have a project in java, in which I read in some csv-data. I have to type in the specific path. Now I would like to send this project to someone else, but he should not have to change the path information. He should be able to run the project, without changing anything in the code.

I have already put the csv-data into my source-file but I get an exception, when trying to use this path.

BufferedReader in = new BufferedReader(new FileReader("text.csv"));

Exception while reading csv file: java.io.FileNotFoundException: text.csv (No such file or directory)

I am using as IDE eclipse.

  • 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-06-15T16:57:43+00:00Added an answer on June 15, 2026 at 4:57 pm

    Put the file in root of your Java source folder and then make sure that its getting complied to your classes or bin or target folder(where all your compiled classes are going). Once done, then change your code as below:

       InputStream inputStream = 
                      getClass().getClassLoader().getResourceAsStream("text.csv");
       BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream ));
    

    When you package your project for distribution, make sure your text.csv is packaged in the same folder i.e. root of classes folders.

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

Sidebar

Related Questions

I have a java project in which I have Referenced Libraries. In the Referenced
For my Java project which uses Maven I have added Twitters Bootstrap lately to
i have a java ee project which has a text file that uses a
I have a maven Java project (Project A) which depends on a second project
I have a simple java project (adapted from the example here ), which is
In my project, I have a wrapper class named PlayerCluster.java , which loads the
I'm trying to restructure some specific GUI code in a Java project, let's call
I have a situation in which my Java project contains resources from a different
I have a java project that uses java.io.RandomAccessFile to manage data loading. It seeks
I have big project in Matlab with some pretty complicated GUI. I'd like to

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.