> java -version
java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-237)
Java HotSpot(TM) Client VM (build 1.5.0_13-119, mixed mode, sharing)
However, you'll see there are many more JVM versions installed in Mac OS X, using the frameworks directory structure which is excellent to my opinion. See how you can use java 1.3 to 1.6 in a standard Leopard install:
> cd /System/Library/Frameworks/JavaVM.framework/Versions/
> ls
1.3 1.3.1 1.4 1.4.1 1.4.2 1.5 1.5.0 1.6 1.6.0 A Current CurrentJDK
So you can easily get to Java 1.6:
I use wsimport in order to generate java classes for a web service client (or JAX-WS portable artifacts, if you prefer the official definition). This tool is available from Java 1.6. However, if you try to run wsimport on Leopard you'll get frustrated:
> cd /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands/
> ./java -version
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13-120)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_05-b13-52, mixed mode)
> ./wsimport
Exception in thread "main" java.lang.NullPointerException
at com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:96)
at com.sun.tools.internal.ws.WsImport.main(WsImport.java:38)
This is a bug that has already been discussed in apple developer mailing lists (here and here).
The best solution I found is simply installing the latest version of JAX-WS from the Glassfish website. Just double click on the downloaded jar file, and after accepting the licence agreement it will expand files into folders named jaxb-ri and jaxws-ri. You can then enter the jaxws-ri folder and run wsimport from there:
> cd jaxws-ri/binI hope that helps :)
./wsimport.sh
Missing WSDL_URI
Usage: wsimport [options]
(...)
Thanks! I was really thrown when I saw that my new Leopard installation was using 1.5. Glad 1.6 was just hiding.
ReplyDelete