Java中代码没问题,编译显示程序包xxx不存在是怎么回事?有什么解决方法吗?

Java中代码没问题,编译显示程序包xxx不存在是怎么回事?有什么解决方法吗?

异常信息没贴出来,代码没贴出来,pom 文件没贴出来。

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
    <servlet>
        <servlet-name>spring</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>spring</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>
</web-app>

直接创建的web项目,没有pom.xml,

同时这个也是报红

这个jar包我一开始就把他导进去,后来我觉得可能上包不全,我就把包都导进去。还是没变化。所以我也不知道到底是什么原因。。。

你看看里面有没有你 lib 包下的依赖