how can I develop Apple Java Extensions on Windows?

前端 未结 5 2028
时光说笑
时光说笑 2020-12-17 18:31

When I do multi-platform testing on Windows it gets annoying that Eclipse shows errors in the project because of the com.apple.eawt code that I have in a special Mac customi

5条回答
  •  既然无缘
    2020-12-17 19:32

    Put the OS X specific code in a separate class.

    In your main code, use reflection to see if one of the Apple classes are present (or a Class.forName), and if so, THEN invoke the separate class above. I cannot remember if you can do that safely just by calling it, or you need to invoke the separate class by reflection too.

提交回复
热议问题