OpenStreetMap

Bugfixing terracer: 7. Have you Tried Restarting Your Program, Sir?

Posted by alexkemp on 17 January 2017 in English. Last updated on 26 January 2017.
  1. There May be Troubles Ahead
  2. Errors whilst Compiling using Ant
  3. Creating Eclipse Project
  4. Eclipse Debugging Routines
  5. wORD cASE bLINDNESS
  6. Importing the Project Bugs
  7. Have you Tried Restarting Your Program, Sir?
  8. Show Your Bugs, Damn You!
  9. Be Careful What You Wish For
  10. Installing NetBeans

tl;dr: It seems that you simply need to be pig-headed & ignore all errors, clean the Build & restart & do it again (below is what I had to go through to discover this).

  1. Configure Debian Jessie for JAVA-8 default usage:
    (update-java-alternatives only works with manual-set settings)
    (just one example (‘extcheck’) is given below for changing a ‘auto’ setting, which all default to Java-7)
    (change them all to Java-8)
    (some, such as browser plugins, do not have Java-8 binaries)

    $ sudo update-java-alternatives -l
    $ sudo update-java-alternatives -s java-1.8.0-openjdk-amd64
    $ sudo update-alternatives --get-selections | fgrep -i java-7
    $ sudo update-alternatives --config extcheck
    $$(repeat with all others)
    $ sudo update-alternatives --get-selections | fgrep -i java-7
    itweb-settings auto /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/itweb-settings
    javaws auto /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/javaws
    mozilla-javaplugin.so auto /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/IcedTeaPlugin.so

  2. Create a menu launcher for eclipse-oxygen

    $ cp /usr/share/applications/eclipse.desktop ~/.local/share/applications/eclipse-oxygen.desktop
    $ nano ~/.local/share/applications/eclipse-oxygen.desktop
    $ cat ~/.local/share/applications/eclipse-oxygen.desktop
    [Desktop Entry]
    Type=Application
    Name=Eclipse-Oxygen
    Comment=Eclipse Integrated Development Environment
    Icon=eclipse
    Exec=~/eclipse/java-oxygen/eclipse/eclipse
    Terminal=false
    Categories=Development;IDE;Java;

  3. Empty ~/workspace of all files
  4. Open Eclipse-oxygen & select “workspace/” as the Workspace
  5. Remove the Welcome screen (click on ‘x’)
  6. Install Eclipse Subversive ( http://www.eclipse.org/subversive/downloads.php )
    (drag & drop ‘Install’ link into a running Eclipse workspace to install Subversive)
    (see also https://youtu.be/04L4rkykWZw )
  7. After restart, install SVN Connector
    (Go Window ▸ Perspective ▸ Open Perspective ▸ Other...)
    (Select SVN Repository Exploring + press OK)
    (Check a SVN Kit connector + press OK)
    (Press Next> + accept the Licence agreement + press Finish)
    (Accept the unsigned software Security warning) (prats)
    (Restart when finished. Again.)
  8. Click on File ▸ New ▸ Other
  9. Open the SVN category and select Repository Location + Press Next>
  10. Paste the URL: https://svn.openstreetmap.org/applications/editors/josm/ + Press Finish
    (a vast, long wait at this point)
    (I eventually restarted & opened the Repository view)
    (Window ▸ Perspective ▸ Open Perspective ▸ SVN Repository Exploring)
    (There were now 3 lines in the SVN Repositories window)
    (I removed two, then right-clicked on the last one & chose ‘Check-out’)
    (Finally the bottom-right of the window showed activity…)
    (now to import the existing project)
  11. File ▸ Import
  12. (expand General) select Existing Projects into Workspace + Press Next>
  13. Click Browse... on Select root directory and navigate to /workspace/josm/core
  14. The text in the Projects box now reads JOSM (~/workspace/josm/core) and needs to be selected
  15. Press Finish
  16. It now says ‘Building Workspace’ but rapidly stops with the error:
    Error !!! Unable to find jar file (for extension jj), check the JavaCC options of the project(@ 17/01/2017 00:06:20)
    (I have already installed this once & have zero idea as to why I’m expected to install it again)
    (I begin to re-install it but it quickly tells me that it is already installed)
    (I click on ‘Hide items that are already installed) and discover another item hidden beneath it:)
    (SF JavaCC Eclipse Plug-in feature 1.5.33 - I install that)
    (However, the whole thing turns out to be a bug, and it reports it to be already installed)
    (This is getting boring)
    (Click on a ‘What is already installed?’ link, select the plugin + click on uninstall, then restart)
    (Reinstall the plugin from scratch, and restart)
    (Identical error - really boring)…
    (Select josm (or JOSM) in Package Explorer, then go Project ▸ Properties ▸ JavaCC Options)
    (I change Set the JavaCC jar file from ${project_loc}/tools/javacc.jar to ~/.p2/pool/plugins/sf.eclipse.javacc_1.5.33/jars/javacc-6.0.jar)
    (I change Set the JTB jar file from ${eclipse_home}/plugins/sf.eclipse.javacc_1.5.27/jtb-1.4.7.jar to ~/.p2/pool/plugins/sf.eclipse.javacc_1.5.33/jars/jtb-1.4.11.jar)
    (Press OK then Yes on Rebuild the Project)
  17. Right click on josm in Package ExplorerDebug As ▸ Java Application on ~/workspace/josm/core/eclipse/JOSM (Java 8)
    (this quickly goes to the Debug screen; I need to press f8 (Resume) until it throws an exception that the JOSM bug-report system can catch)
    (I report the bug https://josm.openstreetmap.de/ticket/14258 )
  18. Press ProjectClean...; restart Eclipse; do Debug As identical to before
    (so that the first src file + line that it stopped at could be reported)
  19. JOSM load goes all the way to the first screen (choose location load, etc). Bugger!
    (I’ve tried a second time & it seems that you simply need to get the errors the first time, then restart & do it again, and everything works fine)

Discussion

Comment from R0bst3r on 17 January 2017 at 07:41

Great posts and absolutely well documented! It will work out in the end, good luck.

Comment from Stereo on 26 January 2017 at 08:57

I actually find your debugging posts quite terrifying - it explains why the JOSM developers are such a small group!

Comment from alexkemp on 26 January 2017 at 10:21

Hi @Stereo

Well, those ‘developers’ do not yet include me.

I’ve just spent 3 days adding 100 terraces (>200 houses) without an exception being thrown. I’ve also spent weeks & weeks working on JOSM with Eclipse & cannot find any way in which I can debug terracer, largely (it seems in my ignorance) to the decision to use a non-standard ‘Main’ as the start-routine (rather than ‘main’). Even if terracer is clear of fatal bugs it has lots of non-fatal bugs to fix, but I cannot find the way to launch it as part of a JOSM debug session.

I’m going to try netbeans instead, I think.

Log in to leave a comment