Hi OpenStreetmap experts, I am having problems trying to installing Osmosis in my Windows 10 64-bits. I downloaded the lastest Java SE 32-bit & 64-bit as well as the latest osmosis version from http://bretth.dev.openstreetmap.org/osmosis-build/osmosis-latest.zip. I tried to followed the installation guide from http://wiki.openstreetmap.org/wiki/Osmosis/Quick_Install_(Windows) and http://learnosm.org/en/osm-data/osmosis/#install-osmosis, and thoroughly tried all the questions related to the trouble shooting on this forum and still don't get it to work. In summary I have tried to 1) Edit the system environment variables and added the directory where osmosis.bat is located to the System variable (I tried both locations C:\Program Files (x86)\osmosis\bin\ and C:\osmosis\bin\ amongst my various attempts to get it to work). 2) Edit C:\Program Files (x86)\osmosis\bin\osmosis.bat and tried to point the Java application to both 32-bit and 64-bit versions in various attempts
and
3) Tried to edit the OSMOSIS FILE (NOTE: not osmosis.bat) pointing to both the 32-bit and 64-bit Java SE application (I copied the 32-bits here but also tried the 64-bit as well)
and
4) The %JAVACMD% in the SET statement of the osmosis.bat file already have double quotes so I leave this alone
5) I also commented out
in the osmosis.bat file because I repeatedly run into BATCH RECURSION exceed stacks limit error and left
unchanged. (also commented this out but it didn't do anything) The errors I encountered are
or
6) I typed in JAVA at the command prompt screen and it worked fine 7) Created another .bat file in C:\Users\PAUL\osmosis.bat which contain the line "C:\osmosis\bin\osmosis.bat" I also tried without the .bat extension as well i.e. "C:\osmosis\bin\osmosis" 8) However when I typed in osmosis at the command prompt it giving me this error
or
I tried really hard to get osmosis to work but all attempts proved futile, so I really appreciate if any experts can show me the steps to get this working on Win 10 64-bit. Best, Paul |
Looking at my osmosis.bat, JAVACMD should point to your java executable. If you have Java set up in your "Path" environment variable, then JAVACMD=java is all you need. Otherwise, JAVACMD should point to wherever the Java executable resides. answered 20 Mar '19, 16:06 alester 1
I just checked, and my .bat file is exactly the same as the one available when you download the program (ie. I haven't modified mine at all). As for my variables, I don't have a JAVA_HOME one. My PATH system variable contains the following for Java (I have JRE installed with default settings): C:\Program Files (x86)\Common Files\Oracle\Java\javapath
(20 Mar '19, 23:33)
alester
1
Tried to modified my earlier comments to reflect the latest update, yes I finally got this to work with the JAVA_HOME environment variable set-up shown above, finger cross no more issues comes up when I have more interaction with osmosis, but thank you @alester for enlightened me that this was the issue. I also just tried the latest version and it worked too, so happy days! Best regards, p
(20 Mar '19, 23:39)
Paul Pi
|
Thank you for your kind responses, I have renamed the osmosis.bat files in C:\Users\PAUL and leave the "real" osmosis.bat filename in C:\osmosis\bin\ unchanged. However it now giving me a new error message relates to Java Files\Java\jre1.8.0_201\""=="" was unexpected at this time. I checked both the osmosis and osmosis.bat files in C:\osmosis\bin\ and it is pointing to the right Java directory IF "%JAVACMD%"=="" set JAVACMD="C:\Program Files (x86)\Java\jre1.8.0_201\bin" I even tried the 64-bit version as well to no avail. Update 1: I also attempted to modify the system environmental variables and path to reflect the new JRE installation location (from C:\Program Files\Java to C:\Java) because of the space in between "Program Files" plus modify the osmosis.bat file to point to the new Java location IF "%JAVACMD%"=="" set JAVACMD=C:\Java\bin again it didn't worked as hoped. The error encountered was '"C:\Java\bin"' is not recognized as an internal or external command operable program or batch file Update 2: Downloaded the previous version of osmosis and tried all the above, still doesn't work, is there anyone who have a fix for Windows? I don't believe I'm the only Window user who have this problem. Best, p answered 19 Mar '19, 23:47 Paul Pi Thank you @alester, after more fiddling with the environment variables I got it to work for osmosis older version 0.46, haven't tried the latest version yet. For the benefits of anyone else who have the same problem like me the last 3 days this is how I configure my Java environment. Variable Name : JAVA_HOME Variable Value : C:\Program Files\Java\jdk-11.0.2 Variable Name : PATH Variable Value : %JAVA_HOME%\bin
(20 Mar '19, 22:31)
Paul Pi
|
I also had problems. After I removed "" from JAVACMD="C:\Program Files (x86)\Java\jre1.8.0_201\bin" it worked. Maybe it is some region/language specific problem. answered 14 May, 17:59 trnovstyle |
I'm not really experienced with Windows and .bat files but as far as I remember you should not use the same name for the binary and the .bat file. Otherwise when trying to call the binary (i.e.
osmosis
) Windows executes the .bat file instead (i.e.osmosis.bat
), leading to a recursion and/or weird errors. Try renaming yourosmosis.bat
.I'd suggest in the first instance adding ECHO statements for JAVACMD, MYAPP_HOME & a copy of the final EXEC statement. Osmosis in my experience has always been fiddly to get working in Windows and mostly because of these environment variables.