downloading java 7 for the mac and a ubuntu linux vm

I’ve been thinking about setting up a Linux VM on my Mac for a little while now.  I already have a Chrome VM.   While I installed Java 7 on my Mac yesterday from Open JDK, I also wanted an “official” version.  In case I come across anything odd, I want a way to know if it is from the Mac version being not quite ready or “the way things work.”  Which gave me a reason/excuse to install the Linux VM.  This blog entry is about how to get started.

WARNING: Java 7 is not yet production ready.  See Java 7 Ships with Severe Bug.  (it has to do with loops not functioning properly and affects Lucene and likely other things.)

For the Mac

Download and install

  1. Download Java 7 dmg file
  2. Install it
  3. Optional go to Java in system preferences to choose Java 7 as default.  (I did not do this since it sounds experimental with known buts at this point.)
  4. Note the install location to reference is /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/bin.

Pointing to Java 7

Since Java 7 has reported stability problems, I didn’t want to set it in my PATH but only use it for selected command line invocations.  To facilitate, I set up the following in my .bash_profile:
alias javac7='/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/bin/javac'
alias java7='/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/bin/java'

To validate the aliases are working:

Jeanne-Boyarskys-MacBook-Pro:~ nyjeanne$ javac7 -version
javac 1.7.0-internal
Jeanne-Boyarskys-MacBook-Pro:~ nyjeanne$ java7 -version
openjdk version "1.7.0-internal"
OpenJDK Runtime Environment (build 1.7.0-internal-b00)
OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode)

Linux VM on VirtualBox

Download and install

  1. Download ubutntu iso file.   It took a number of hours to download the iso file.  (I let it run overnight.)  While the download was less than 100MB, I downloaded Lion the night before (over 3GB) so my ISP may be throttling my connection speed now.  That or a slow server.  Note that you don’t need to create a USB stick or CD.  Just the iso file is fine.
  2. Create a new VirtualBox VM and set CD drive to read from the downloaded iso file.  Even those these instructions are for Windows, they were easy to follow on a Mac.
  3. Try to downloadthe .tar.gz file for Java 7.  I got a page not found so I tried the .rpm file.  This gave me errors when I installed and tried to run it.
     javac -version gave:
    Error occurred during initialization of VM.  java/lang/NoClassDefFoundError: java/lang/Object
  4. Deleted the bad install.
  5. Tried again to download the .tar.gz file for Java 7.  This time the path was found.

Pointing to Java 7

Since my Linux machine is a VM specifically for trying Windows 7, I felt safe adding it to the beginning of my PATH in the .profile file.

A really simple Java program

A really simple program using a Java 7 feature to further test your setup.

<pre>import java.util.*;

public class JeanneTest {
  public static void main(String... args) {
    Set<String> test = new HashSet<>();

Apple OS X Lion Review

Shortly after downloading and installing Apple’s new Mac OS X Lion this morning, I started compiling a list of what I liked and what I did not like. My excitement began to fade as I realized there was a lot I was not going to enjoy about Apple’s new OS. After spending the morning with OS X Lion, I present a review that highlights both the good and bad of the new OS, along with tips to revert some new, possibly unwelcome features.

The Good

1) Launchpad: Launchpad is a new user interface component, which allows you to view the Applications on your computer in an iOS-like fashion. While I am not sure I will use this new interface, I like that Apple is trying to bridge the Desktop OS X and Mobile iOS worlds with a more consistent interface.
2) Mission Control: Although this feature is a bit recycled from Exposé, I do enjoy the new look and organization of the application overview.

3) Easy Access to DVD Media: When OS X Lion was first announced, there was a lot of uproar about the digital-only release. There were many who worried about how to do a fresh install of Lion on a new hard drive and the instruction, purportedly from Steve Jobs, that they install an old version of Mac OS then upgrade to Lion was met with a lot of online criticism. Most of those issues have since disappeared as Apple has provided a method, possibly unsupported, for creating a DVD image of the downloaded Lion installation. The steps are extremely easy and I had the DVD created within minutes of downloading. I tested the DVD on another Mac in my household, as the OS X license permits up to 5 installations, and the DVD worked without issues.

4) Full-screen Applications: The ability to load applications in full-screen was first introduced in iLife about a year ago and has now been extended throughout the OS. As someone who values screen real estate, the new feature is a welcome addition, especially if you are using an 11″ MacBook Air.

5) New Coat of Paint: The overall graphical interface for Lion is a lot more crisp and appealing, succeeding with that ‘lickable’ aspect Apple is known for.

6) Java Support: Like the DVD media issue, there were a lot of rumors predicting the end of Java on OS X Lion that have turned out to be false. Although there is some evidence to suggest Apple will be taking a backseat to integrating Java with the OS in the future, they have already posted a Java 1.6 release available as a separate download. They have also added an automatic download feature that detects when Java is required and automatically installs it. For example, the first time I started Eclipse, Java 1.6.0_26 (64-bit) was retrieved and installed within seconds. In short, Java is still very much alive and well in OS X Lion despite rumors to the contrary.

