In IntelliJ, I have setup a runtime configuration for a Java (console) application. I need to add the directory c:/tmp
to the classpath that the app is run with. I guess I need to add -cp c:/tmp
to one of the boxes in this dialog, but I can't figure out which one:
Asked
Active
Viewed 8,879 times
3

Dónal
- 185,044
- 174
- 569
- 824
-
What you are trying to do? Is the tmp dir a classpath specific to only this run config? Otherwise, you already specifying a classpath, using the field "Use classpath of this module", and you have to change the classpath in the module configuration – Andrea Parodi Jun 15 '12 at 15:01
-
The tmp dir should only be added to the classpath for this run config – Dónal Jun 15 '12 at 15:02
-
The VM parameter field let you put the options for the VM, including the classpath, but I think (not sure) you also have to disable the "use classpath and jdk..." or at least check which one take precedence – Andrea Parodi Jun 15 '12 at 15:06
2 Answers
0
The classpath is a VM parameter, so it should belong in there. However, I'm unsure whether you can overwrite the classpath at all using this technique...
If you want to specify the classpath for adding additional jars, you should use libraries instead.
Also, are you sure you want to change the classpath and not the working folder? (The classpath determines where to find classes, the working folder defines the starting directory of your application.)

DieterDP
- 4,039
- 2
- 29
- 38