0

In Java, how do you find the path to the jar of the currently running program, and to the rt.jar now in use by the currently running program?

(The context is a compiler targeting the JVM, which needs to look at these jars in order to resolve import statements, class references etc.)

rwallace
  • 28,614
  • 33
  • 112
  • 214

1 Answers1

2

For finding paths..

String path = java.lang.System.getProperty("java.class.path");
Sumit Singh
  • 24,095
  • 8
  • 74
  • 100