Sea Polygons and java 1.6

Hi The sea polygon patch uses a feature from java 1.6 (NavigableSet), whereas mkgmap is currently released for java 1.5. Perhaps there is a different way to do it that avoids the use, but it could be time to consider going to 1.6. Now I don't personally mind going to 1.6 and in fact I announced that this would 'happen soon' over a year ago. The only problem is people with Macs. As I have experienced with splitter (which always has required 1.6) there were quite a few queries to the mailing list and to my own email address from people not being able to run it. As there are many more downloads of mkgmap than splitter, I expect that there would be far more queries generated for mkgmap. Now as far as I know, it is no longer a problem getting 1.6 for all Macs, so I don't think anyone will be unable to run it, it is just a case of knowing what to download from where for which Mac 32/64 bit etc. So if we were to start requiring 1.6 I would like to prepare by adding a specific error message to mkgmap stating the version requirements, rather than just a stack trace that you would currently see, and to get a description of how to obtain 1.6 for the different Macs that can be placed on the wiki and web site etc. What do you think? ..Steve

SR> So if we were to start requiring 1.6 I would like to prepare by SR> adding a specific error message to mkgmap stating the version SR> requirements, rather than just a stack trace that you would SR> currently see, and to get a description of how to obtain 1.6 for the SR> different Macs that can be placed on the wiki and web site etc. I guess the problem is if you just compile with 1.6 and run on 1.5, the VM fails pretty quickly with a UnsupportedClassVersionError. Perhaps if you set <property name="ant.build.javac.target" value="1.5"/> and checking immediately on startup to see if eg NavigableSet exists you'll be able to do what you want? Might also have to avoid 1.6 language features like @Override on interface implementations I suppose. I'm quite happy to see a move to 1.6, but as you say being able to give a clear warning when running on 1.5 is probably essential to reduce the amount of support required. Chris

On 08/22/2009 12:48 PM, Chris Miller wrote:
I guess the problem is if you just compile with 1.6 and run on 1.5, the VM fails pretty quickly with a UnsupportedClassVersionError. Perhaps if you
set<property name="ant.build.javac.target" value="1.5"/> and checking immediately on startup to see if eg NavigableSet exists you'll be able to do what you want? Might also have to avoid 1.6 language features like @Override on interface implementations I suppose.
Heh, yes what I wrote was kind of daft on the face of it, but the mkgmap distributions have always been compiled with 1.6 and target=1.5 from the very beginning, so that was exactly what I was thinking of doing.
I'm quite happy to see a move to 1.6, but as you say being able to give a clear warning when running on 1.5 is probably essential to reduce the amount of support required.
Agreed, so I am especially looking for Mac users to give advice and/or offer to help. In particular SoyLatte is often suggested, but this requires that you be a research licensee. The openJDK release from the same source has recently appeared and is GPL of course and so has no such restriction, but it is marked beta and although I would be surprised if there were any problem with a command line app it would be good to have it confirmed. ..Steve

2009/8/22 Steve Ratcliffe <steve@parabola.me.uk>:
Agreed, so I am especially looking for Mac users to give advice and/or offer to help. In particular SoyLatte is often suggested, but this requires that you be a research licensee. The openJDK release from the same source has recently appeared and is GPL of course and so has no such restriction, but it is marked beta and although I would be surprised if there were any problem with a command line app it would be good to have it confirmed.
I'm a mac user and the Java 1.6 requirement of the splitter caused me to look into this a bit. After a lot of messing around, including with Soylatte (which worked, BTW), I reached the conclusion that on MacOS Leopard at least, 1.6 is already available and many Mac users will already have it sitting silently on their machines: http://www.apple.com/downloads/macosx/apple/application_updates/javaformacos... The Java preferences application will allow you to switch which version of Java is used by default. Or rather, that's how it is for me. Others can perhaps provide better info. Dermot -- -------------------------------------- Iren sind menschlich

