Java Error: Only a Type Can Be Imported. Xyz Resolves to a Package

Java error: Only a type can be imported. XYZ resolves to a package

OK I just solved it. In the last import I added a ";" by copying other code examples. I guess it's the standard line ending that is required.

So

<%@ page import="java.util.*" %>
<%@ page import="org.eresearch.knowledgeportal.dao.CategoryDao" %>
<%@ page import="org.eresearch.knowledgeportal.model.Category" %>

became

 <%@ page import="java.util.*" %>
<%@ page import="org.eresearch.knowledgeportal.dao.CategoryDao" %>
<%@ page import="org.eresearch.knowledgeportal.model.Category;" %>

JSP Error: Only a type can be imported. package.class resolves to a package

Problem Solved by change the type of the project from Java Project into Dynamic Web Project. Thanks

JSP - Only a type can be imported. Name.pacakge.class resolves to a package but the class is there

Include morphAnalyzer.jar in class path of you application

Only a type can be imported. com.journaldev.model.Employee resolves to a package

error was because of exclamation sign on project. I created new web dynamic project and it was running smoothly.

Sample Image

Only a type can be imported. org.apache.poi.hssf.usermodel.HSSFWorkbook resolves to a package

The message indicates that the class could not be found on the classpath of your deployed application. Did you make sure that the POI jar is in your WEB-INF/lib folder?



Related Topics



Leave a reply



Submit