idea 导入 spring boot 项目,build失败

Clearing build system data...
Executing pre-compile tasks...
Loading Ant Configuration...
Running Ant Tasks...
Cleaning output directories...
Running 'before' tasks
Checking sources
Copying resources... [ahh]
Parsing java... [ahh]
java: Errors occurred while compiling module 'ahh'
javac 11 was used to compile java sources
Finished, saving caches...
Compilation failed: errors: 3; warnings: 0
Executing post-compile tasks...
Loading Ant Configuration...
Running Ant Tasks...
Synchronizing output directories...
2020/12/17, 9:43 PM - Build completed with 3 errors and 0 warnings in 5 s 706 ms
/Users/lidashuang/Projects/ahh/src/main/java/com/weavi/ahh/controller/UserController.java:4:52
java: package com.sun.org.apache.xpath.internal.operations does not exist
/Users/lidashuang/Projects/ahh/src/main/java/com/weavi/ahh/controller/UserController.java:131:19
java: cannot find symbol
  symbol:   class Bool
  location: class com.weavi.ahh.controller.UserController
/Users/lidashuang/Projects/ahh/src/main/java/com/weavi/ahh/controller/UserController.java:4:52
java: package com.sun.org.apache.xpath.internal.operations does not exist
/Users/lidashuang/Projects/ahh/src/main/java/com/weavi/ahh/controller/UserController.java:131:19
java: cannot find symbol
  symbol:   class Bool
  location: class com.weavi.ahh.controller.UserController

最佳答案

看上去是java sdk 版本的问题,你要导入的包名只存在于JDK8,高版本的已移除,
把项目的 SDK 从高版本降至 1.8. 对 IntelliJ, 从 File --> Project Structure 里设置。