Archive for the ‘Java on Mac OS X’ Category

Java Update 1 kills QuickTime for Java

Wednesday, April 30th, 2008

Apple has released (via Software Update) “Java for Mac OS X 10.5 Update 1″, which installs Java 1.6.0_05 (although it does not make it the default version of Java for the machine.

bash-3.2$ /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)

The software update is installed only on 64-bit capable Macs. To switch it to the default Java install you need to use the /Applications/Utilities/Java Preferences application (which states when you select it that “Java SE 6 is only available for Java applets in 64-bit capable browsers. J2SE 5.0 will be used in 32-bit-only browsers, including Safari”)

Discussions indicate that compiled JNI libraries don’t look like they currently work, and neither do QuickTime for Java applications:
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java quicktime.QTSession
java.lang.reflect.InvocationTargetException
at java.awt.EventQueue.invokeAndWait(EventQueue.java:997)
at quicktime.QTSession.(QTSession.java:92)
Caused by: java.lang.UnsatisfiedLinkError: /System/Library/Java/Extensions/libQTJNative.jnilib:
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1030)
at quicktime.QTSession$1.run(QTSession.java:94)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:300)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:210)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:200)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:195)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:187)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Exception in thread “main” java.lang.NoSuchMethodError: main

This is not surprising given that QuickTime for Java is based on 32-bit Carbon libraries, and has been effectively in “maintenance mode” for a while. Unfortunately someone manages to get the JNI (or JNA?) code working it’s going to be difficult to work around the problem using QTKit.

In the meantime, QuickTime for Java still muddles along in Java 5. Eclipse Ganymede also seems to launch ok, but I haven’t done anything extensive with it.

Apple Java job

Sunday, March 30th, 2008

From Apple’s java mailing list: 

 

We are looking for a talented, passionate and motivated engineer to join the Java team.  Java expertise, of course, is important, but C and Objective-C (Cocoa) are also essential since you will be working on the frameworks underneath AWT and Swing.  If you or anyone you know is interested, please do apply.  This is an opportunity to have a serious impact on the Mac OS X Java implementation, and start a career at Apple.You can find out more by clicking this link, or by searching apple.com/jobs for Requisition ID 3489430. 

 

Java 6 on Leopard

Thursday, November 22nd, 2007

Fans of Java 6 who want to be able to access it on Leopard (as Apple hasn’t released it or announced when it will do so) may want to check out this post (and include the tag mentioned). Note also the efforts to do an open source port of Java 6.

IPv6 v IPv4 in Java

Thursday, July 26th, 2007

It turns out that if your Java app is getting IPv6 addresses back from InetAddress.getLocalHost().getHostAddress() you can use flags to the Java VM to control this behaviour

-Djava.net.preferIPv4Stack=true

if you only want IPv4 addresses returned, or

-Djava.net.preferIPv6Stack=true

if you need to test your code against IPv6 addresses. These flags are only valid when passed to the JVM when it’s started up (ie they can’t be changed once the App’s running).

Some of QuickTime 7.2’s other changes

Thursday, July 19th, 2007

mostly via the quicktime-java list.

QuickTime for Java doesn’t let you access B-frames

Thursday, March 29th, 2007

From a a post to the QuickTime-Java mailing list, Apple’s response regarding QuickTime exception -1409=Unknown:

QuickTime for Java currently provides no B-Frame sample-level support. The movie FigtreeChurch.mov, as provided by you, is encoded using H.264 (Main Profile) which utilises B-Frames. As verification, replacing FigtreeChurch.mov with a movie of another codec type functions with the your application as expected.

Chris Adamson (author of QuickTime for Java: A Developer’s Notebook) says:

QuickTime 7 adds new image compression API’s, which were necessitated by the addition of the frame-reordering H.264. These API’s, like ICMCompressionSessionEncodeFrame, were never wrapped by equivalent QTJ calls, and sending the new codec to the old image compression API produces an error.

