Debugging tips

Use "detail formatters"

Make it easier to identify which way/node/etc. a object corresponds to

Testing changes without restarting JOSM

Just in case I'm not the only eclipse noo :)

Eclipse supports "live code editing" while debugging, meaning that you can make changes to the code, and those changes will be compiled and "inserted" into the application being debugged. Somewhat surprisingly (to me at least) this works more or less for plugins too. At least if the plugin and JOSM project are open in the same Eclipse workspace, and the plugin has JOSM as a required project.

Troubleshooting version errors

Are you getting this error while compiling from ant?

java.lang.UnsupportedClassVersionError: com/sun/tools/javac/Main : Unsupported major.minor version 51.0

If so, it probably means that your javac is from JDK 7 yet you are trying to execute it in a Java 6 runtime environment. It's an easy mistake to make in Eclipse when switching between JRE versions for JOSM.

Check: build.xml > Properties > Run/Debug Settings > (Select or create a launch configuration) > JRE. Make sure ant is launching with the same JRE as the JDK version you have installed. Note that this is simply the JRE used when launching ant/javac, it's not the output version of the .class files.

Back to Developers Guide

Last modified 6 years ago Last modified on 2018-03-24T19:13:24+01:00

Attachments (3)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.