Eclipse配置和相关设置/快捷键
Access restriction: The type Resource is not accessible due to restriction on required library
是访问限制报错.
全局属性Project>preferences>java>Compiler>Errors/Warnings>把右侧的【Deprecated and restricted API>Forbidden reference的Error】置为【Warning】.
-----------------------------------------------
查看android布局
device=> Dump View Hierarchy for UI Automator
----------------------------------------------
Eclipse自动形成编码风格
crtl + shift + f
-----------------------------------------------
eclipse set no tab
"Windows"=>"Preference"=>"Java" =>"Code Style" => "Formatter"
new a profile-selfdefine and edit this profile
"Tab policy" =>"Space only"
------------------------------------------
eclipse Removes the trailing whitespace of each line
"Windows"=>"Preferences"=>"General"=>"Key"=>"Remove Trailing Whitespace" =>"Bindind"
bind a key(eg: ctrl + alt + shift + R)
----------------------------------------------
display unbuntu desktop
ctrl + super + D
--------------------------------
Ctrl+1 快速修复(最经典的快捷键,就不用多说了)
Ctrl+D: 删除当前行
Alt+↓ 当前行和下面一行交互位置(特别实用,可以省去先剪切,再粘贴了)
Alt+↑ 当前行和上面一行交互位置(同上)
快速添加父类方法
alt+shit+s Override/Implement Method
--------------------------------------
修改字体大小:
窗口——首选项——常规——外观——颜色和字体——基本——文本字体——编辑
Window --> Preferences --> General --> Appearance --> Colors and Fonts --> Basic --> Text Font --> Edit
----------------------
A Java Runtime Environment (JRE) or Java Development Kit (JDK)
must be available in order to run Eclipse. No Java virtual machine
was found after searching the following locations:
/home/czm/adt-bundle-linux-x86_64-20140702/eclipse/jre/bin/java
java in your current PATH
最简单的解决办法:
从终端进入adt bundle下的eclipse目录下新建一个jre目录,然后在创建一个软链接指向jdk目录下的bin目录即可:
cd 你的eclipse目录
mkdir jre
cd jre
ln -s 你的jdk目录/bin
----------------------------------------------
Android项目 ,弹出报错对话框,running android lint has encountered a problem
新建了一个 Android 项目,保存后重启 Eclipse 后,报上面的错误,但是也不影响下面的运行
解决 : 把Window-->Preferences-->Android---> LInt Error Checking-->when saving files, check for errors 选项勾掉
--------------------------------------------
“AndroidManifest.xml file missing”
右击helloworld"->"Android Tools"->"Fix Project Properties"
-------------------------------------------------------------------------------
Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assign one
Eclipse -> Preferences -> Android -> Lint Error Checking -> Issue -> Security -> HardCodeDebugMode -> Severity: -> Warning
---------------------------------------------
找不到Lorg/apache/commons/net/ftp/FTPClient
原因是因为Android eclipse项目中jar包必须放在libs目录中
如果放在lib目录中会出现编译通过,能正确打包,但是运行时,显示找不到jar包中的类。
------------------------------------------------------------
main Alt + / => public static void main(String[] args) syso Alt + / => System.out.println(); ond Alt + / => protected void onDestroy() / private void ond() Ctrl + D : 删除本行 Ctrl + SHIFT + F : 自动调整格式 Ctrl + Alt + ↓(↑) : 向下(上)复制本行 Alt + ↓(↑) : 向下(上)移动本行
设置自动提示:
eclipse→Windows→Preferences→Java→Editor→Content Assist
.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW
其它语言类似的修改方法

浙公网安备 33010602011771号