Determines if a JRE path points to a 32-bit VM. @param jrePath the JRE path @return true if 32-bit
(String jrePath)
| 83 | * @return true if 32-bit |
| 84 | */ |
| 85 | public boolean is32BitVM(String jrePath) { |
| 86 | if (jrePath == null) |
| 87 | return false; |
| 88 | if (OSPRuntime.isWindows()) { |
| 89 | // this will identify bundled 64bit jre |
| 90 | if (jrePath.contains("64")) |
| 91 | return false; |
| 92 | String x86 = System.getenv("ProgramFiles(x86)"); //$NON-NLS-1$ |
| 93 | if (x86 != null) { |
| 94 | return jrePath.contains(x86) ? true : false; |
| 95 | } |
| 96 | // must be 32-bit? |
| 97 | return true; |
| 98 | } |
| 99 | if (OSPRuntime.isMac()) { |
| 100 | // no OSX VMs can be run in 32-bit mode? |
| 101 | return false; |
| 102 | } |
| 103 | // on linux, assume all JREs have same bitness as current VM? |
| 104 | return OSPRuntime.getVMBitness() == 32; |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * Returns all public and private JREs of a given bitness (32 or 64). |
no test coverage detected