Windows Path Problems

Hi All,

Please excuse me for any naive queries. This is my first post to this list.

I am on a Windows XP (Home Edition) machine.
I downloaded the full version of Osmosis from “” and uncompressed it in one of my preferred directories. Running the osmosis.bat file from the bin directory produces the following error
Exception in thread “main” java.lang.NoClassDefFoundError: and

I have tried fixing the references in the bat file as follows:

SET EXEC=%JAVACMD% %JAVACMD_OPTIONS% -cp %MYAPP_HOME%\osmosis.jar;%MYAPP_HOME%\lib\commons-logging.jar;%MYAPP_HOME%\lib\mysql-connector-java-5.0.7-bin.jar;%MYAPP_HOME%\lib\postgresql-8.3-603.jdbc4.jar;%MYAPP_HOME%\lib\postgis_1.3.2.jar;%MAINCLASS% %OSMOSIS_OPTIONS% %*

SET EXEC=%JAVACMD% %JAVACMD_OPTIONS% -cp %MYAPP_HOME%\osmosis.jar;%MYAPP_HOME%\lib\default\commons-logging-1.0.4.jar;%MYAPP_HOME%\lib\default\mysql-connector-java-5.1.6-bin.jar;%MYAPP_HOME%\lib\default\postgresql-8.3-603.jdbc4.jar;%MYAPP_HOME%\lib\default\postgis-1.3.2.jar;%MAINCLASS% %OSMOSIS_OPTIONS% %*

I have also tried adding the class path in the environment variables. Nothing is working for me at the moment.

Also, I am aiming to extract an Australian city’s data using osmosis. Any ideas on how to get the coordinates for doing such an exercise.

Yes I found I needed to modify that line of the bat file too, to reference the new ‘default’ directory.

What’s the full error message? (which class def is it not finding? )

Also see :

Thanks Harry,

Well I got around the class not found problem by manually specifying the path but now there are other problems; osmosis is not recognizing the options. Here is the output I am getting on the commandline

C:\osmosis-0.31>java -cp \lib\default\commons-logging-1.0.4.jar;\lib\default\mysql-connector-java-5.1.6.jar;\lib\default\postgresql-8.3-603.jdbc4.jar;\lib\default\postgis-1.3.2.jar;\lib\default\jpf-1.5.jar;\lib\default\stax2-api-3.0.1.jar;\lib\default\woodstox-core-lgpl-4.0.3.jar;\lib\default\bzip2-20090327.jar -jar osmosis.jar org.openstreetmap.osmosis.core.Osmosis --rx file=“planet.osm” --bp file=“mypts
.txt” --wx file=“mymap.osm”

29/07/2009 10:38:11 AM org.openstreetmap.osmosis.core.Osmosis main
SEVERE: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Expected argument 1 to b
e an option or task name.
at org.openstreetmap.osmosis.core.cli.CommandLineParser.parse(CommandLin
at org.openstreetmap.osmosis.core.Osmosis.main(

A quick response is appreciated.


Yeah you either need “-jar osmosis.jar” or “org.openstreetmap.osmosis.core.Osmosis” , but you have both