Showing posts with label Mac OS X. Show all posts
Showing posts with label Mac OS X. Show all posts

Tuesday, April 3, 2012

Apple iMac Harddrive Replacement

Needed to replace the Harddrive on an Apple iMac. This is a white plastic Intel iMac. After removing all screws from the bottom (where the memory modules are also installed), the back of the case can be pulled off, starting at the bottom, with a 'crack'. There's a lot of aluminium-backed tape inside, and after removing the LCD panel the hard drive becomes accessible.

The original drive was 160GB. A 250GB replacement was found for around $60 (3.5", SATA).

Then it came to re-installing the operating system from DVDs, where I ran into two surprises:
  1. No disk found.
    With Linux, installing an OS from DVDs is fairly straight forward. You are guided through partitioning the hard drive etc. With OS X, I was expecting it to be even easier, but wrong: The installation asks you to select a hard drive for the installation without offering anything. Solution: Close the installer, select Tools/Disk Utility from the menu to format and partition the drive. When installing again, you can now select the drive.
  2. Can't eject the disk??
    When prompted to insert the second installation DVD, I could not figure out how to eject the first one. Nothing worked. Finally I learned that the drive was empty ... I had not fully re-assembled the case because I first wanted to check if everything "worked". When the iMac ejects a DVD, it's usually kept half-way in the drive because of the felt lining of the DVD slot. This time, the iMac had ejected the first OS installation DVD, it had rolled of the table and vanished under some cubboard. From the outside, I could not tell if there's a DVD in the drive or not. Since I didn't remember ejecting the DVD nor saw one in the usual half-out-of-the-drive position, I had assumed that it's still "in"....

Tuesday, January 18, 2011

Eclipse Build Path Problem After Mac OS X Java Update

In early January 2011, I received a Mac OS X Software Update that included Java changes.
This was on a Mac that had been upgraded to Snow Leopard, so older Java setups were still present, but this update must have removed older JVMs and JDKs.

As a result, Eclipse builds would fail with this error:
The container 'JRE System Library [J2SE-1.5]' references non existing library '/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/laf.jar'
In general, the OS X Java setup changed from using
/System/Library/Frameworks/Java.VM.framework/Versions/...
to using a path like
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

After going to Eclipse/Preferences/Java/Installed JREs and "Add..."ing a new JVM that uses the above path with ".../JavaVirtualMachines/..." all is fine again. You might have to look for the full path to that .../Home in a terminal window and copy/paste it into the Eclipse preference dialog, because the "Browse" button in the dialog might only show the 1.6.0.jdk as a package, not as a subdirectory into which you can drill down.

Next issue: You might not have a src.jar in that JDK to be able to view the Java sources, so you cannot view the source code for String, Map, ... and the other standard Java classes. That's because the default JDK is really more like a JRE.

After downloading the Java Development package from the Apple Developer Connection, something like javadeveloper_10.6_10m3261.dmg, you get a new JDK in

/Library/Java/JavaVirtualMachines/1.6.0_22-b04-307.jdk

and that one has a Content/Home/src.jar.
Note that the JDK that you install yourself, the one that includes the sources, is under /Library/Java/... while the Java stuff that comes with the OS is under /System/Library/Java/...

Eclipse should automatically detect the src.jar in the JDK that you install.

Note on finding the Java Development package as of August 2011:
  • http://developer.apple.com/
  • Member Center
  • Dev Centers: Mac
  • Resources
  • Mac OS X Developer Downloads
  • Java
  • Java for Mac OS X ... Developer ...