Get the boot path including the lib/rt.jar if possible.
()
| 646 | Get the boot path including the lib/rt.jar if possible. |
| 647 | */ |
| 648 | public static BshClassPath getBootClassPath() |
| 649 | throws ClassPathException |
| 650 | { |
| 651 | if ( bootClassPath == null ) |
| 652 | { |
| 653 | try |
| 654 | { |
| 655 | //String rtjar = System.getProperty("java.home")+"/lib/rt.jar"; |
| 656 | String rtjar = getRTJarPath(); |
| 657 | if (rtjar == null) { |
| 658 | bootClassPath = new BshClassPath("empty class path"); |
| 659 | } else { |
| 660 | URL url = new File(rtjar).toURI().toURL(); |
| 661 | bootClassPath = new BshClassPath("Boot Class Path", new URL[]{url}); |
| 662 | } |
| 663 | } catch ( MalformedURLException e ) { |
| 664 | throw new ClassPathException(" can't find boot jar: "+e); |
| 665 | } |
| 666 | } |
| 667 | return bootClassPath; |
| 668 | } |
| 669 | |
| 670 | |
| 671 | private static String getRTJarPath() |
no test coverage detected