且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Objective-C Mac应用程序中使用Java库,并将该应用程序放在Mac App Store上

更新时间:2022-12-21 09:36:24

@Andrew - 简而言之,如果您正在做的事情非常简单(并且不接触使用java的库) .awt或java.swing)然后GCJ /可以/工作。我根本不会推荐它。我之所以这么说是因为GCJ不支持/很多/更新的'java'功能,除非你的java代码是针对旧版本的JDK编写的,否则你会遇到编译问题。如果您使用外部第三方代码编译,即eclipse.anything等,您将遇到巨大的麻烦。

@Andrew - in a nutshell, if what you are doing is very simple (and doesn't touch libraries that use java.awt or java.swing) then GCJ /could/ work. I wouldn't recommend it at all really. The reason I say that is because GCJ doesn't support /many/ of the 'newer' java features and unless your java code is written targeting an oldish version of the JDK, you're going to run into compilation issues. If you compile with external 3rd party deps ie eclipse.anything, etc you will run into huge headaches.

我假设您已经用java编写并且想要的代码将该代码作为服务用于更好的(和本机)objc UI。如果是这样的话,那么说实话,我认为你会发现更多的成功,更不用说只是咬紧牙关并为你的服务层创建一个objc代码库:(

I assume you have code that you have already written in java and want to leverage that code as a service to a much nicer (and native) objc UI. If that is the case, then honestly, I think you will find much more success and far less headache just biting the bullet and creating an objc codebase for your service layer :(

当然,可以选择使用本机mac ui作为基于云的分布式服务层的瘦客户端(用java ofc编写)。但我不确定苹果对基于Web的瘦客户端的看法/方式他们的应用程序商店中的服务。

Of course there is the option of using the native mac ui as merely a thin client for a cloud-based distributed service layer (written in java ofc). But I'm not certain how/what apple thinks about thin clients to web based services in their app store.