I am not aware of such a converter, but keep in mind that such conversions will only get you so far.
For instance there's a Java to C# convert that ships with Visual Studio. It does an excellent job, but for anything beyond the most trivial example you still have to do a lot of cleanup/refactoring yourself in my experience. Also, bad code in the original language will usually get converted to just as bad or possible worse code in the new language. So the code will be hard to maintain.
The point is there's no free lunch. Even with a converter you most likely will have to do a significant bit of porting yourself. If that is out of the question (due to time, money, whatever) you may have to rethink the project.
I am sorry I could not point you to a useful tool (hopefully others will) but I have seen these projects a couple of times and people are usually surprised by the cleanup work needed after a conversion.
The best solution I can think of would be: grab a Java-Developer and do some extreme programming (you: reading the Delphi sourcecode and explaining to him what it should do - he: writing all down in Java)
Because even if you find a Delphi-to-Java Converter - it might produce bad sourcecode.
A new target has been added to Free Pascal compiler. It is now
possible to compile applications to Java bytecode. This means that
these Free Pascal applications can run in a Java Virtual Machine
(JVM), so that it can run on any platform that has Java support.
However, this target does only support the basic Pascal language and some functionality of the system unit.
发布评论
评论(4)
我不知道有这样的转换器,但请记住,这样的转换只能让您到目前为止。
例如,Visual Studio 附带了一个 Java 到 C# 的转换程序。它做得非常出色,但根据我的经验,对于除了最琐碎的示例之外的任何事情,您仍然需要自己进行大量清理/重构。此外,原始语言中的糟糕代码通常会转换为新语言中同样糟糕或可能更糟糕的代码。所以代码会很难维护。
关键是天下没有免费的午餐。即使使用转换器,您很可能也必须自己进行大量移植。如果这是不可能的(由于时间、金钱等原因),你可能不得不重新考虑该项目。
很抱歉,我无法向您指出一个有用的工具(希望其他人会),但我已经看过这些项目几次,人们通常会对转换后所需的清理工作感到惊讶。
I am not aware of such a converter, but keep in mind that such conversions will only get you so far.
For instance there's a Java to C# convert that ships with Visual Studio. It does an excellent job, but for anything beyond the most trivial example you still have to do a lot of cleanup/refactoring yourself in my experience. Also, bad code in the original language will usually get converted to just as bad or possible worse code in the new language. So the code will be hard to maintain.
The point is there's no free lunch. Even with a converter you most likely will have to do a significant bit of porting yourself. If that is out of the question (due to time, money, whatever) you may have to rethink the project.
I am sorry I could not point you to a useful tool (hopefully others will) but I have seen these projects a couple of times and people are usually surprised by the cleanup work needed after a conversion.
我能想到的最好的解决方案是:找一个 Java 开发人员并进行一些极限编程(你:阅读 Delphi 源代码并向他解释它应该做什么 - 他:用 Java 写下所有内容)
因为即使你找到一个Delphi-to-Java Converter - 它可能会产生错误的源代码。
The best solution I can think of would be: grab a Java-Developer and do some extreme programming (you: reading the Delphi sourcecode and explaining to him what it should do - he: writing all down in Java)
Because even if you find a Delphi-to-Java Converter - it might produce bad sourcecode.
Free Pascal 支持 Java 虚拟机 (JVM) 编译:
Java 字节码目标已添加到 Free Pascal 编译器中。
然而,该目标仅支持基本的 Pascal 语言和系统单元的部分功能。
Free Pascal supports compilation for the Java Virtual Machine (JVM):
Java-bytecode target added to the Free Pascal compiler.
However, this target does only support the basic Pascal language and some functionality of the system unit.
之前有一个叫Delphi2J的程序可以转换,但是我找不到下载的链接。
另一种方法:
Before there was a program called Delphi2J to convert, but I couldn't find the link to download it.
Another way: