1

I try to implement a custom node tag resolver to make a railway stations exported with specific clazz value.

I used this article How to extend OSM2PO with ferry durations? as manual.

Class compiled and jar for new tag resolver created successfully.

But when I run an export with command:

java -Xmx2g -jar osm2po-core-5.1.0-signed.jar -classpath osm2po-core-5.1.0-signed.jar:osm2po-plugins/osm2po-plugins-5.1.0_custom.jar:de.cm.osm2po.Main cmd=c /PATH-TO-OSM-FILE

The result is unsupported major,minor version 51.0.

As I understand, osm2po-core-5.1.0.-signed.jar compiled with 1.7.0_55-b13 and I had generate a osm2po-plugins-5.1.0_custom.jar with 1.7 version as well.

Is anyone had same problem?

folder structure:

osm2po-5.1.0/
   osm2po-doc/
   osm2po-plugins/
      de/
          cm/
             osm2po/
                demos/
                   ...
                samples/
                   MyNodeTagResolver.java
          de/
             cm/
                osm2po/
                   samples/
                      MyNodeTagResolver.class
      osm2po-plugins-5.1.0_custom.jar
      osm2po-plugins-5.1.0.jar
      osm2po-demos-5.1.0.jar
      demos.txt
   osm2po-web/
   osm2po.config
   osm2po-core-5.1.0-signed.jar
0

osm2po is compatible with (and build for) Java 1.6. I think you'll have to use the compiler option -target 1.6 in order to be binary compatible.

The original doc says: The major version number will be ..., 50 for Java 6, and 51 for Java 7.

Tip! Read this to make things easier:

How to extend OSM2PO with ferry durations?

  • Compiling with 1.6 did the job. Inside "osm2po-plugins/de" directory command "javac -target 1.6 -source 1.6 -d . -classpath ../../osm2po-core-5.1.0-signed-jar cm/osm2po/samples/MyNodeTagResolver.java" throws a warning but next steps goes without problem. Thanks! – Denis Rybakov May 19 '16 at 20:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.