@Test public void testMainWithArgs() throws Exception { assertNull(System.getProperty("snap.home")); String oldVal1 = System.setProperty("netbeans.home", "a/b/c/platform"); try { try { Main.main(new String[]{"--branding", "snap", "--locale", "en_GB"}); } catch (ClassNotFoundException e) { } assertEquals(Paths.get("a/b/c"), Paths.get(System.getProperty("snap.home"))); } finally { if (oldVal1 != null) { System.setProperty("netbeans.home", oldVal1); } else { System.clearProperty("netbeans.home"); } System.clearProperty("snap.home"); } }
public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException { System.setProperty("snap.home", Paths.get(getPropertySafe("netbeans.home")).getParent().toString()); if (Boolean.getBoolean("snap.debug")) { dumpEnv(args); } runNetBeans(args, NB_MAIN_CLASS); }
Main { public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException { System.setProperty("snap.home", Paths.get(getPropertySafe("netbeans.home")).getParent().toString()); if (Boolean.getBoolean("snap.debug")) { dumpEnv(args); } runNetBeans(args, NB_MAIN_CLASS); } }
Main { public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException { System.setProperty("snap.home", Paths.get(getPropertySafe("netbeans.home")).getParent().toString()); if (Boolean.getBoolean("snap.debug")) { dumpEnv(args); } runNetBeans(args, NB_MAIN_CLASS); }  }
Main { public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException { System.setProperty("snap.home", Paths.get(getPropertySafe("netbeans.home")).getParent().toString()); if (Boolean.getBoolean("snap.debug")) { dumpEnv(args); } runNetBeans(args, NB_MAIN_CLASS); }  static void main(String[] args); }
Main { public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException { System.setProperty("snap.home", Paths.get(getPropertySafe("netbeans.home")).getParent().toString()); if (Boolean.getBoolean("snap.debug")) { dumpEnv(args); } runNetBeans(args, NB_MAIN_CLASS); }  static void main(String[] args);  }