Com.apple.eawt - what exactly should I install

I am using Max OS X Mountain Lion, java -version returns "1.6.0_37". But I can not compile the project with imported com.apple.eawt classes. *.

What do I need to install in order to have Apple Java Extensions on my system?

Any help would be appreciated!

Update

I get the following error from the compiler:

java: package com.apple.eawt does not exist 

Update-2 :

Installed version of Xcode 4.5.2

Update-3 :

The cause of my problem was missing ui.jar in the classpath. Thanks @Ian Roberts

+9
java osx-mountain-lion macos
source share
3 answers

There is no JAR file to download or anything extra to install, classes are part of the JDK on Mac OS X. In the Apple Java 6 JDK, they live in Contents/Classes/ui.jar in the JDK package (for example, /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 located in lib/rt.jar in the JRE home directory ( /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home or /Library/Java/JavaVirtualMachines/jdk1.7.0*.jdk/Contents/Home/jre ).

+5
source share

Like any other external library, you must add a JAR containing these classes in your classpath. Just because you work on a Mac does not mean that the JDK for Java is โ€œexpandedโ€ - otherwise it will not be truly platform independent.

0
source share

Solution for Java 9 and later

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

see: http://openjdk.java.net/jeps/272 (later methods have been moved to java.awt.Taskbar)

com.apple.eawt been replaced.
Some features are described here: https://docs.oracle.com/javase/9/docs/api/java/awt/Taskbar.html

An example of how to configure the dock icon in Mac OS can be found here:
stack overflow

0
source share

All Articles