<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr">Am Do., 13. Dez. 2018 um 19:49 Uhr schrieb <<a href="mailto:francocalistri@libero.it">francocalistri@libero.it</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div><p><br></p><p>Buonasera a tutti</p><p>scusate ma sono un neofita. Dopo aver usato JOSM su un portatile in ambiente Windows sto provando a caricarlo sul fisso che un Mac non molto giovane è un OSX Lion 10.7.5. Quando avvio JOSM in fase di caricamento del programma JOSm alla stringa "caricamento preferenze immagini aeree " si blocca ed il programma si chiude. </p><p>Qualcuno che usa Mac ha idea di come risolvere il problema.</p></div></blockquote></div><div><br></div><div><br></div><div>io uso JOSM su Mac, il mio approccio è molto "old school" , in quanto mi sono fatto con automator un icona che apre un shell script (del utente Cobra, sostituito wget con curl), verifica se c'è una nuova versione e se si la scarica, altrimenti usa la versione del cache.</div><div><br></div><div>Il problema principale è che la versione Java di default di MacOS è troppo vecchia (credo si tratta di Java SE 6, forse l'hanno aggiornato? Non credo pero). Secondo la apple, dovresti prenderti Java direttamente da Oracle: <a href="https://support.apple.com/en-us/HT204036">https://support.apple.com/en-us/HT204036</a></div><div>In alternativa puoi usare un java free (alternative non oracle).</div><div><br></div><div>Ciao,</div><div>Martin</div><div><br></div><div>lo script originale: <a href="https://wiki.openstreetmap.org/wiki/User:Cobra/JOSM-script">https://wiki.openstreetmap.org/wiki/User:Cobra/JOSM-script</a></div><div><br></div><div>la mia versione (salvare come josm.sh devi avere anche un file josm.conf):</div><div><br></div><div><br></div><div>#!/bin/bash<br>#<br># Copyright (C) 2011 "Cobra" from <<a href="http://www.openstreetmap.org">http://www.openstreetmap.org</a>></div><div># minor modifications 2013 by Martin Koppenhoefer for MacOS-X<br>#<br># This program is free software: you can redistribute it and/or modify<br># it under the terms of the GNU General Public License as published by<br># the Free Software Foundation, either version 3 of the License, or<br># (at your option) any later version.<br>#<br># This program is distributed in the hope that it will be useful,<br># but WITHOUT ANY WARRANTY; without even the implied warranty of<br># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br># GNU General Public License for more details.<br># You should have received a copy of the GNU General Public License<br># along with this program. If not, see <<a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>>.<br>#<br>#<br># homepage and wiki for this script: <a href="http://github.com/cobra/josm-update-script">http://github.com/cobra/josm-update-script</a> <a href="http://wiki.github.com/cobra/josm-update-script">http://wiki.github.com/cobra/josm-update-script</a><br>#<br># Startup-script for josm:<br># - gets always the newest version of josm-latest.jar or josm-tested.jar (configurable)<br># - backs up old versions (useful when the new one doesn't work properly)<br># - is able to launch an old version of josm (via josm -r [revision])<br># - passes all arguments to josm - you can pass files to open with josm, e.g. 'josm trace0*.gpx trace10.gpx'<br># - sets environment variables, passes correct parameters to java and use alsa instead of oss<br># - writes a log to $HOME/.josm/josm.log<br>#<br># configuration (in file josm.conf):<br># - change archive-directory if desired<br># - select josm variant(latest/tested)<br># - adjust number of desired backups<br># - do you use compiz? Then uncomment that line.<br># - adjust amount of RAM available to josm<br># - if you want to change or add some parameters for java look at the last line<br>#<br># usage:<br># josm.sh [-hloqu] [-r revision] [-v version] [FILE(S)]<br>#<br># Options:<br># -h displays a help text<br># -l lists all saved versions of josm and exits<br># -o work offline, doesn't try to update<br># -q suppresses the output of josm's stdout and stderr but still writes the log<br># -r starts this revision of josm, revision is either an absolute number or "last" for next to last saved version<br># -s get and build latest revision from SVN. Can be combined with -u and -r. Requires svn and ant to be installed.<br># -u update without starting josm<br># -v overrides the configured version of josm (can be either "latest" or "tested")<br>#<br><br># include configuration file<br>SCRIPTDIR=`dirname $(readlink $0)`<br>. $SCRIPTDIR/josm.conf<br>usage="Usage: `readlink $0` [-h] [-l] [-o] [-q] [-r revision] [-s] [-u] [-v version] [files]"<br># global variables<br>rev_tested=0<br>rev_tested=0<br>rev_nightly=0<br>rev_local=0<br>rev_svn=0<br># flags<br>override_rev=0<br>override_jar=0<br>update=0<br>bequiet=0<br>offline=0<br>svn=0<br><br># if $dir doesn't exist, create it (initial setup):<br>if [ -d $dir ]; then :<br> else mkdir -p $dir; echo "directory $dir does not exist; creating it..."<br>fi<br>if [ -d $HOME/.josm ]; then :<br> else mkdir $HOME/.josm; echo "directory $HOME/.josm does not exist; creating it..."<br>fi<br><br>cd $dir<br><br>checkrev() {<br> # checks archive for certain revision<br> # parameter: revision to check<br> # returns: 0 if revision is present<br> if ls $dir/josm*.jar | grep $1 >/dev/null; then<br> return 0<br> else return 1<br> fi<br>}<br><br>getbuildrev() {<br> # reads revisions of josm<br> # parameter: version to check, either "latest" or "tested"<br> # returns: revision of given version, 0 when connection timed out<br> if [ $offline -eq 0 ]; then<br> curl -s -o /tmp/josm-version --retry $retries --connect-timeout $timeout <a href="https://josm.openstreetmap.de/version">https://josm.openstreetmap.de/version</a><br> if [ $? -ne 0 ]; then<br> offline=1<br> echo "could not get version from server, working in offline mode" >&2<br> return 1<br> fi<br> rev_latest=`grep latest /tmp/josm-version | cut -d ' ' -f 2`<br> rev_tested=`grep tested /tmp/josm-version | cut -d ' ' -f 2`<br> rev_nightly=`grep $1 /tmp/josm-version | cut -d ' ' -f 2`<br> return 0<br> else return 1<br> fi<br>}<br><br>getlocalrev() {<br> # parameter: none<br> # returns: the newest local revision<br> if ls josm-*.jar > /dev/null; then<br> rev_local=`ls josm*.jar | cut -d '-' -f 2 | cut -d '.' -f 1 | tail -n 1`<br> return 0<br> else return 1<br> fi<br>}<br><br>update() {<br> # parameter: $1: version to update, either "latest" or "tested"; $2: revision<br> # returns: 0 for successful update, 1 for failed update<br> if [ $offline -eq 0 ]; then<br> echo "downloading josm-$version, revision $2..."<br> curl -o josm-$2.jar <a href="https://josm.openstreetmap.de/download/josm-$1.jar">https://josm.openstreetmap.de/download/josm-$1.jar</a><br> return $?<br> else return 1<br> fi<br>}<br><br>terminate() {<br> # terminates this script, tail and josm<br> echo "terminating... please wait"<br> kill -TERM $josmpid<br> if [ $bequiet -eq 0 ]<br> then kill $tailpid<br> fi<br>}<br><br>trap terminate SIGINT SIGTERM<br><br># parse arguments<br>set -- `getopt "hj:loqr:suv:" "$@"` || {<br> echo $usage 1>&2<br> exit 1<br>}<br><br>while :<br> do<br> case "$1" in<br> -h) echo $usage; exit 0 ;;<br> -j) shift; override_jar=1; jarfile="$1" ;;<br> -l) echo "available revisions of josm: "; ls josm*.jar | cut -d '-' -f 2 | cut -d '.' -f 1 ; exit 0 ;;<br> -o) offline=1 ;;<br> -q) bequiet=1 ;;<br> -r) shift; override_rev=1; rev="$1" ;;<br> -s) svn=1 ;;<br> -u) update=1 ;;<br> -v) shift; version="$1" ;;<br> --) break ;;<br> esac<br> shift<br> done<br>shift<br><br>### -s: use svn<br>if [ $svn -eq 1 ]; then<br> if [ $offline -eq 1 ]; then<br> echo "can't access svn in offline mode. exiting."<br> exit 1<br> fi<br> if ! svn --version > /dev/null ; then<br> echo "can't find svn binary. please install svn first."<br> exit 1<br> fi<br> if ! ant -version > /dev/null ; then<br> echo "can't find ant binary. please install ant first."<br> exit 1<br> fi<br><br> if [ $override_rev -eq 1 ]; then<br> #checkout specific revision<br> echo "checking out revision $rev..."<br> svn co -r $rev <a href="http://josm.openstreetmap.de/svn/trunk">http://josm.openstreetmap.de/svn/trunk</a> $svndir<br> if [ $? -ne 0 ]; then<br> echo "svn checkout failed. exiting."<br> exit 1<br> fi<br> cd $svndir<br> else<br> # checkout latest svn revision<br> if [ -d $svndir ]; then<br> cd $svndir<br> echo "checking svn repository for updates..."<br> svn up<br> if [ $? -ne 0 ]; then<br> echo "svn update failed. exiting."<br> exit 1<br> fi<br> else<br> echo "local working copy does not exist, checking out..."<br> svn co <a href="http://josm.openstreetmap.de/svn/trunk">http://josm.openstreetmap.de/svn/trunk</a> $svndir<br> if [ $? -ne 0 ]; then<br> echo "svn checkout failed. exiting."<br> exit 1<br> fi<br> cd $svndir<br> fi<br> fi<br><br> # get revision, check against existing binaries<br> rev_svn=`svn info | grep Revision | cut -d ' ' -f 2`<br><br> if checkrev $rev_svn; then<br> # no changes, use existing binary<br> echo "revision $rev_svn is already existing, skipping build."<br> rev=$rev_svn <br> else<br> # build josm, move to archive; you can add any options fo ant here if you need them<br> echo "attempting to build revision $rev_svn..."<br> ant<br> if [ $? -eq 0 ]; then<br> echo "build of revision $rev_svn from svn successful"<br> cp $svndir/dist/josm-custom.jar $dir/josm-$rev_svn.jar<br> rev=$rev_svn<br> else<br> echo "build failed, exiting."<br> exit 1<br> fi<br> fi<br><br> # terminate if -u is set as well<br> if [ $update -eq 1 ]; then<br> echo "update from svn finished, exiting."<br> exit 0;<br> else<br> cd $dir<br> fi<br><br>### -u: update<br>elif [ $update -eq 1 ]; then<br> if [ $offline -eq 0 ]; then<br> getbuildrev $version<br> if checkrev $rev_nightly; then<br> echo "josm-$version revision $rev_nightly is uptodate"<br> exit 0<br> else<br> echo "josm-$version revision $rev_nightly is available, updating..."<br> update $version $rev_nightly<br> exit 0<br> fi<br> else<br> echo "offline - no update possible. exiting"<br> exit 1<br> fi<br><br><br>### -r: start specified revision<br>elif [ $override_rev -eq 1 ]; then<br> if [ $rev = last ]; then<br> rev=`ls josm*.jar | cut -d '-' -f 2 | cut -d '.' -f 1 | tail -n 2 | head -n 1`<br> fi<br> if checkrev $rev; then<br> echo "forcing use of local revision $rev"<br> else<br> echo "revision $rev not found! Use `basename $0` -l to display a list of available revisions. exiting."<br> exit 1<br> fi<br><br>### normal start and update - tested<br>elif [ $version = tested ]; then<br> getbuildrev $version<br> if checkrev $rev_nightly; then<br> echo "local revision $rev_nightly is uptodate"<br> rev=$rev_nightly<br> else<br> echo "local revision is $rev_local, latest available revision is $rev_nightly - starting download of josm-$version..."<br> update $version $rev_nightly<br> rev=$rev_nightly<br> fi<br><br>### override jar file<br>elif [ $override_jar -eq 1 ]; then<br> echo "using manually set jar file $jarfile"<br><br>### normal start and update - latest<br>else<br> getlocalrev<br> getbuildrev $version<br> if [ $rev_local -ge $rev_nightly ]; then<br> echo "local revision is $rev_local, latest available revision is $rev_nightly - using local revision $rev_local"<br> rev=$rev_local<br> else<br> echo "local revision is $rev_local, latest available revision is $rev_nightly - starting download of josm-$version..."<br> update $version $rev_nightly<br> rev=$rev_nightly<br> fi<br>fi<br><br>### cleanup<br>if [ $offline -eq 0 -a $override_jar -eq 0 ]; then<br> i=1<br> while [ `ls josm*.jar | grep -c ''` -gt $numbackup ]; do<br> oldestrev=`ls josm*.jar | cut -d '-' -f 2 | cut -d '.' -f 1 | head -n $i | tail -n 1`<br> # don't delete current tested<br> if [ $oldestrev -ne $rev_tested ]; then<br> echo "deleting josm revision $oldestrev"<br> rm josm-$oldestrev.jar<br> else i=`expr $i + 1`<br> fi<br> if [ `expr $i + 1` -eq $numbackup ]; then<br> echo "error while cleaning up - \$numbackup set too low."<br> break;<br> fi<br> done<br>fi<br><br># start josm: use alsa instead of oss, enable 2D-acceleration, set maximum memory for josm, pass all arguments to josm and write a log:<br> cd $OLDPWD<br> echo "starting josm..."<br><br> if [ $override_jar -ne 1 ]; then<br> jarfile="$dir/josm-$rev.jar"<br> fi<br><br> # use aoss only if it's installed<br> aoss > /dev/null 2>&1<br> if [ $? -eq 1 ]; then<br> aoss java -jar -Xmx$mem -Dsun.java2d.opengl=$useopengl $jarfile $@ >$HOME/.josm/josm.log 2>&1 &<br> else<br> java -jar -Xmx$mem -Dsun.java2d.opengl=$useopengl $jarfile $@ >$HOME/.josm/josm.log 2>&1 &<br> fi<br> <br> josmpid=$!<br><br> echo "josm started with PID $josmpid"<br><br> if [ $bequiet -eq 0 ]<br> then tail -f $HOME/.josm/josm.log &<br> tailpid=$!<br> fi<br><br> wait $josmpid<br> if [ $bequiet -eq 0 ]<br> then kill $tailpid<br> fi<br> echo "josm terminated"<br><br></div><div><br></div><div><br></div></div></div></div></div>