Com. Apple. Eawt - What Exactly I Should Install

I'm using Max OS X Mountain Lion, java -version returns "1.6.0_37". But I cannot compile project with com.apple.eawt.* classes imported.

What I have to install to have Apple Java Extensions on my system?

Any help would be appreciated!

Update:

I receive following error from compiler:

java: package com.apple.eawt does not exist

Update-2:

XCode version 4.5.2 is installed

Update-3:

The reason of my problem was missed ui.jar in classpath. Thanks to @Ian Roberts

3

4 Answers

There is no JAR to download or anything extra to install, the classes are part of the JDK on Mac OS X. In Apple Java 6 JDKs they live in Contents/Classes/ui.jar under the JDK bundle (e.g. /System/Library/Java/JavaVirtualMachines/1.6.0.jdk or /Library/Java/JavaVirtualMachines/1.6.0_37-b06-434.jdk), on Oracle Java 7 they are in lib/rt.jar under the JRE home directory (/Library/Internet Plug-Ins/ or /Library/Java/JavaVirtualMachines/jdk1.7.0*.jdk/Contents/Home/jre).

6

Solution for Java 9 and later

In JDK 9, internal APIs such as those in the Mac OS X com.apple.eawt package will no longer be accessible.

see:

com.apple.eawt has been replaced.
Some of the features are covered here:

An example implementation of setting the dock icon in mac os can be found here:

1

Just in case you're still looking and anyone else hits this, the MacOS GestureUtilities are still available for that platform. See What replaces GestureUtilities in Java 9

Just like any other external library, you have to add the JAR containing those classes to your classpath. Just because you are running on a Mac does not mean the stock Java JDK is 'extended' -- otherwise, it would not be truly platform-independent.

4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article
Twitter Facebook Pinterest