Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.apple.eawt.Application can not be resolved to a type (in class OSXAdapter) #1400

Open
scasadei opened this issue Nov 24, 2023 · 5 comments
Assignees
Labels
update-needed There is old code or library usage that needs to be updated to work with current Java or libraries

Comments

@scasadei
Copy link

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)
OSXAdapter-Screenshot 2023-11-24 at 6 01 46 PM

@AngledLuffa
Copy link
Contributor

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;

@scasadei
Copy link
Author

It doesn't help

@AngledLuffa
Copy link
Contributor

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?

@scasadei
Copy link
Author

Nothing depends on OSXAdapter, so I have simply removed it for the time being. Thank you.

@manning
Copy link
Member

manning commented Jan 3, 2024

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.

@manning manning self-assigned this Jan 3, 2024
@manning manning added the update-needed There is old code or library usage that needs to be updated to work with current Java or libraries label Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
update-needed There is old code or library usage that needs to be updated to work with current Java or libraries
Projects
None yet
Development

No branches or pull requests

3 participants