tm1701
tm1701

Reputation: 7581

Intelli-J (Java) runs in parent folder. So it printing the current folder gives the parent of the project folder

After migrating to JDK17 and JUnit 5 I did first some cleaning. This works works OK also for other projects.

When I execute a simple test in Intelli-J (Java), I see that the test is run in the parent folder as base folder.

So, when I do a simple printCurrentFolder() ... then it prints the parent folder of the project folder.

How can I correct that? Anything changed?

I tried many things like:

When running the JUnit test, I can see this run configuration:

enter image description here

Upvotes: 0

Views: 56

Answers (1)

CrazyCoder
CrazyCoder

Reputation: 401965

Set $MODULE_WORKING_DIR$ as the Working directory for your JUnit run configurations. You can make it the default as described here.

Upvotes: 1

Related Questions