1

I would like to have intellij do the equivalent of:

java -cp "target/skinny.jar:target/lib/*" com.example.ClassName arg2 arg1

Please show how this can be accomplished in intellij idea.

Key Lay
  • 366
  • 3
  • 13
  • Have you checked https://stackoverflow.com/questions/16742085/adding-jar-files-to-intellijidea-classpath – Divs Mar 04 '20 at 04:43
  • @Divs that looks to be for compiling (javac). I need it to set the classpath for runtime (java). – Key Lay Mar 04 '20 at 21:25

1 Answers1

1

You can add a library for the directory/multiple directories/jars and then include this library into the module dependencies.

There is no option to provide custom classpath in the Run/Debug configuration at the moment, so it has to be done in the Project Structure.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • this looks to be correct, but I could not get it to work for me after trying every permutation of run, compile, test, and provide for the added library. – Key Lay Mar 07 '20 at 00:29
  • @KeyLay could you please zip and share via any file sharing service a small sample project to show the problem? – CrazyCoder Mar 07 '20 at 00:54