Alon_T
Alon_T

Reputation: 1440

Open a file attached to eclipse project in java

I have an excel file attached/imported to my project. How can I open it to a File f using the path?

The following didn't work:

File f = new File("Category Coverage Active SKUS.xlsx");

Thanks

enter image description here

Upvotes: 0

Views: 42

Answers (2)

Mahdi khodabandelu
Mahdi khodabandelu

Reputation: 152

You must put your file in the resource folder.

Upvotes: 0

Naitsirc
Naitsirc

Reputation: 48

It seems that you put the file into your src/main/java folder. Try this:

File f = new File("src/main/java/Category Coverage Active SKUS.xlsx");

In eclipse, the root path is where the .project and the .classpath files are located.

Upvotes: 2

Related Questions