3

I have recently started learning java and I am working/improving on a java IDE. I'm trying to find a way so that when you double click a file, the file is automatically opened with my program.

So far the only way I have found to do that is by using the apple extension com.apple.eawt (question found here). The only problem is that I have JDK 1.8 and this extension no longer works. Following this question, I looked for it on my computer and I believe it was last included in JDK 1.6.

My questions are: is there a way to use this extension in java 1.8? Or is there an Apple or non-Apple replacement that will do the same?

Thunderforge
  • 19,637
  • 18
  • 83
  • 130
H.Arias
  • 81
  • 6
  • The following link might be of some help http://stackoverflow.com/questions/24479016/how-to-get-apple-java-extensions-com-apple-eawt-work-on-jdk-7-and-higher – copeg Jul 14 '16 at 18:49
  • @copeg thank you I'll look into it, would you happen to know if an extension or anything that would allow me to do this on any OS not just Mac? – H.Arias Jul 14 '16 at 19:18
  • I do not know of any. – copeg Jul 14 '16 at 19:24

1 Answers1

5

Java 9 has replicated most of com.apple.eawt in the java.awt.Desktop class

For instance, you pointed to a question that recommended using Application.getApplication().setOpenFileHandler(myOpenHandeler).

This is equivalent to Desktop.setOpenFileHandler(OpenFilesHandler openFileHandler).

This functionality is also now available on platforms other than macOS, such as Windows.

Thunderforge
  • 19,637
  • 18
  • 83
  • 130