I have been using com.apple.eawt
to implement the OS-X About/Prefs/Exit items in the Application menu. This worked fine until Java 8. I can see com.apple.eawt
in the JDK 1.8 library, but I can't seem to be able to access it.
I am using OS-X 10.13.6 and Java Version 1.8.0_201 and compiling with NetBeans 8.1.
Here's the code of a test app I wrote to show the problem:
package j8test;
import com.apple.eawt.*;
public class J8Test {
public J8Test() {
com.apple.eawt.Application.getApplication().setDockIconImage(null);
System.out.println("*** OK ***");
}
public static void main(String[] args) {
new J8Test();
}
}
When I try to build it, I get the following errors:
Compiling 1 source file to /Users/rcordes/Documents/TeamFlow/J8Test/build/classes /Users/rcordes/Documents/TeamFlow/J8Test/src/j8test/J8Test.java:4: error: package com.apple.eawt does not exist import com.apple.eawt.*; /Users/rcordes/Documents/TeamFlow/J8Test/src/j8test/J8Test.java:10: error: package com.apple.eawt does not exist com.apple.eawt.Application.getApplication().setDockIconImage(null); 2 errors
Here is a screenshot of the NetBeans project: