Opened 12 years ago
Last modified 10 years ago
#7275 new enhancement
Allow restart plugin to restart via the CL
Reported by: | rickmastfan67 | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core restart | Version: | latest |
Keywords: | Cc: |
Description
Is it possible to allow the restart plugin to restart JOSM via the CL in Windows?
I currently start JOSM with this command: "C:\Program Files\Java\jre6\bin\java.exe" -Xmx3072M -jar josm-tested.jar
. If I were to attempt to use the restart plugin to restart JOSM, it then bypasses the original way that I started JOSM and directly loads the *.jar file for JOSM. Because of that, I don't get the Command Line Window that shows up telling me what JOSM has done and any conflicts (like with shortcuts) that happen.
Is there anyway that you might be able to change this behavior on Windows? I mean, if I started the *.jar file directly and then used the restart command, I would expect it just restart the jar file. But if I use the CL way, I expect the restart to be with the CL, not the jar directly.
Thanks.
Attachments (0)
Change History (10)
comment:1 Changed 12 years ago by
comment:2 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in r5857 with the integration of restart plugin into core.
comment:3 Changed 10 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Yes and no to this being fixed.
While hitting the restart button keeps the "-Xmx3072M" command when restarting (which is great), the Command Prompt window doesn't survive the restart in Windows. Thus, if an error happens after the restart (like a "Registered toolbar action" error for an example), it will not be visible to a Windows user and can't be reported because they have no idea about it since the Command Prompt window is now gone.
comment:4 follow-up: 5 Changed 10 years ago by
Owner: | changed from Upliner to team |
---|---|
Status: | reopened → new |
Mmm you will probably have to add a script for that, as skyper suggested.
comment:5 Changed 10 years ago by
Replying to Don-vip:
Mmm you will probably have to add a script for that, as skyper suggested.
Have the same problem with linux now and my solution won't work that well as instead of using the original command line (shell) a new one will open.
comment:6 Changed 10 years ago by
Summary: | Allow restart plugin to restart via the CL in Windows → Allow restart plugin to restart via the CL |
---|
adjusted summary as this is not windows specific.
comment:7 Changed 10 years ago by
We could modify the start script:
- inside the script, start JOSM with a special command line option, e.g.
java josm.jar --restart-possible
- when restart is required,
- if
--restart-possible
flag is set, simply exit with a special exit code - otherwise execute the current restart code normally
- if
- script checks the exit code and starts again as needed
minor disadvantage: the script will be running all the time and cannot exec
cleanly.
comment:8 Changed 10 years ago by
Is it not possible, to get the needed information ?
I doubt that the distribution maintainers will distribute it if it is not working properly.
comment:10 Changed 10 years ago by
Modifications to the script:
-
latest/usr/bin/josm-latest
16 16 JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/lib/jvm/java-6-sun/bin/java /usr/bin/java" 17 17 fi 18 18 19 JAVA_OPTS="-Djosm. home=$HOME/.josm-latest -Djava.net.useSystemProxies=true $JAVA_OPTS"19 JAVA_OPTS="-Djosm.restart=true -Djosm.home=$HOME/.josm-latest -Djava.net.useSystemProxies=true $JAVA_OPTS" 20 20 21 21 for jcmd in $JAVA_CMDS; do 22 22 if [ "z$ALTERNATIVE_JDK" = "z`readlink -n -f $jcmd`" ] && [ -z "${JAVACMD}" ]; then … … 32 32 33 33 if [ "$JAVACMD" ]; then 34 34 echo "Using $JAVACMD to execute josm-latest." || true 35 exec $JAVACMD $JAVA_OPTS -jar /usr/share/josm-latest/josm-latest.jar "$@" 35 set +e 36 while true; do 37 $JAVACMD $JAVA_OPTS -jar /usr/share/josm-latest/josm-latest.jar "$@" 38 if [ "z$?" != "z9" ]; then 39 break 40 fi 41 echo ">> restarting josm..." 42 done 36 43 else 37 44 echo "No valid JVM found to run JOSM." || true 38 45 exit 1 -
tested/usr/bin/josm
16 16 JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/lib/jvm/java-6-sun/bin/java /usr/bin/java" 17 17 fi 18 18 19 JAVA_OPTS="-Dj ava.net.useSystemProxies=true $JAVA_OPTS"19 JAVA_OPTS="-Djosm.restart=true -Djava.net.useSystemProxies=true $JAVA_OPTS" 20 20 21 21 for jcmd in $JAVA_CMDS; do 22 22 if [ "z$ALTERNATIVE_JDK" = "z`readlink -n -f $jcmd`" ] && [ -z "${JAVACMD}" ]; then … … 32 32 33 33 if [ "$JAVACMD" ]; then 34 34 echo "Using $JAVACMD to execute josm." || true 35 exec $JAVACMD $JAVA_OPTS -jar /usr/share/josm/josm.jar "$@" 35 set +e 36 while true; do 37 $JAVACMD $JAVA_OPTS -jar /usr/share/josm/josm.jar "$@" 38 if [ "z$?" != "z9" ]; then 39 break 40 fi 41 echo ">> restarting josm..." 42 done 36 43 else 37 44 echo "No valid JVM found to run JOSM." || true 38 45 exit 1
Replying to rickmastfan67:
Only work around I see, is to add a script josm.exe in a path with higher priority. This script should start cmd and execute your starting command.
See also #5635 and #6344.