Monday Aug 18, 2008

JDK 6 and JavaFX on 32-bit Macs

Dearest Apple. Words cannot express my feelings towards you. Therefor allow me to use punctuation and special characters: @#$%\^&\*!!? :-p Yours Truly.

\*SIGH\* If you have one of the 2006 Intel Macs with 32-bit processors, you guessed what I'm talking about: In spring '08, Apple finally released the Apple JDK 6 (or as they call it, "Java for Mac OS 10.5"), but for 64-bit processors only. And there is no sign this will change soon: On Mac hardware, Mac OS X 10.5.2 and an Intel Core 2 processor are the minimum requirements for the JDK 6 -- and also for JavaFX.

Apart from switching to Windows or Linux, or buying new hardware, the only alternative for developers who don't meet those requirements is the Soy Latte JDK 6. Using this JDK solves a few problems but also raises some others. You have to decide whether the pros out-weigh the cons in your work situation:

Pro

  • You can use the JavaFX SDK on top of the SoyLatte JDK
  • IDEs like NetBeans work with SoyLatte (you're not stuck on the command line)
  • No need to buy new hardware for JDK 6 / JavaFX development

Con

  • Must use X11 whose user-interface needs getting used too (shortcuts, menus).
  • Installation is less straight-forward than installing the Apple JDK
  • No support for Java Web Start (javaws) yet

I tried it out at home over the weekend, and kept notes, so if you too want to set up the SoyLatte JDK and JavaFX on a 32-bit Mac, have a look at this tech tip and leave a comment what you think.

Wednesday May 28, 2008

Developing Java ME on Mac

As Karel already mentioned a few weeks ago, the Mobility pack can also be used on MacOS. (The mobility pack is written in Java and does run on Mac OS, but there is no current official WTK and no emulators for Mac OS, so netbeans.org never offered this download option.) Since people asked about it, I tried to install the third-party SDK and emulator and ran a sample app, and ta-daa, it worked. :) Here are a few "Doh!"s I came across, I'll write them down in case somebody else has the same questions.

  1. Installing NeBeans Mobility pack for Mac
    • There is no download explicitly labeled "Mobility pack of NetBeans for Mac OS" or so on the NetBeans Installer page. Instead you download any other Java edition for Mac OS, for instance the Java SE edition. (Or use the one you already have.)
    • Then you go to the Tools>Plugins menu, and install (at least) these two plugins: "Mobility" and "Visual Mobility Designer" (you can also install other items you need).
    • In other words, don't look for a plugin explicitly called "mpowerplayer" or so. The Mac integration is part of the normal "Mobility" plugin now.
  2. Installing mPowerPlayer
    • Next download the SDK for Mac OS -- click the "Get the SDK: Download..." link.
    • Then download the emulator for Mac OS -- click the "free download" button.
    • Remember the directory where you downloaded the stuff to. :-) The SDK is saved as mpp-sdk, the emulator is called mpowerplayer.app. I copied them into the "/Applications/" directory.
  3. Telling NetBeans where to find the JavaME platform
    • Go to the IDE's platform manager (Tools menu) and add the mpp-sdk as a "Java MIDP Platform emulator". (If needed you can get more details how to do that on the FAQ).
    • When you now create a new Mobile project, the MPowerPlayer SDK and QVGA device will show as options.
  4. Limitations?
    • You cannot use the CDC framework yet, this implementation is only meant for CLDC/MIDP.
    • You get a working emulator together with mpowerplayer, but it's only one. This is because emulators are released by phone companies, but they never released any for Mac OS. So you have to go back to a PC (e.g. on a virtual machine) to get one emulator for each type of phone if you want to do any serious crash-testing of your mobile apps.
    • Tip: Instead of using different emulators, you can test the app on actual devices that you have. Use the help menu in the IDE and search for "deploy to mobile device" to learn more, but some devices don't come with software to connect to Mac OS, so you may be out of luck.

Friday Dec 14, 2007

JDKs for MacOS?

Yesterday, Apple released a JDK update! :-)
... for JDK4 and JDK5. \*sigh\* :-[

Let's hope the update does something useful. The "more info" link offered by the Software Updater in the German locale was a 404. I searched the Apple support center and only came up with this English info page (which alas doesn't contain more info, but repeats what I already knew, "it's an update").

Also this week, Apple felt compelled to release a little article about Java and Mac OS 10.5 (Leopard). Don't hold your breath. As much as I appreciate Apple improving their Java profiler, and adding support for 64-bit apps, yadda yadda, it's still a pity the whole article says no word about the Apple JDK 6. \*sigh\* It doesn't even contain the number 6. \*SIGH\* (Although it contains the digit 6. I checked.)

I still have the JDK 6 Dev Preview released by the Apple Dev connection (a download which seems now gone from the ADC.) Why does Apple develop their own JDK? They do it so they can add these guys to it. (Why they do it so slowly, I don't know.) If you want to know what Java on the Mac looks like without those typical controls, have a look at this BSD port of JDK6 for Mac OS 10.4 and 10.5: Soy Latte JDK 6.

You can download SoyLatte into any directory you like, then expand it (I used bunzip2 soylatte16-i386-1.0.tar.bz2 and tar -xf soylatte16-i386-1.0.tar in the Terminal), and then symlink to it from /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home, so NetBeans can find and identify it as a JDK in the Java Platform manager. Afterwards don't forget to go to the properties of the project you want to use it with, and switch it to use the SoyLatte Java platform.

It seems to make sense to place SoyLatte in the /sw/ directory, but if you save it to a directory in your home dir instead, then you can compile and run the demos and samples that come with it as normal user. I do have X11 installed, but I haven't figured out how I can make NetBeans run the demos directly in X11, although it readily recogizes the projects as netbeans projects. (If you figured it out, leave a comment.) If I run the samples from the commandline in the X11 terminal, they don't look pretty ;-) (as expected), but they work well.

In case you like SoyLatte so much that you want to get rid of the developer preview jdk, read Joshy's blog.

PS: Two people asked recently, so if you don't know either how to set up the javadoc popups in netbeans, here's an 'F'AQ answer to you.

About

NetBeans IDE, Java SE and ME, 3D Games, Linux, Mac, Cocoa, Prague, Linguistics.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
News

No bookmarks in folder

Blogroll