MCPcopy Index your code
hub / github.com/Col-E/Recaf / getJavaPath

Method getJavaPath

src/main/java/me/coley/recaf/util/VMUtil.java:199–212  ·  view source on GitHub ↗

Locates path to Java executable. @return path to Java executable. @throws IllegalArgumentException When Recaf can't detect a path.

()

Source from the content-addressed store, hash-verified

197 * When Recaf can't detect a path.
198 */
199 public static Path getJavaPath() {
200 Path javaHome = Paths.get(System.getProperty("java.home"));
201 Path bin = javaHome.resolve("bin");
202 OSUtil os = OSUtil.getOSType();
203 switch (os) {
204 case WINDOWS:
205 return bin.resolve("java.exe");
206 case LINUX:
207 case MAC:
208 return bin.resolve("java");
209 default:
210 throw new IllegalArgumentException("Don't know how to find Java path for: " + os.getMvnName());
211 }
212 }
213
214 /**
215 * Patches JDK stuff.

Callers 1

JvmCreationPaneMethod · 0.95

Calls 3

getOSTypeMethod · 0.95
getMvnNameMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected