Eclipse插件编译之PTP6.0

来源:互联网 发布:word文件恢复软件 编辑:程序博客网 时间:2024/06/06 08:41

之前编译的插件是PTP9.1版本,遇到的问题记录在:

http://blog.csdn.net/fr724262366/article/details/78479848


这次继续编译ptp6.0版本,本想着会和9.1的差不多,但是实际编译起来着实遇到不少困难,特记录。

一、源码的获取:

推荐去github获取:https://github.com/eclipse/ptp/tree/master

PS:不要直接在eclipse-ptp官网给的那个git连接,那个只能clone到9.1版本的源码。

即使用以下命令获取:

git clone https://github.com/eclipse/ptp.git 

也可以用git clone -b 指定获取的版本。


二、编译命令及问题解决方法

编译方法:

cd进入源码主文件夹:

mvn clean verify -DskipTests=true



遇到的问题:

①Error reading signed content

["Messages while trying children repositories.": ["": ["Multiple problems occurred while downloading.": ["Failed to transfer artifact packed: osgi.bundle,org.eclipse.emf.mwe2.runtime,2.8.0.v201505260335.":["Problems downloading artifact: osgi.bundle,org.eclipse.emf.mwe2.lib,2.8.0.v201505260335.": ["Error reading signed content:\tmp\signatureFile7029196355039391088.jar
由于之前按照官网编译日志使用maven3.0.5编译,但是一直报此错误,解决方法是---改用maven3.5编译。

(原日志没保存,借用网上的类似报错)

PS:改用maven3.5会报个错,需要把pom.xnl中的tycho改为0.18.1版本才行。

----------------------------------------------------------------------------------------------------------------------------------

②repository仓库找不到,参考http://blog.csdn.net/fr724262366/article/details/78479848

--------------------------------------------------------------------------------------------------------------------

③Unable to find javac报错

Unable to find a javac compiler;com.sun.tools.javac.Main is not on the classpath.Perhaps JAVA_HOME does not point to the JDK.
被这个报错困扰了好久,网上好多博客都是些windows上的解决方法,什么拷贝jdk/lib的tools.jar到jre/lib下等等方法在centos上完全不管用,JAVA_HOME设置也正确,就是编译不过去,最后找stackoverflow找到一个关于使用eclipse IDE编译的方法,手动添加jar包,便开始尝试,这次成功了:

具体方法为:

1、将eclipse-ptp源码包导入eclipse(以maven项目的方式)

2、Window -- perference -- 搜索/选择Installed JREs,如果右边栏中不是JDK,而是JRE,则需要ADD手动添加JDK进去,并选择。


3、双击java-1.8.0-openjdk-1.8.0xxxxx打开EditJRE界面


4、点击Add External JARs将现存的tools.jar添加进去,在eclipse中使用Run -- Maven install再次编译,成功解决错误。

--------------------------------------------

④编译卡在clone org.eclipse.cdt

卡住以后,等了两小时,编译报错,显示文件代码有问题

/home/gosh/Eclipse-PTP/ptp6.0/ptp/rdt/org.eclipse.ptp.rdt.core.remotejars/build.xml:187  
打开文件显示如下:

183                     <arg value="clone"/>184                         <arg value="git://git.eclipse.org/gitroot/cdt/org.eclipse.cdt.git"/>185                 </exec>186 187                 <exec dir="${basedir}/gitrepo/org.eclipse.cdt" executable="git">188                     <arg line="checkout -b ${cdtBranch} origin/${cdtBranch}"/>

发现主要原因是git的地址有问题(貌似是失效了),于是去github找到新的cdt地址,替换掉,即修改为:

183                     <arg value="clone"/>184                         <arg value="https://github.com/eclipse/cdt.git"/>185                 </exec>186 187                 <exec dir="${basedir}/gitrepo/org.eclipse.cdt" executable="git">188                     <arg line="checkout -b ${cdtBranch} origin/${cdtBranch}"/>
而后cdt代码成功clone下来,但是文件名为cdt,他后面会报错找不到org.eclipse.cdt,

因此要把cdt文件夹改名为org.eclipse.cdt,然后再次编译,一路顺畅,直至成功。


原创粉丝点击