The Bad

1) Microsoft Office 2004 Dead: OS X Lion removes Rosetta compatibility, which means older applications such as Word, Excel, or PowerPoint 2004 will no longer load. In fact, Lion highlights such applications as shown in this screenshot. I am actually a big fan of Office 2004, as I have used more recent versions and been turned off by the annoying ribbon interface. Office 2004 was one of the best versions of Office and is now completely dead in Lion.

2) Slow: Ever since I started is up, OS X Lion has had an unreasonably slow user interface, especially in terms of responsiveness. As early as the login screen, I had to wait 10+ seconds after selecting my username to enter my password. My computer may not be fresh off the assembly line but it is still a somewhat new high-end MacBook Pro, so I’m shocked at the user interface delay in loading and using programs. Even loading System Preferences and the OS X Updater took a lot of time.

The reason for these delays may be that Spotlight runs a re-index of the hard-drive immediately following installation, but I’ll have to wait until it is finished to know for sure. Initially, Spotlight reported “4 weeks remaining” but that has since changed to 7 hours, which is better, but still a lot of time to wait. The extra process is also causing the temperature to spike and it practically burns my hand to type right now. It’s like taking a new sports car out on the road but not being able to go above 5 miles per hour, while the seat slowly burns your legs. It certainly diminishes the initial user experience after installation and should have been scheduled to occur at a later time.

Update [7/22/2011]: After Spotlight finished re-indexing the hard-drive and Time Machine ran its multi-gigabyte backup, the computer is running much better again. I still notice some impact lag when typing passwords and launching certain applications, but I can’t say for sure if this was much different than before I upgraded. In retrospect, I still contend Spotlight should have postponed its re-index of the hard-drive as this created a poor user experience immediately following installation.

3) Unnatural scrolling: For some reason, Apple decided to reverse the scroll direction. Up is down, down is up, left is right, etc. According to the documentation is this a more ‘natural’ approach, but from a user interface perspective reversing such a now-key part of the user interface is ridiculous. Luckily there is a way to disable this ‘feature’. Open System Preferences, select Trackpad, and uncheck the option for Scroll direction: natural. On older Macs, Apple presents this in a different manner, and to disable it, uncheck When using gestures to scroll or navigate, move content in the direction of finger movement

4) Launchpad + Parallels: One area where I found this particularly troublesome is if you have Parallels installed, it lists dozens, or even hundreds, of Parallels applications in Launchpad, often outweighing the number of OS X applications. This may not bother a lot of people, especially those that keep Parallels open at all times, but was extremely frustrating for myself. These items can be removed from Launchpad by opening Parallels and selecting the virtual machine. Then from the menu bar then select Virtual Machine, click Configure, select Applications, then uncheck Share Windows applications with Mac.

5) iChat Single View: iChat has been updated to automatically merge multiple buddy lists into one. Some people may like this feature, but I found annoying that it was enabled by default. Lion also overwrote many of my default preferences, such as hiding the hundreds of Offline Buddies on my list. None of these are killer issues, but did annoy me the first time I loaded iChat. To disable it, select Preferences from the menu bar, click General, and uncheck Show all my accounts in one list.

6) iChat won’t save account passwords: I’m having an issue that every time I start iChat I need to enter passwords for each of my accounts, despite having previously saved them in my keychain before the upgrade as well as checking the box to save them in my keychain now. I haven’t heard anyone else report this issue yet, but something seems buggy here.

Update [7/22/2011]: One website suggested my iChat preferences had been corrupted. The fix is to navigate to ‘/Users//Library/Preferences’ and delete all* files. You must then log out for the fix to work and re-setup iChat the next time you log in. I’m pleased to report this solution does work and I can now open and close iChat without having to reenter my passwords each time it starts up. Has anyone else installed OS X Lion, only to have their iChat preferences corrupted?

Some users have reported similar issues with Calendar passwords after upgrading to OS X Lion in which the solution was also to manually delete user Library files.

7) Adobe CS2 Dead: As Adobe has pointed out CS2 and earlier versions of its products do not function in OS X Lion due to the same Rosetta issue that disabled Microsoft Office 2004. More recent versions, such as CS3/CS4/CS5 still have a number of issues as Adobe spells out in its release notes.

Some components of Photoshop, such as Droplets, the automation creation tool, were sloppily implemented in PowerPC even in recent Intel-based versions of Photoshop. Adobe has released an update for CS5, although it is not clear if they will be updating CS3 or CS4, but given Adobe’s update history for older versions of it’s product, it seems unlikely.


Overall, I’m about 35% happy with OS X Lion. While I like the streamlined interface, new Mail client, and increased feature set, I can’t help but think they needed to spend more time on this. The erasing of many of my existing settings throughout the OS and applications, as well as needing to wait hours for the computer to finish running Spotlight before I can use it without burning my hands, leaves a bitter taste in my mouth. The biggest showstopping feature is the lack of support for Microsoft Office 2004, as I consider this version to be superior to many of the newer versions. More of my impressions will follow as I get more familiar with the many new features of this OS.