Upgrading EasyX509TrustManager source

Saturday, February 24th, 2007

If you’re looking to update your Java source for EasyX509TrustManager.java or EasySSLProtocolSocketFactory.java to Java 1.5.x then you can find the updated versions in Apache’s Jakarta SVN repository (Because they weren’t immediately obvious to me when I was googling).

A Day of Apple Fixes

Monday, February 19th, 2007

So, no sooner had boxed up the Intel Xserve and filed my bug report about Java bus erroring than Apple released a Java update (Java for Mac OS X 10.4, Release 5), a Daylight savings timezone patch, and a 2007-002 Security update, addressing several of the bugs mentioned by the Month Of Apple Bugs site (I’m not going to link there again as they’ve got an image that attempts to exploit a security hole posted on their site).

Finder lag

Tuesday, February 13th, 2007

I’m hunting QuickTime for Java bugs on an Intel Xserve, so I’ve got this loop dumping out 100 copies of a hinted 3gp movie. I’ve got a Finder window in list view open on the machine to check that the files are being written out. Of the 100 movies dumped out, 18 of them are 160k, 3 of them are 4k, and the rest are 100k bytes in length. Bizarrely all the movies play properly, and are the same length in bytes (via the Get Info window). “ls -l” also lists them as the same size.

Closing the Finder window and refreshing it now shows me all the file sizes as 100k. Sigh.

On the plus side, the test case has crashed Java at least once :)

Intel Xserve

Friday, February 2nd, 2007

Got a chance to lay my hands on an Intel Xserve this week (thankyou Apple!), so here are some of my impressions. Not that I’ve ever unpacked an Xserve before, but it comes with a big plastic bit bolted on the front to protect the drive bays during shipment.
Plugging it in (two power cords!) then it’s time to find a mini-DVI to VGA cable (you’d think when you pay AU$11000 or thereabouts for a machine that it might come with a video cable, even if you do want to run it headless) and option-boot it off the Mac OS X Server install DVD. I’ve got a Microsoft mouse plugged in at this stage, and the Open Firmware (ok, I mean EFI :) boot selection screen doesn’t quite talk to the mouse correctly, such that the cursor can only be scrolled up and down (not left or right). Fortunately the tab key still works so I can select the boot DVD and restart with the ‘return’ key.

Erase and install is uneventful. The setup process now lets you set up the lights-out management on either the default or a different IP address.

The machine is quite loud though. Server Monitor tells me that everything’s normal, including temperature and fan speed. Fortunately it’s in the server room and not in my office. Server Administrator has cool graphs showing the load on the quad 64-bit Xeon CPU’s :)

Of course, one of the power cords isn’t quite arranged correctly, so I just have to unplug one of them to see the dual power supplies at work. It doesn’t miss a beat. Sweet. I especially like this as I know so many people who’ve had their machines go out because the UPS has failed (after all, adding another device to the power supply chain is adding another point of failure). I’d hedge my bets and plug one cable into the UPS and one into the mains, both on separate circuits, if possible.

Strangely Apple Remote Desktop doesn’t seem to be version 3, which is what I would have expected. It ships with Mac OS X Server 10.4.8 Build 8N1215. It has Java version 1.5.0_06-113 and “JavaVM 1.5.0_06-68, mixed mode”, which is not what ships on anything else as far as I know. Fortunately everything will be brought into parity with other Macs as of Mac OS X 10.3.9 which is due out Real Soon Now.

Of course the reason I’ve got the Xserve is that it’s got a slightly different OS (and other) installation to all other Macs, which means it brings with it its own bugs. Sadly that means I’ll be using it for debugging, not for Cool Stuff(TM). Now all I need is to be able to afford one myself. And a nice soundproof rack. And room to put it…

  • JoyOfTech

  • Recent Comments

  • Was it useful? Was it funny? Was it weird? Please tip the author!
  • Pages

  • Archives

  • Meta