将整个Java项目移植到C#

时间:2015-07-14 22:26:36

标签: java c# eclipse porting sharpen-tool

我正在寻找一种将整个Java项目转换为C#的免费方法。我跟着Pauldb's article on using Sharpen in eclipse.这个教程有点过时了。

在Windows上使用Luna时出现以下错误:

在尝试更新我的环境工作的参考资料后,我得到了

#HOTLINK PROTECTION START
if ($uri ~* ".(jpg|jpeg|png|gif)$"){
set $rule_0 1$rule_0;
}
if ($remote_addr !~* "^(127.0.0.1|xxx.xxx.xxx.xxx)$"){ #xxx.xxx.xxx.xx is your server ip
set $rule_0 2$rule_0;
}
if ($remote_addr !~* "^66.6.(32|33|36|44|45|46|40)."){
set $rule_0 3$rule_0;
}
if ($http_referer !~* "^http(s)?://(www.)?(www.findhomeideas.info|translate.google.com|translate.googleusercontent.com|www.microsofttranslator.com|pinterest.com|tumblr.com|facebook.com|plus.google|twitter.com|googleapis.com|googleusercontent.com|ytimg.com|gstatic.com)"){
set $rule_0 4$rule_0;
}
if ($http_user_agent !~* "(googlebot|msnbot|baiduspider|slurp|webcrawler|teoma|photon|facebookexternalhit|facebookplatform|pinterest|feedfetcher|ggpht)"){
set $rule_0 5$rule_0;
}
if ($http_user_agent !~* "(photon|smush.it|akamai|cloudfront|netdna|bitgravity|maxcdn|edgecast|limelight|tineye)"){
set $rule_0 6$rule_0;
}
if ($http_user_agent !~* "(developers|gstatic|googleapis|googleusercontent|google|ytimg)"){
set $rule_0 7$rule_0;
}
if ($rule_0 = "7654321"){
rewrite /(.*) /byrev-wp-picshield.php?key=xxxx-xxxx&src=$1 last; #xxx-xxx is your key
}
#HOTLINK PROTECTION START

日志文件在注册表中找不到“java.lang.RuntimeException:Application”sharpen.core.application“。

1 个答案:

答案 0 :(得分:7)

第1步:下载eclipse Mars(我使用的是4.5.0)

第2步:打开Eclipse。导入项目并使用src /文件夹存储所有java文件。

步骤3:将文件“sharpen.properties”,“sharpen-all-options”,“run-sharpen.xml”和“header.txt”添加到项目文件夹的根目录。编辑sharpen.properties以适应您的环境。在run-sharpen.xml中,注释掉这些行,因为它们是依赖项的示例:

...\run-sharpen.xml:59: The following error occurred while executing this line:
...\run-sharpen.xml:20: exec returned: 13

第4步:帮助>安装新软件>查找并添加“Eclipse 2.0 Style Plugin Support”和“Eclipse e4 Tools Developer Resources”(或者只搜索“Eclipse测试,工具,示例和附加内容”并添加所有内容)

第5步:Use ngit's sharpen.core jar file并将其放入“eclipse / plugins”文件夹中。

第6步: mlink your "/Program%20Files/" to be "/Program Files/"我相信这是火星上的一个错误。这可以防止“org.eclipse.swt.win32.win32.x86_64_3.104.0.v20150528-0211.jar”找不到错误(即使它存在)。

第7步:在eclipse中运行Ant文件。它应该告诉你编译。否则它会给你一个

的链接

第8步: Sharpen做得很好,但会有错误。如果错误太常见,请编辑“sharpen-all-options”并重新运行。

注意:经过几个小时的努力,我无法让这个在Luna工作。更新到火星,它有不同的问题,我可以解决。它无法识别“”无法在注册表中找到“”sharpen.core.application“。更新到火星似乎解决了这个问题。

Link to example github project