Ubuntu之新装Eclipse配置

来源:互联网 发布:linux 分页机制 编辑:程序博客网 时间:2024/05/16 01:44

环境:

ubuntu 14.04 x64

adt-bundle-linux-x86_64-20140702 (eclipse+sdk)

jdk1.7.0_67


系统新装,配置开始。。。


一、安装配置jdk

下载jdk压缩包,解压到/home/xxx/software/,用gedit打开编辑用户目录下.profile,

sudo gedit ~/.profile


在文件最后加上环境变量配置代码(代码里同时也配置好了SDK目录),

export JAVA_HOME=/home/xxx/software/jdk1.7.0_67/export JRE_HOME=/home/xxx/software/jdk1.7.0_67/jreexport ANDROID_HOME=/home/xxx/software/sdkexport CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib:$JRE_HOME/lib:$ANDROID_HOME:$CLASSPATHexport PATH=$JAVA_HOME/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH

刷新profile使变量生效

source ~/.profile


二、配置Eclipse

1、更新SDK

(1)、修改hosts文件

sudo gedit /etc/hosts
添加

203.208.46.146dl.google.com203.208.46.146dl-ssl.google.com91.213.30.151 google.com91.213.30.151 accounts.google.com91.213.30.151 mail.google.com173.194.41.29 isolated.mail.google.com74.125.31.120 ssl.gstatic.com 


(2)、打开SDK Manager -- tools -- 勾选https-http,开始更新。


2、显示Eclipse菜单

ubuntu上eclipse菜单无法下拉,增加快捷方式可解决,

sudo gedit /usr/share/applications/Eclipse.desktop

[Desktop Entry] Version=1.0Name=EclipseExec=env UBUNTU_MENUPROXY= /home/xxx/software/eclipse/eclipseTerminal=falseIcon=/home/xxx/software/eclipse/icon.xpmType=ApplicationCategories=IDE;Development;


3、Eclipse黑色主题

参考:https://github.com/guari/eclipse-ui-theme


(1)、下载moonrise_0.8.9.jar ,关闭eclipse,把moonrise放到eclispe目录的 \dropins\plugins\ 文件夹,

(2)、打开eclipse,Window > Preferences > General > Appearance,Theme选择“moonrise(standalone)”。

3)、主题已经切换完成,如果还要修改代码的显示风格,下载 RainbowDrops.epf 或者 RainbowDrops.xml 。

下载: http://eclipsecolorthemes.org/?view=theme&id=24587

如果是epf文件,安装步骤:File > Import... > General > Preferences

如果是xml文件,安装步骤:Window→Preferences→General→Appereance→Color Theme


4、Eclipse代码显示字体

Window→Preferences→General→Appereance→Colors and Fonts→Text Font→Edit→"DejaVu Sans Mono",字体大小11.


5、编程辅助(代码自动提示)

Window→Preferences→Java→Editor→Content Assist→"Auto activation triggers for Java:"→".abcdefghijklmnopqrstuvwxyz".


6、author version 注释

Window→Preferences→Java→Code Style→code Templates,

(1)、“Comments”---"Types" ---"Edit"

/** * @info  * * @author 作者 * * ${tags} */

(2)、“Code”---"New Java files" ---"Edit"

${filecomment}${package_declaration}/** @info * @author 作者* @time${date} ${time}* @version*/${typecomment}${type_declaration}


7、安装配置Genymotion

(1)、下载Genymotion, 需要注册才能下载,地址: http://www.genymotion.cn/#theme=download_list ,安装:

./genymotion-***_x64.bin
(2)、下载VirtualBox,下载地址: https://www.virtualbox.org/wiki/Linux_Downloads,deb文件双击安装。

(3)、Eclipse安装Genymotion-Eclipse插件:

Help→Install New Software→AddName: GenymotionLocation: http://plugins.genymotion.com/eclipse


8、配置Eclipse行宽

Eclipse 代码的默认宽度是 80 , 稍长一点的一行代码就会自动换行,代码可读性较差, 对代码宽度进行设置。
设置路径为:Window→Preferences→Java→Code Style→Formatter,点击“new”新建一个“Profile”。
新建名为"eclipseline"的“Profile”,选中“Line Wrapping”,修改其下的“Maximum line width”的数值,我在这里修改为“160”,这样 Eclipse 下就能显示更长一些的单行代码了

先到这里。。。






0 0