Order of VM parameters in Run/Test configurations

Is there a way to change the order of JVM parameters when running/testing code? Let me give an example:

The standard IntelliJ 11 runs things with:

$ java -Didea.launcher.port=7535 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 11.app/bin" -Dfile.encoding=UTF-8 -classpath

Now, I'd like IntelliJ to run something this way:

$ java -Didea.launcher.port=7535 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 11.app/bin" -Dfile.encoding=UTF-8 <INSERT_HERE> -classpath

In INSERT_HERE, I'd like to add '-jar x.jar'. This is to force the JVM to run with a specific modular classloader.

The problem I currently have is that if I set VM options, these are inserted at the beginning:
$ java <CURRENTLY_INSERTED_HERE> -Didea.launcher.port=7535 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 11.app/bin" -Dfile.encoding=UTF-8 -classpath

Is there a way to change the order of this?

The only (hacky) workaround I can think of right now is to set VM parameters to be these, but IntelliJ will still insert the -Didea options after the VM parameters:
"-Didea.launcher.port=7535 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 11.app/bin" -Dfile.encoding=UTF-8 <INSERT_HERE>"

Any idea?

1 comment
Comment actions Permalink

Btw, I've just spotted the "Run Another Configuration" stuff in IntelliJ 12, and I wonder if it would help here?
http://stackoverflow.com/questions/11044955/intellij-idea-run-batch-script-before-and-after-run-debug-configuration

It'd be great to change the stuff without the need to plug IntelliJ with another plug in to run with this order of VM parameters.

0

Please sign in to leave a comment.