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\"

and

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\"
fi

and

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\
fi

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

IF EXIST "%ALLUSERSPROFILE%\osmosis.bat" CALL "%ALLUSERSPROFILE%\osmosis.bat"

unchanged. (also commented this out but it didn't do anything)

The errors I encountered are

C:\Users\PAUL>"C:\osmosis\bin\osmosis"
**** BATCH RECURSION exceed stacks limit ******
Recursion counts=317 Stack Usage=90 percent
****** BATCH PROCESSING IS ABORTED ******

or

C:\Users\PAUL>"C:\osmosis\bin\osmosis.bat"
**** BATCH RECURSION exceed stacks limit ******
Recursion counts=317 Stack Usage=90 percent
****** BATCH PROCESSING IS ABORTED ******

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

C:\Users\PAUL>"C:\osmosis\bin\osmosis"
Files was unexpected at this time

or

C:\Users\PAUL>"C:\osmosis\bin\osmosis.bat"
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.

Best,

Paul

asked 19 Mar, 08:46

Paul%20Pi's gravatar image

Paul Pi
112
accept rate: 0%

edited 19 Mar, 09:49

scai's gravatar image

scai ♦
30.7k18275429

2

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, 09:51) scai ♦
1

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, 10:12) SK53 ♦

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, 16:06

alester's gravatar image

alester
5.0k25274
accept rate: 30%

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, 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, 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.

Best,

p

permanent link

answered 19 Mar, 23:47

Paul%20Pi's gravatar image

Paul Pi
112
accept rate: 0%

edited 20 Mar, 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, 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

By RSS:

Answers

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:

×204
×41

question asked: 19 Mar, 08:46

question was seen: 144 times

last updated: 21 Mar, 11:36

powered by OSQA