[nomaster] SI-6026 backport getResource bug fix

Submitted to master under SI-4936, this fix allows :javap
to work when tools.jar is discovered by REPL.