匯入Web專案時可能出現的問題
阿新 • • 發佈:2019-02-09
問題一:Implicit super constructor Object is undefined for default constructor. Must define an explicit constructor
Implicit super constructor Object is undefined for default constructor Must define an explicit constructor
Today while writing test class in eclipse i saw below error:
-
This was happening due to my JRE was not set. To find it right click project –> Properties –> Java Build Path –> Click Libraries tab as shown below:
- To set JRE into build path click Add Library…
- Select JRE System Library –> Click Next
- Choose Workspace default JRE or Alternate installed JRE (If you want to install new JRE please use this link : ) . I choosen Workspace default JRE as below then click finish:
-
Now you will see on Libraries tab new JRE system Library is set and active
- Click OK to finish it. This should resolve the issue.
Solution 2:
- Sometime you will see JRE system libraries is already set but still it gives error. To resolve this
-
Click project –> Properties –> Java Build Path –> Click Libraries tab –>Select existing JRE or installed new JRE as shown below and click OK to rebuild the project.
- This should resolve the issue.
問題二:jsp頁面出現Multiple annotations found at this line: - The superclass "javax.se
新建jsp頁面老提示:
Multiple annotations found at this line:
- The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
解決步驟:
1、右鍵專案-build path
2、選擇configure build path...
3、選擇 java build path
4、Add Library –> server Runtime -> Click Next
5、選擇 Server runtime (我的是 Tomcat 7.0) –>完成