CoreNLP
CoreNLP copied to clipboard
com.apple.eawt.Application can not be resolved to a type (in class OSXAdapter)
Hello, in OSXAdapter, line 16 below:
13 public class OSXAdapter extends ApplicationAdapter { 14 15 private static OSXAdapter adapter; 16 private static com.apple.eawt.Application app;
the compiler says com.apple.eawt.Application can not be resolved to a type, even though, according to eclipse, com.apple.eawt.Application.class is on the build path (see attached screen shot)
Could the problem be that the Application
package is not specifically imported? What happens if you add this to top?
import com.apple.eawt.Application;
It doesn't help
Maybe this has something to do with it?
https://stackoverflow.com/questions/13978471/com-apple-eawt-what-exactly-i-should-install
According to people on that page, Java 9 on Mac no longer has that package. I don't really know anything about this, and I wasn't planning on doing Java dev on Mac any time soon - too much other stuff on my plate right now.
@manning any thoughts on replacing this?
Nothing depends on OSXAdapter, so I have simply removed it for the time being. Thank you.
Yeah, this is a to-do! com.apple.eawt.*
was the ancient Apple-written code to support Java apps under the macOS GUI. It was discontinued and replaced by (Oracle-supported, in the JDK) java.awt.Desktop
methods. We should move to using it, but the slight catch is that the new methods were only added after Java 8, so the straightforward move would be from supporting Java 8 to a minimum level of Java 11. However, maybe the amount of stuff is small enough that we could use reflection and then it would compile on Java 8+ but TregexGUI would only run on Java 11+. At any rate, having the code with com.apple.eawt.Application
is useless for everybody, since it won't run on anything except an archaic version of macOS (OS X 10.9 or earlier, i.e., 2014 or earlier).
Maybe I'll try to fix this this week so that I feel like I've actually done something useful for 2024.