将整个Java项目移植到C# [英] Porting entire Java projects to to C#
问题描述
我正在寻找一种将整个Java项目转换为C#的免费方式。我遵循 Pauldb关于在Eclipse中使用Sharpen的文章本教程有点过时了。
I'm looking for a free way to convert entire Java projects to C#. I followed Pauldb's article on using Sharpen in eclipse. The tutorial is a bit outdated.
使用Luna on Windows我收到以下错误:
While using Luna on Windows I got the following errors:
尝试更新我的环境工作后,我得到
After trying to update the references to work on my enviroment I get
...\run-sharpen.xml:59: The following error occurred while executing this line:
...\run-sharpen.xml:20: exec returned: 13
其中日志文件说java.lang.RuntimeException:Applicationsharpen.core。应用程序在注册表中找不到。
In which the log file says "java.lang.RuntimeException: Application "sharpen.core.application" could not be found in the registry."
推荐答案
步骤1:下载eclipse Mars我正在使用4.5.0)
Step 1: Download eclipse Mars (I'm using 4.5.0)
步骤2:打开Eclipse。导入您的项目,并使用一个src /文件夹为所有的java文件。
Step 2: Open Eclipse. Import your project and use a src/ folder for all your java files.
步骤3:添加文件sharpen.properties,sharpen-all-options,run-sharpen.xml和header.txt到项目文件夹的根目录。编辑sharpen.properties以适应您的环境。在run-sharpen.xml中,注释这些行,因为它们是依赖关系的示例:
Step 3: Add the files "sharpen.properties", "sharpen-all-options", "run-sharpen.xml" and "header.txt" to the root of the project folder. Edit sharpen.properties to fit your enviroment. In run-sharpen.xml, comment out these lines as they are examples for dependencies:
<arg value="-cp" />
<arg path="C:/eclipse/workspace/myproject/libs/kxml2-2.3.0.jar" />
<arg value="-cp" />
<arg path="C:/eclipse/workspace/myproject/libs/regexp-me.jar" />
步骤4:帮助>安装新软件>查找并添加Eclipse 2.0样式插件支持和Eclipse e4工具开发人员资源(或仅搜索Eclipse测试,工具,示例和其他并添加全部)
Step 4: Help > Install new software > Find and add "Eclipse 2.0 Style Plugin Support" and "Eclipse e4 Tools Developer Resources" (or just search "Eclipse Tests, Tools, Examples, and Extras" and add all)
第5步::使用ngit's锐化car jar文件并将其放入你的eclipse / plugins文件夹。
Step 5:: Use ngit's sharpen.core jar file and place it into your "eclipse/plugins" folder.
步骤6: 将您的/程序%20Files /表示为/ Program Files /我相信这是火星的一个错误。这样就阻止了org.eclipse.swt.win32.win32.x86_64_3.104.0.v20150528-0211.jar无法找到错误(即使存在)。
Step 6: mlink your "/Program%20Files/" to be "/Program Files/" I believe this is a bug in Mars. This prevents "org.eclipse.swt.win32.win32.x86_64_3.104.0.v20150528-0211.jar" cannot be found error (even when it exists).
步骤7:在eclipse中运行Ant文件。应该告诉你编译。否则会给你一个链接到
Step 7: Run the Ant file in eclipse. It should tell you it compiled. Otherwise it will give you a link to
步骤8:锐化做得很好,但会出现错误。如果错误太常见,请编辑锐化全选并重新运行。
Step 8: Sharpen does a pretty good job but there will be errors. If an error is too common, edit "sharpen-all-options" and re-run.
备注:在经过太多小时的尝试之后,我无法让这个在Luna工作。更新到火星,它有不同的问题,我可以解决。它不会在注册表中找不到sharpen.core.application。更新到火星似乎解决了。
Notes: I couldn't get this to work in Luna after too many hours of trying. Updated to Mars and it had different problems that I could fix. It wouldn't recognize ""sharpen.core.application" could not be found in the registry". Updating to mars seems to fix it.
这篇关于将整个Java项目移植到C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!