Local path doesn't work

Answered

Hi guys, i got a problem using local paths.

On Eclipse this line

File f = new File("sav/file.sav");

save the file in the directory sav inside MyProject. So i have MyProject/sav/file.sav

Intellij instead creates two directories MyProject:

the first contains 3 other directories: out, .idea and MyProject.

So i have MyProject/MyProject/sav/file.sav

So my code works only if i do:

File f = new File("MyProject/sav/file.sav");

 

How can i solve this?

Thank you in advance

0
2 comments

Change the working directory in the Run/Debug configuration to the correct root or import the project so that the second MyProject is not created.

0
Avatar
Permanently deleted user

Thank you a lot!! Change the working directory worked perfectly!

0

Please sign in to leave a comment.