0%

linux安装eclipse

linux安装eclipse

http://blog.sina.com.cn/s/blog_7880d3350102vyur.html Linux安装Eclipse

提前安装: jdk

安装jdk, 配置jdk相关环境变量

安装eclipse-platform

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
dassein@pad:~$ sudo apt install eclipse-platform
[sudo] password for dassein:
Use 'sudo apt autoremove' to remove it.
0 upgraded, 106 newly installed, 0 to remove and 0 not upgraded.
Need to get 706 kB/212 MB of archives.
After this operation, 373 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://cn.archive.ubuntu.com/ubuntu yakkety/main amd64 libdb5.3-java-jni amd64 5.3.28-12 [706 kB]
Created symlink /etc/systemd/system/multi-user.target.wants/binfmt-support.service → /lib/systemd/system/binfmt-support.service.

Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
update-alternatives: using /usr/lib/liblucene2-java/lucli to provide /usr/bin/lucli (lucli) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/rmid to provide /usr/bin/rmid (rmid) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java to provide /usr/bin/java (java) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/keytool to provide /usr/bin/keytool (keytool) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/jjs to provide /usr/bin/jjs (jjs) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/pack200 to provide /usr/bin/pack200 (pack200) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/rmiregistry to provide /usr/bin/rmiregistry (rmiregistry) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/unpack200 to provide /usr/bin/unpack200 (unpack200) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/orbd to provide /usr/bin/orbd (orbd) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/servertool to provide /usr/bin/servertool (servertool) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/tnameserv to provide /usr/bin/tnameserv (tnameserv) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jexec to provide /usr/bin/jexec (jexec) in auto mode
Setting up openjdk-8-jdk-headless:amd64 (8u121-b13-0ubuntu1.16.10.2) ...
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/idlj to provide /usr/bin/idlj (idlj) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jdeps to provide /usr/bin/jdeps (jdeps) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/wsimport to provide /usr/bin/wsimport (wsimport) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/rmic to provide /usr/bin/rmic (rmic) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jinfo to provide /usr/bin/jinfo (jinfo) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jsadebugd to provide /usr/bin/jsadebugd (jsadebugd) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/native2ascii to provide /usr/bin/native2ascii (native2ascii) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jstat to provide /usr/bin/jstat (jstat) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/javadoc to provide /usr/bin/javadoc (javadoc) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/javah to provide /usr/bin/javah (javah) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jstack to provide /usr/bin/jstack (jstack) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jrunscript to provide /usr/bin/jrunscript (jrunscript) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/javac to provide /usr/bin/javac (javac) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/javap to provide /usr/bin/javap (javap) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jar to provide /usr/bin/jar (jar) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/extcheck to provide /usr/bin/extcheck (extcheck) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/schemagen to provide /usr/bin/schemagen (schemagen) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jps to provide /usr/bin/jps (jps) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/xjc to provide /usr/bin/xjc (xjc) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jmap to provide /usr/bin/jmap (jmap) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jstatd to provide /usr/bin/jstatd (jstatd) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jhat to provide /usr/bin/jhat (jhat) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jdb to provide /usr/bin/jdb (jdb) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/serialver to provide /usr/bin/serialver (serialver) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/wsgen to provide /usr/bin/wsgen (wsgen) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jcmd to provide /usr/bin/jcmd (jcmd) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jarsigner to provide /usr/bin/jarsigner (jarsigner) in auto mode
Setting up openjdk-8-jre:amd64 (8u121-b13-0ubuntu1.16.10.2) ...
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/policytool to provide /usr/bin/policytool (policytool) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/appletviewer to provide /usr/bin/appletviewer (appletviewer) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jconsole to provide /usr/bin/jconsole (jconsole) in auto mode
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
dassein@pad:~$ eclipse
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0

安装eclipse的C++工具

新建工程时发现没有C/C++工程,只有Java工程,再次搜索sudo apt-cache search eclipse C/C++

发现其中一条:eclipse-cdt - C/C++ Development Tools for Eclipse

继续安装:sudo apt-get install eclipse-cdt

再次重启eclipse,就有了C/C++项目

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
dassein@pad:~$ sudo apt-get install eclipse-cdt
[sudo] password for dassein:
The following package was automatically installed and is no longer required:
ubuntu-core-launcher
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
eclipse-cdt-jni
Suggested packages:
eclipse-cdt-autotools eclipse-cdt-launch-remote
The following NEW packages will be installed:
eclipse-cdt eclipse-cdt-jni
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 37.5 MB of archives.
After this operation, 40.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://cn.archive.ubuntu.com/ubuntu yakkety/universe amd64 eclipse-cdt-jni amd64 8.6.0-1 [15.4 kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu yakkety/universe amd64 eclipse-cdt all 8.6.0-1 [37.5 MB]
69% [2 eclipse-cdt 27.6 MB/37.5 MB 74%]
69% [2 eclipse-cdt 27.6 MB/37.5 MB 74%]
Get:2 http://cn.archive.ubuntu.com/ubuntu yakkety/universe amd64 eclipse-cdt all 8.6.0-1 [37.5 MB]
Fetched 9,933 kB in 4min 25s (37.4 kB/s)
Selecting previously unselected package eclipse-cdt-jni.

File /WEB-INF/web.xml not found

1
2
3
4
5
6
dassein@pad:~$ eclipse
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Mar 04, 2017 4:42:13 PM org.apache.jasper.compiler.WebXml <init>
WARNING: Internal Error: File /WEB-INF/web.xml not found
Mar 04, 2017 4:42:14 PM org.apache.jasper.compiler.WebXml <init>
WARNING: Internal Error: File /WEB-INF/web.xml not found

sudo eclipse -s 启动后发现“窗口->打开视图”里面没有ssh远程登录的选项
发现它是Eclipse的插件,查询sudo apt-cache search Remote System Explorer
发现一个eclipse-rse sudo apt-get install eclipse-rse
重启eclipse

C++项目launch failed.Binary not found

检查g++

Ctrl+Alt+t到terminal(控制台)模式 sudo apt-get install g++

1
2
3
4
5
6
7
8
9
10
11
dassein@pad:~$ sudo apt-get install g++
[sudo] password for dassein:
Reading package lists... Done
Building dependency tree
Reading state information... Done
g++ is already the newest version (4:6.1.1-1ubuntu2).
g++ set to manually installed.
The following package was automatically installed and is no longer required:
ubuntu-core-launcher
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

勾选GNU Elf Parser和Elf Parser

Project->Properties->C/C++Build->Settings->Binary Parsers

勾选GNU Elf Parser和Elf Parser

然后千万千万别忘了Project->Build All (Ctrl+B), 再run(Ctrl+F11)

如果看到项目下面出来一项名为Binaries, 配置成功

检查cpp文件名

是否为xxx.cpp? xxx中不能含有’.’之类的符号