/** * Get the possible PYTHON locations. * * @return The candidates */ private static LinkedHashMap<String, String> getCandidates() { // Check if on Windows if (Platform.current() == Platform.WINDOWS) // If on Windows look for windows candidates return getWindowsCandidates(); // Check if on MacOS if (Platform.isDarwin()) // Get MacOS candidates return getDarwinCandidates(); // Else return Unix candidates return getUnixCandidates(); }
public Void call() throws EnvInjectException { try { Field platformField = EnvVars.class.getDeclaredField("platform"); platformField.setAccessible(true); platformField.set(enVars, Platform.current()); if (Main.isUnitTest || Main.isDevelopmentMode) { enVars.remove("MAVEN_OPTS"); } Field masterEnvVarsFiled = EnvVars.class.getDeclaredField("masterEnvVars"); masterEnvVarsFiled.setAccessible(true); Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt( masterEnvVarsFiled, masterEnvVarsFiled.getModifiers() & ~Modifier.FINAL); masterEnvVarsFiled.set(null, enVars); } catch (IllegalAccessException iae) { throw new EnvInjectException(iae); } catch (NoSuchFieldException nsfe) { throw new EnvInjectException(nsfe); } return null; }