java: 程序包org.springframework.web.bind.annotation不存在

报错:
在这里插入图片描述
网上的很多方法都没有,都是在pom,文件里添加依赖,maven又菜,整不出来就完了,直接下载jar包,放进项目目录
在这里插入图片描述
这是spring那里下载的
https://repo.spring.io/ui/repos/tree/General/release/org/springframework/spring/5.2.6.RELEASE/spring-5.2.6.RELEASE-docs.zip
具体看你要下载的版本
然后新建目录,把jar放进去
在这里插入图片描述
这是我新建的目录
已经放进来了
在这里插入图片描述
选择图片上这个在这里插入图片描述
ok了

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
META-INF/MANIFEST.MF META-INF/license.txt org.springframework.remoting.caucho.BurlapClientInterceptor.class org.springframework.remoting.caucho.BurlapProxyFactoryBean.class org.springframework.remoting.caucho.BurlapServiceExporter.class org.springframework.remoting.caucho.Hessian1SkeletonInvoker.class org.springframework.remoting.caucho.Hessian2SkeletonInvoker.class org.springframework.remoting.caucho.HessianClientInterceptor.class org.springframework.remoting.caucho.HessianProxyFactoryBean.class org.springframework.remoting.caucho.HessianServiceExporter.class org.springframework.remoting.caucho.HessianSkeletonInvoker.class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.class org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor.class org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration.class org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.class org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean.class org.springframework.remoting.httpinvoker.HttpInvokerRequestExecutor.class org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.class org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor.class org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor.class org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean.class org.springframework.remoting.jaxrpc.JaxRpcServicePostProcessor.class org.springframework.remoting.jaxrpc.JaxRpcSoapFaultException.class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory.class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactoryBean.class org.springframework.remoting.jaxrpc.ServletEndpointSupport.class org.springframework.remoting.jaxrpc.support.AxisBeanMappingServicePostProcessor.class org.springframework.remoting.jaxws.JaxWsPortClientInterceptor.class org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean.class org.springframework.remoting.jaxws.JaxWsSoapFaultException.class org.springframework.remoting.jaxws.LocalJaxWsServiceFactory.class org.springframework.remoting.jaxws.LocalJaxWsServiceFactoryBean.class org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter.class org.springframework.web.HttpRequestHandler.class org.springframework.web.HttpRequestMethodNotSupportedException.class org.springframework.web.HttpSessionRequiredException.class org.springframework.web.bind.EscapedErrors.class org.springframework.web.bind.MissingServletRequestParameterException.class org.springframework.web.bind.RequestUtils.class org.springframework.web.bind.ServletRequestBindingException.class org.springframework.web.bind.ServletRequestDataBinder.class org.springframework.web.bind.ServletRequestParameterPropertyValues.class org.springframework.web.bind.ServletRequestUtils.class org.springframework.web.bind.WebDataBinder.class org.springframework.web.bind.annotation.InitBinder.class org.springframework.web.bind.annotation.ModelAttribute.class org.springframework.web.bind.annotation.RequestMapping.class org.springframework.web.bind.annotation.RequestMethod.class org.springframework.web.bind.annotation.RequestParam.class org.springframework.web.bind.annotation.SessionAttributes.class org.springframework.web.bind.support.ConfigurableWebBindingInitializer.class org.springframework.web.bind.support.DefaultSessionAttributeStore.class org.springframework.web.bind.support.SessionAttributeStore.class org.springframework.web.bind.support.SessionStatus.class org.springframework.web.bind.support.SimpleSessionStatus.class org.springframework.web.bind.support.WebBindingInitializer.class org.springframework.web.context.ConfigurableWebApplicationContext.class org.springframework.web.context.ContextLoader.class org.springframework.web.context.ContextLoaderListener.class org.springframework.web.context.ContextLoaderServlet.class org.springframework.web.context.ServletConfigAware.class org.springframework.web.context.ServletContextAware.class org.springframework.web.context.WebApplicationContext.class org.springframework.web.context.request.AbstractRequestAttributes.class org.springframework.web.context.request.AbstractRequestAttributesScope.class org.springframework.web.context.request.Log4jNestedDiagnosticContextInterceptor.class org.springframework.web.context.request.RequestAttributes.class org.springframework.web.context.request.RequestContextHolder.class org.springframework.web.context.request.RequestContextListener.class org.springframework.web.context.request.RequestScope.class org.springframework.web.context.request.ServletRequestAttributes.class org.springframework.web.context.request.ServletWebRequest.class org.springframework.web.context.request.SessionScope.class org.springframework.web.context.request.WebRequest.class org.springframework.web.context.request.WebRequestInterceptor.class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.class org.springframework.web.context.support.ContextExposingHttpServletRequest.class org.springframework.web.context.support.GenericWebApplicationContext.class org.springframework.web.context.support.HttpRequestHandlerServlet.class org.springframework.web.context.support.PerformanceMonitorListener.class org.springframework.web.context.support.RequestHandledEvent.class org.springframework.web.context.support.ServletContextAttributeExporter.class org.springframework.web.context.support.ServletContextAttributeFactoryBean.class org.springframework.web.context.support.ServletContextAwareProcessor.class org.springframework.web.context.support.ServletContextFactoryBean.class org.springframework.web.context.support.ServletContextParameterFactoryBean.class org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer.class org.springframework.web.context.support.ServletContextResource.class org.springframework.web.context.support.ServletContextResourceLoader.class org.springframework.web.context.support.ServletContextResourcePatternResolver.class org.springframework.web.context.support.ServletRequestHandledEvent.class org.springframework.web.context.support.StaticWebApplicationContext.class org.springframework.web.context.support.WebApplicationContextUtils.class org.springframework.web.context.support.WebApplicationObjectSupport.class org.springframework.web.context.support.XmlWebApplicationContext.class org.springframework.web.filter.AbstractRequestLoggingFilter.class org.springframework.web.filter.CharacterEncodingFilter.class org.springframework.web.filter.CommonsRequestLoggingFilter.class org.springframework.web.filter.DelegatingFilterProxy.class org.springframework.web.filter.GenericFilterBean.class org.springframework.web.filter.Log4jNestedDiagnosticContextFilter.class org.springframework.web.filter.OncePerRequestFilter.class org.springframework.web.filter.RequestContextFilter.class org.springframework.web.filter.ServletContextRequestLoggingFilter.class org.springframework.web.jsf.DecoratingNavigationHandler.class org.springframework.web.jsf.DelegatingNavigationHandlerProxy.class org.springframework.web.jsf.DelegatingPhaseListenerMulticaster.class org.springframework.web.jsf.DelegatingVariableResolver.class org.springframework.web.jsf.FacesContextUtils.class org.springframework.web.jsf.SpringBeanVariableResolver.class org.springframework.web.jsf.WebApplicationContextVariableResolver.class org.springframework.web.jsf.el.SpringBeanFacesELResolver.class org.springframework.web.jsf.el.WebApplicationContextFacesELResolver.class org.springframework.web.multipart.MaxUploadSizeExceededException.class org.springframework.web.multipart.MultipartException.class org.springframework.web.multipart.MultipartFile.class org.springframework.web.multipart.MultipartHttpServletRequest.class org.springframework.web.multipart.MultipartResolver.class org.springframework.web.multipart.commons.CommonsFileUploadSupport.class org.springframework.web.multipart.commons.CommonsMultipartFile.class org.springframework.web.multipart.commons.CommonsMultipartResolver.class org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest.class org.springframework.web.multipart.support.ByteArrayMultipartFileEditor.class org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest.class org.springframework.web.multipart.support.MultipartFilter.class org.springframework.web.multipart.support.StringMultipartFileEditor.class org.springframework.web.util.CookieGenerator.class org.springframework.web.util.ExpressionEvaluationUtils.class org.springframework.web.util.HtmlCharacterEntityDecoder.class org.springframework.web.util.HtmlCharacterEntityReferences.class org.springframework.web.util.HtmlUtils.class org.springframework.web.util.HttpSessionMutexListener.class org.springframework.web.util.IntrospectorCleanupListener.class org.springframework.web.util.JavaScriptUtils.class org.springframework.web.util.Log4jConfigListener.class org.springframework.web.util.Log4jConfigServlet.class org.springframework.web.util.Log4jWebConfigurer.class org.springframework.web.util.NestedServletException.class org.springframework.web.util.TagUtils.class org.springframework.web.util.UrlPathHelper.class org.springframework.web.util.WebAppRootListener.class org.springframework.web.util.WebUtils.class org/springframework/web/context/ContextLoader.properties org/springframework/web/util/HtmlCharacterEntityReferences.properties
### 回答1: 这个错误提示是因为在你的Java代码中使用了org.springframework.web.bind.annotation这个包,但是编译器找不到这个包。 解决方法是需要在你的项目中添加Spring Framework的依赖,可以通过Maven或Gradle等构建工具来添加依赖。如果你是手动添加jar包的方式,需要将Spring Framework的相关jar包添加到你的项目中。 另外,需要确保你的项目中的Java版本和Spring Framework的版本兼容。如果版本不兼容也会导致这个错误。 ### 回答2: 这个错误提示意味着你的Java项目在编译时找不到org.springframework.web.bind.annotation这个包。这是由于许多原因造成的,例如: 1. 缺少依赖包:org.springframework.web.bind.annotationSpring MVC框架的一部分,如果你的项目没有引入这个框架或没有将其相关包作为依赖项添加到项目中,就会出现这个错误。 2. 版本不匹配:如果你的项目和依赖的框架之间的版本产生了差异,也会导致编译错误。 3.项目配置问题:如果在配置代码中有拼写错误或语法错误,也会引起此错误。 解决这个问题的方法是通过以下步骤进行检查和修复: 1. 确认你已经将org.springframework.web.bind.annotation作为依赖项添加到项目中。 2. 确认你正在使用正确版本的Spring框架(版本应该匹配)。 3. 检查项目配置和代码,确保没有错误或拼写错误。 4. 清理和重新构建项目,以便能够重新下载缺少的依赖项。 总之,如果你在编译时遇到了"org.springframework.web.bind.annotation不存在"的错误,请执行上述步骤进行调试并解决该问题。 ### 回答3: 这个错误的意思是在代码中尝试导入Spring Framework的org.springframework.web.bind.annotation包,但是Java编译器无法找到这个包。这通常发生在以下几种情况下: 1. 缺少依赖项:在使用Maven或Gradle等依赖项管理工具时,可能会出现没有正确添加Spring Framework依赖项的情况。你需要检查你的项目配置文件,确保已经正确添加了Spring Framework相关依赖项。 2. 编译器无法找到包:如果你手动编写程序,并且没有正确地设置编译路径,那么编译器将无法找到需要的类库。你需要确保将Spring Framework相关类库添加到编译路径中。 3. 版本不匹配:如果你使用过时的Spring Framework版本,那么其中一些包可能已被删除或重命名。你需要确保使用的Spring Framework版本兼容你的代码,并且检查你的代码是否正确地导入Spring Framework的包。 如果你无法确定造成这个错误的原因,可以尝试使用Google搜索相关的错误信息,或向你的同事或开发者社区寻求帮助。在很多情况下,这是一个非常常见的错误,因此你应该能够轻松地找到解决方案。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值