first weekend with my new mac

I got my first Mac in 12 years a few days ago.  On Friday, I was able to surf the net.  Now I’ve advanced to doing almost everything I need except for development tools.

What I liked a lot:

  1. It still feels like home
  2. The trackpad lets you scroll so easily.
  3. iChat – thanks Scott! – only important setup was to check the box to automatically save transcripts on the messages part of preferences.
  4. My laser printer worked out of the box. I didn’t need to configure anything!
  5. Ejecting a CD/DVD is a lot more intuitive now than ejecting a disk was on the old Macs. Hmm, is dragging the disk to the trash can going to eject it or wipe it clean. The current icon to eject matches DVD players and is something most people are used to. There’s even a physical button on the keyboard. I also notice that dragging a disk to trash is still an option. This is actually nice in that it doesn’t change the behavior users who have been around a long time are used to. I was upset at how Windows moved everything in Office 2007 as I now waste time finding features. Apple moved things, but not in a way that makes them hard to find.
  6. Having a real UNIX command line and real UNIX system under the hood.

What I found unintuitive: (none of this is terrible, but it takes a little getting used to)

  1. When I wasn’t in stretch resolution, the browser didn’t extend to use the full screen real estate. I get that this is a “feature”, but if all I am using is the browser, I want to use the whole screen!
  2. To look at the site stats for this blog, one needs Flash. The first time I went to that page in Safari it said “missing plugin.” Fair enough. I click on it and get a message that the type is unspecified. This is probably WordPress’s fault and not Apple’s, but still unintuitive.
  3. I keep forgetting that there isn’t isn’t a pop-up when a download has started and then I start it twice. I have to remember to check the downloads list to see it is in progress. Some visual feedback on .dmg files would be nice. (It looks like if I already have the download window open, it does come to the front.)
  4. I understand why secondary clicking is off by default on the trackpad – whether you want bottom right or two finger touch is a personal preference. The default of neither is a surprise though. “right clicking” to choose a command is pretty common.
  5. How to find Mac Help – go to finder and choose help/mac help
  6. I blame Google or Adobe for this since other sites work just fine, but I have the problem where the cursor disappears in plain text mode when using the arrow keys.  The solution will be to get used to using rich text mode.  This was reported over a year ago and I can’t believe nobody fixed.
  7. How to run something as root/admin: “sudo command”.  This *should* be non-intuitive so people don’t do it by accident!
  8. Closing an app via the red x doesn’t release resources. This is actually easier to remember now as it shows up in the Doc. You actually need to quit the app.  This I did remember from last time, but it isn’t obvious.

Interesting configuration:

  1. I understand why secondary clicking is off by default on the trackpad – whether you want bottom right or two finger touch is a personal preference.  The default of neither is a surprise though.  “right clicking” to choose a command is pretty common.
  2. Need to enter your admin password when installing Flash but not Chrome.
  3. Turn on status bar in Safari so can see URLs before click on them.

Some maintenance tasks:

  1. Let battery run down to zero
  2. Checked all hardware works
  3. Print Safari keyboard shortcuts and Mac OS X keyboard shortcuts to start learning them.
  4. Buy a Mac wired keyboard.  I wanted the number pad and navigation options.  I also prefer not to have to replace batteries in as many things.
  5. Buy external hard drive.  Time machine is very easy to use.  Plug it in and go.
  6. Copied files in My Documents folder to Mac via a flash drive.

Installed after first day:

  1. Flash
  2. ClamXAV – Consensus says you don’t need anti-virus. I feel better having it though and know at least one person who does on a Mac. I think it’s cool they include in the feature list that you can use regular expressions!  Not that I’ll need to, but it’s nice someone thinks it is important.
  3. Open Office – The editing I do on my home computer is pretty light.  Except for the time I was preparing for The Server Side Java Symposium and needed PowerPoint.  I’ll cross that bridge when I come to it.
  4. Skype
  5. Dropbox
  6. Postgres and pgadmin – I got a message “Your system seems to be set up with less than 32MB shared memory”.  The postgres readme clearly explained what to do about it.
  7. Tomcat – this was the first thing I downloaded that assumes you know Mac is a UNIX system.  Granted postgres required that knowledge to install, but not to download.  Not a bad assumption since it is a developer tool of course.  I didn’t untar it/install since I’m not up to testing an application locally yet.
  8. Assorted Safari plugins.  (this seems like a good blog post in itself).  I will say at this time that I like how fast the plugins install.  The first two I tried didn’t work until I restarted Safari.  Would have been nice to a prompt to this effect.
  9. Regular readers of this blog may note that Eclipse is not on the list.  Since Indigo comes out in about a week, I’m going to wait for that to install Eclipse.  I can do any development on my old machine until then.