I'm currently in the most unfortunate situation of having to develop under Windows. The program I'm writing depends on two dll files. The first is a library of native functions. This dll acts as a wrapper around a second dll which is the actual C functions that the program is calling.
The problem is that there are several versions of both dll files, and I frequently have to switch between them. To do this I can use a bat file to execute the java application I'm writing, but then I can't debug it except by using a remote debugger. The latter is problematic as the program executes and quits fairly quickly.
-Djava.library.path only affects from where the first dll is loaded. This first dll then makes the second dll load, and where to load this second dll from is determined by the PATH environment variable. I need to be able to set this PATH variable on a per-debug-configuration basis. It would be neat if you had a field in the Run configuration dialog that would let you either execute a bat file before starting the java app, or set environment variables directly for each configuration.
I have tried to set the PATH variable from inside the application, but without success, the Java classloader seems to use the PATH as it was when the jvm started. A second option is to start IDEA with a bat file and set the PATH there, but that just forces me to reload IDEA every time I need to change library, and as I work on multiple projects simultaneously that is not a very good option.
I'm guessing this can't be very hard to add as the IDEA runner seems to execute in what is basically just a subshell.
I would also appreciate ideas for a temporary fix.