有像 Jazillian 这样的工具可以将 C 语言转换为 Java 语言吗?

发布于 2024-11-25 15:12:47 字数 135 浏览 2 评论 0原文

当我寻找有关将 C 转换为 Java 的信息时,我看到并听到了很多关于 Jazillian 的信息。但我找不到任何有关这个奇妙工具发生了什么以及在哪里下载的信息?

有人对此有任何见解吗?我想下载 Jazillian 或任何其他好的替代方案?

I see and hear a lot about Jazillian when I look for information on coverting C to Java. But I cannot find any information on what happened to this wonderful tool and where to download it?

Does anyone have any insight into it? I want to download Jazillian or any other good alternative?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

流殇 2024-12-02 15:12:47

您始终可以使用 JNI。这样,您就不必转换任何内容,而是将请求发送到本机代码,并让它以数据结构的形式返回结果,您可以在 Java 程序中进行操作。该代码显然不是跨平台的,但根据项目的范围,这可能是使用新 Java 代码扩展 C 应用程序的最快方法。

You can always use JNI. That way you don't have to convert anything, but rather send requests to your native code and have it return the results as data structures that you can manipulate in your Java program. this code is obviously not cross platform, but depending on the scope of your project this could be the fastest way to extend a C app with new Java code.

陈独秀 2024-12-02 15:12:47

据说 Cibyl 可以将 C 库编译成可执行的 Java 字节码。除了自己移植之外,我不知道有什么特定的工具可以将 C 代码转换为实际的 Java 代码。

Supposedly Cibyl can compile C libraries into executable Java bytecode. I don't know of a specific tool to convert the C code to actual Java code, except for porting it yourself.

旧城空念 2024-12-02 15:12:47

那里有很多工具。他们被称为程序员。你应该找其中之一来做这件事。

C 和 Java 之间不存在一对一的映射。 C 可以做很多 Java 做不到的事情(指针是显而易见的),Java 也是如此。 C连课都没有。任何机器翻译都会产生可怕的代码。你最好用手来做。如果您要翻译的项目有单元测试,那么您肯定应该在翻译被测代码之前手动进行这些测试。如果没有,也许您应该首先为您要翻译的代码编写一些单元测试,因为否则您就会把它搞砸。

这一切都假设您首先有充分的理由将代码从一种语言翻译成另一种语言。好好把握它。这些都是罕见的。

There's lots of tools out there. They're called programmers. You should get one of those to do it.

There isn't a one-to-one mapping between C and Java. C can do lots of stuff Java can't do (pointers spring to mind as the obvious one), and the same is true of Java. C doesn't even have classes. Any machine translation would result in terrifying code. You're far better off doing it by hand. If the project you want to translate has unit tests, you should definitely do those by hand before you translate the code under test. If not, perhaps you should write some unit tests for the code you're translating first, because otherwise you're going to screw it up.

This all assumes you have a good reason for translating code from one language to another in the first place. Keep good hold of it. Those are rare.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文