List of usage examples for java.lang RuntimeException RuntimeException
public RuntimeException(Throwable cause)
From source file:Main.java
public static Method getDeclaredMethod(Class<?> clazz, String name, Class<?>... argTypes) { try {//from w ww .j a va2s .co m final Method method = clazz.getDeclaredMethod(name, argTypes); method.setAccessible(true); return method; } catch (final SecurityException e) { throw new RuntimeException(e); } catch (final NoSuchMethodException e) { return null; } }
From source file:Main.java
public static File toolsJar() { final String jdkLocation = System.getProperty("java.home"); final File javaHome = new File(jdkLocation); try {/*from ww w .j a v a 2 s . c om*/ return new File(javaHome, "../lib/tools.jar").getCanonicalFile(); } catch (final IOException e) { throw new RuntimeException(e); } }