c#项目 java项目,将整个Java项目移植到C#

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.

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

In which the log file says "java.lang.RuntimeException: Application "sharpen.core.application" could not be found in the registry."

解决方案

Step 1: Download eclipse Mars (I'm using 4.5.0)

Step 2: Open Eclipse. Import your project and use a src/ folder for all your java files.

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:

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)

Step 5:: Use ngit's sharpen.core jar file and place it into your "eclipse/plugins" folder.

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).

Step 7: Run the Ant file in eclipse. It should tell you it compiled. Otherwise it will give you a link to

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.

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值