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
  • 31,405
  • 40
  • 123
  • 242

1 Answers1

2

For finding paths..

String path = java.lang.System.getProperty("java.class.path");
Sumit Singh
  • 15,743
  • 6
  • 59
  • 89