Am 22.08.2009 13:18 Uhr schrieb Dermot McNally:
2009/8/22 Steve Ratcliffe <steve@parabola.me.uk>:
Agreed, so I am especially looking for Mac users to give advice and/or offer to help. In particular SoyLatte is often suggested, but this requires that you be a research licensee. The openJDK release from the same source has recently appeared and is GPL of course and so has no such restriction, but it is marked beta and although I would be surprised if there were any problem with a command line app it would be good to have it confirmed.
I'm a mac user and the Java 1.6 requirement of the splitter caused me to look into this a bit. After a lot of messing around, including with Soylatte (which worked, BTW), I reached the conclusion that on MacOS Leopard at least, 1.6 is already available and many Mac users will already have it sitting silently on their machines:
http://www.apple.com/downloads/macosx/apple/application_updates/javaformacos...
The Java preferences application will allow you to switch which version of Java is used by default.
Indeed, Mac OS X 10.5 and later support Java 1.6 on 64-bit hardware (though, as you say, it needs to be activated in the Java preference app). A few older Macs, before they shipped with 64 bit Intel processors, still cannot run it. However, if I recall correctly, there were only very few early Apples that were shipped with 32bit only processors. The exact java version on my machine with the official Apple build is: java version "1.6.0_13" Java(TM) SE Runtime Environment (build 1.6.0_13-b03-211) Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02-83, mixed mode) Considering that (a) Mac OS 10.6 is due really soon now(TM) and (b) all recent (last two years?) Apples have 64bit processors, I think it should be no problem to switch to Java 6 on Mac. It would be really nice if, for some transition period, mkgmap would still be able to run in a "limited functionality mode" with a 1.5 runtime, disabling features that require 1.6. But I'm not a Java programmer, so I don't know how hard that would be. Alexander

I have a newish macbook pro, bought around January of 2008. It had 10.5, and java 1.5. I was able to download java 1.6 from apple, but apparently that only works for intel 64-bit macs (which means "amd64", think). But, setting the preference only changes the JRE, and apparently our ant build looks for installations and uses them in the wrong order. I have not had luck with openjdk on netbsd with josm, and should try splitter and mkgmap. My general impression has been that one really needs a sun jre/jdk for most things, but it would be great if that is changing. I don't know how many people there are running mkgmap on macs that don't support java 1.6. splitter already needs 1.6, so as much as I hate to require bleeding edge (1.6 is bleeding edge because the standard mac os doesn't have it yet, even if it's been a while :-), I don't see any reason not to require 1.6. Here's a patch to doc/README.java: Index: doc/README.java =================================================================== --- doc/README.java (revision 1142) +++ doc/README.java (working copy) @@ -7,8 +7,20 @@ The main version of java for which mkgmap is tested is 1.6. Java 1.5 should also work. +For splitter, 1.6 is required. + TODO: Openjdk 1.7 may work. +** Mac hints + +Mac OS X 10.5 comes with Java 1.5. You can install 1.6 from + http://www.apple.com/downloads/macosx/apple/application_updates/javaformacos... + +After installing, set 1.6 as the default using JAVA preferences, which +will cause 'java -jar foo.jar' to use the 1.6 JRE. To cause ant to +use 1.6 to compile, set + export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/home + * building To build, you must have a JDK and apache ant installed. @@ -17,4 +29,4 @@ * running To run, you must have a JRE installed. See README.invoking and -README.examples. +README.examples. You can use a downloaded jar or one that you built.

On Aug 22, 2009, at 19:02, Steve Ratcliffe wrote:
Agreed, so I am especially looking for Mac users to give advice and/or offer to help. In particular SoyLatte is often suggested, but this requires that you be a research licensee. The openJDK release from the same source has recently appeared and is GPL of course and so has no such restriction, but it is marked beta and although I would be surprised if there were any problem with a command line app it would be good to have it confirmed.
I'll try out the openJDK and report my results. As I previously used SoyLatte on OS X 10.4 systems and did not have problems, I would suspect that openJDK will be similar. (The requirement of being a research licensee is a bit of a ruse, by the way.) Cheers.

On Aug 22, 2009, at 19:02, Steve Ratcliffe wrote:
The openJDK release from the same source has recently appeared and is GPL of course and so has no such restriction, but it is marked beta and although I would be surprised if there were any problem with a command line app it would be good to have it confirmed.
I can confirm that this works. I downloaded the 32-bit OpenJDK6 Beta 1 from http://landonf.bikemonkey.org/static/soylatte/ After installing, I was able to compile both splitter and mkgmap with the sea polygons patch applied. Furthermore, I was able to use the jai libraries from Sun to compile the optional contour code. This was on an OS X 10.5 system with a 64 bit intel CPU.
participants (6)
-
Alexander Wittig
-
Chris Miller
-
Clinton Gladstone
-
Dermot McNally
-
Greg Troxel
-
Steve Ratcliffe