一、jdk11 移除了 Base64
替代方案
Base64.getEncoder().encodeToString
Base64.getDecoder().decode
二、Maven 打包報錯
修改方案,更新maven打包插件
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
三、Lombok 無法使用
解決方案,升級lombok
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.4</version>
<scope>provided</scope>
</dependency>
四、xmlelement 注解無法使用
解決方案,引入外部jar,jdk11已經移除此包
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.0</version>
</dependency>
福利大放送
關注微信公眾號“AI碼師”,領取面試資料和2021最新全套微服務教程

轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/293946.html
標籤:java
