Why not ask your question on the new OpenStreetMap Community Forum?

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

IF "%JAVACMD%"=="" set JAVACMD="C:\Program Files\Java\jre1.8.0_201\"


IF "%JAVACMD%"=="" set JAVACMD="C:\Program Files (x86)\Java\jre1.8.0_201\bin\"

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)

if [ -z "$JAVACMD" ] ; then
  # No JAVACMD provided in osmosis config files, therefore default to java
  JAVACMD="C:\Program Files (x86)\Java\jre1.8.0_201\bin\"


if [ -z "$JAVACMD" ] ; then
  # No JAVACMD provided in osmosis config files, therefore default to java
  JAVACMD=C:\Program Files (x86)\Java\jre1.8.0_201\bin\

4) The %JAVACMD% in the SET statement of the osmosis.bat file already have double quotes so I leave this alone

SET EXEC="%JAVACMD%" %JAVACMD_OPTIONS% -cp "%PLEXUS_CP%" -Dapp.home="%MYAPP_HOME%" -Dclassworlds.conf="%MYAPP_HOME%\config\plexus.conf" %MAINCLASS%  %OSMOSIS_OPTIONS% %*

5) I also commented out

REM # IF EXIST "%USERPROFILE%\osmosis.bat" CALL "%USERPROFILE%\osmosis.bat"

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

**** BATCH RECURSION exceed stacks limit ******
Recursion counts=317 Stack Usage=90 percent


**** BATCH RECURSION exceed stacks limit ******
Recursion counts=317 Stack Usage=90 percent

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

Files was unexpected at this time


Files was unexpected at this time

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.



asked 19 Mar '19, 08:46

Paul%20Pi's gravatar image

Paul Pi
accept rate: 0%

edited 19 Mar '19, 09:49

scai's gravatar image

scai ♦


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 your osmosis.bat.

(19 Mar '19, 09:51) scai ♦

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.

(19 Mar '19, 10:12) SK53 ♦

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.

permanent link

answered 14 May '20, 17:59

trnovstyle's gravatar image

accept rate: 0%

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.

permanent link

answered 20 Mar '19, 16:06

alester's gravatar image

accept rate: 28%


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

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,


(20 Mar '19, 23:39) Paul Pi

Hi @scai & @SK53,

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.



permanent link

answered 19 Mar '19, 23:47

Paul%20Pi's gravatar image

Paul Pi
accept rate: 0%

edited 20 Mar '19, 22:32

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
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 19 Mar '19, 08:46

question was seen: 3,000 times

last updated: 14 May '20, 17:59

powered by OSQA