I am fresh about intellij idea. I just import several projects from eclipse
, and it's modules in intellij idea.
I run one main in one module and get file can not found
exception. I check the user.dir
parameter and find it direct to another module(that module is the first module when I import eclipse projects).
System.out.println(System.getProperty("user.dir"));
I just want set the user.dir to that module directory when I run the main in one module. How to set it?
Create a Run/Debug configuration
for your Main class (the easiest way is to right-click on it and choose Save 'MyClass.main()').
Now, find your configuration (named after your class) on the main toolbar dropdown and choose Edit Configurations
For VM options
, put -Duser.dir=whatever
Alternatively, setting Working directory
might be able to help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With