添加dtd文件
Window
=> Preferences
=> XML XML Catalog
=> add
例如mybatis-config.xml文件的文件頭如下:
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
在Eclipse中應(yīng)該設(shè)置:
將class文件輸出到指定文件夾
Project
=>Properties
=>Java Build Path
=>Source
=>Browser...
這樣做的用途:
在eclipse中默認(rèn)輸出的class實在bin目錄下的,但是在默認(rèn)情況下穆刻,tomcat會在WEB-INF/classes這個目錄下查找class文件,而不是在bin目錄下查找。通過更改class文件的輸出路徑到WEB-INF/classes這樣的操作胜嗓,我們可以把web應(yīng)用方便地部署到tomcat。
顯示空包或web/WEB-INF下的classes文件夾
Navigate
=>Show In
=>Navigator
<=> Alt+Shift+W
看看效果钩乍,呦吼~
將已經(jīng)存在的項目載入eclipse中時出現(xiàn)No projects are found to import
原因:
工程項目的個目錄下面沒有.project和.classpath這兩個文件
解決:
- 建一個項目辞州,這個項目的項目名要import的項目名稱一樣;
- 新建的項目目錄里面有上述的兩個文件件蚕,把上述兩個文件拷到你要import的項目目錄下面孙技;
- 刪除之前建的那個項目产禾,然后再重新import。
修改Eclipse的編碼格式
Window
=>Preferences
=>Work Space
導(dǎo)入Maven項目:The declared package "com.myself" does not match the expected package "main.java.com.myself"
Set my-project/src/main/java as the source folder (Project
=> Properties
=> Java Build Path
=> Project
=> Add Folder
). Remove the old source folder.
Restart eclipse if necessary.
Simply put, Eclipse thinks that your project begins at my-project/src. Therefore, it expects all packages to descend from there, starting with main.java.
問題解決來自:stackoverflow
The tomcat server configuration at /sever/tomcat v7.0 localhost-config is missing
原因:做項目時用的tomcat的版本/路徑和現(xiàn)在用 不一樣牵啦,tomcat版本或者路徑問題亚情。
解決:更改項目的tomcat或者路徑版本方法。
項目右擊
=>run as
=>run on server
=> manually define a new server
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
- On your Eclipse IDE, go into
Window
>Preferences
>Java
>Installed JREs
> and check yourinstalled JREs
. You should have an entry with a JDK there. - Select the Execution Env as show below. Click
OK
- Then
Right-Click
on your Project ->Maven
->Update Project
Additionally, you may have to change Maven JRE which is as follows. Goto Run -> Run Configurations, selecting the Maven Build I was running (from the left panel). Then, I clicked the JRE tab and selected the option Workspace default JRE
添加注釋
Java:
Ctrl
+/
XML:
Ctrl
+Shift
+/
設(shè)置Class Path
控制行輸出行數(shù)
在Console上右擊 =>
Preferences
=> 修改 Limit console output
重命名
alt
+shift
+R
Insert
插入變改寫:Inert鍵可以打出一個的時候刪掉一個字哈雏。
另外:終端下
Ctrl+Insert是復(fù)制
Shift+Insert是粘貼
Ctrl+C 是終止正在運行的進(jìn)程