Path setting for JBuilder project

Dear,

The program is loading the text file from the following path in jbuilder project,

String repository = "file:/D:/JBuilderProject/classes/datasets/prediction.txt";

URL metaFileURL = new URL(repository);

// Attempt to open an input stream attached to the file.

InputStream inputStream = metaFileURL.openStream();

However, when I make an executable file and try to run this program in different computer, then the program is not loading this file (prediction.txt).

Is there any method to load this file directly from jbuilder project such as:

String repository = "classes/datasets/prediction.txt";

URL metaFileURL = new URL(repository);

// Attempt to open an input stream attached to the file.

InputStream inputStream = metaFileURL.openStream();

[822 byte] By [Rashid_Khokhara] at [2007-10-2 10:46:03]
# 1

I'm not sure , but I think you should see the settings while you make the Exe file. I remember something similr happened to my collegue oneday. well, I don't think sth is wrong in your code. You have to change something that makes it depends on your PC in the JBuilder making exe settings

tell me if it works out well

RidwanHabbala at 2007-7-13 2:58:40 > top of Java-index,Java Essentials,New To Java...
# 2

Dear Ridwan,

Actually, the problem is not with JBuilder. When I make exe file the jbuilder store this path:

"file:/D:/JBuilderProject/classes/datasets/prediction.txt"

But when we run this exe in other computer, definitely jbuilder exe file is still searching this path. However, there is no such path in other computer. I looking for any method that we can give the path from juilder project not from root such as

"classes/datasets/prediction.txt"

Rashid.

Rashid_Khokhara at 2007-7-13 2:58:40 > top of Java-index,Java Essentials,New To Java...
# 3
You're hardcoding a path and then expecting the application to know where the file is when it's not in that exact location?
jwentinga at 2007-7-13 2:58:40 > top of Java-index,Java Essentials,New To Java...