FileNotFoundException - Making my project it's own package

Let me start by saying i'm new to java. I'm working on a small little project that my mentor and I thought up to practice a wide varitey of skills that I have been learning and force me to learn some new ones. I have hit a road block and was wondering if someone could give a hand.

What the project does is loads a list of companys from a CSV file. For each line ( company) it load i searches another CSV file to find the corisponding locations for that company. Then for each location it load the departments for that location... and again it load the employees for that department.... Long story short i'm working with 4 CSV files.

I have this project working... But now i want to make the project it's own package. I have done this and created a JAR file with a manifest.txt. I have also made a compile.cmd and run.cmd. Everything is working fine except now I have NO IDEA how to tell my project where to find these CSV files that are located in the jar but NOT in the same directory as my classes

Devl/

CompTest/

bin/

com/

Jeremy/

.CLASSfiles are here

data/

.CSV files are here

src/

com/

Jeremy/

.JAVAfiles are here

Class path is set my the compile to the bin folder..

Any suggestions?

[1312 byte] By [Nexeha] at [2007-11-27 10:56:24]
# 1

> Let me start by saying i'm new to java. I'm working

> on a small little project that my mentor and I

> thought up to practice a wide varitey of skills that

> I have been learning and force me to learn some new

> ones. I have hit a road block and was wondering if

> someone could give a hand.

How about your mentor? It's his job.

> I have this project working... But now i want to make

> the project it's own package. I have done this and

> created a JAR file with a manifest.txt.

It's supposed to me manifest.mf

>I have also

> made a compile.cmd and run.cmd.

Do you really need the latter or whoud a Main-Class entry in the manifest suffice?

> Everything is working

> fine except now I have NO IDEA how to tell my project

> where to find these CSV files that are located in the

> jar but NOT in the same directory as my classes

ClassLoader.getResourceAsStream("/path_here/whatever.csv");

The directory structure you listed certainly has nothing to do with JAR contents...

CeciNEstPasUnProgrammeura at 2007-7-29 12:02:44 > top of Java-index,Java Essentials,Java Programming...
# 2

Thank you for your prompt response!

> How about your mentor? It's his job.

However it's not his only job. :)

> ClassLoader.getResourceAsStream("/path_here/whatever.csv");

Perfect, I have found the API for this.. I think this is the correct direction. Do you know of any websites that may offer more information on how this works?

Nexeha at 2007-7-29 12:02:44 > top of Java-index,Java Essentials,Java Programming...