Changeset 28438 in osm for applications/editors
- Timestamp:
- 2012-06-16T23:05:53+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/restart
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/restart/.classpath
- Property svn:executable deleted
-
applications/editors/josm/plugins/restart/.project
- Property svn:executable deleted
-
applications/editors/josm/plugins/restart/LICENSE
- Property svn:executable deleted
-
applications/editors/josm/plugins/restart/build.xml
r27852 r28438 30 30 <project name="restart" default="dist" basedir="."> 31 31 <!-- enter the SVN commit message --> 32 <property name="commit.message" value=" Commit message"/>32 <property name="commit.message" value="fix #j5635 -- pass java start options when restarting"/> 33 33 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 34 34 <property name="plugin.main.version" value="4980"/> -
applications/editors/josm/plugins/restart/src/josmrestartplugin/RestartJosmAction.java
r27852 r28438 6 6 import java.awt.event.KeyEvent; 7 7 import java.io.File; 8 import java.lang.management.ManagementFactory; 9 import java.util.LinkedList; 8 10 9 11 import org.openstreetmap.josm.Main; … … 28 30 try { 29 31 File jarfile = new File(Main.class.getProtectionDomain().getCodeSource().getLocation().toURI()); 30 long memmax = Runtime.getRuntime().maxMemory();31 32 String javacmd = "java"; 32 33 if (Main.platform instanceof PlatformHookWindows) javacmd = "javaw"; 33 String[] cmds = new String[] { 34 javacmd, 35 "-Xmx" + memmax, 36 "-jar", 37 jarfile.getAbsolutePath() 38 }; 34 LinkedList<String> cmds = new LinkedList<String>(); 35 cmds.add(javacmd); 36 cmds.addAll(ManagementFactory.getRuntimeMXBean().getInputArguments()); 37 cmds.add("-jar"); 38 cmds.add(jarfile.getAbsolutePath()); 39 39 for (String s : cmds) 40 40 System.out.print(s + " "); 41 41 System.out.println(); 42 42 43 Runtime.getRuntime().exec(cmds); 43 Runtime.getRuntime().exec(cmds.toArray(new String[0])); 44 44 } catch (Exception e) { 45 45 e.printStackTrace();
Note:
See TracChangeset
for help on using the changeset viewer.