Column catalog
- Time to upgrade Java11 -01- JDK11 advantages and JDK options
- Time to upgrade Java11 -02- Upgrade JDK11
- Time to upgrade Java11 -03 VIRTUAL machine Jvm parameter Settings
- Http2 Clear Text (H2C)
- Time to update java11 – obstacles and issues with h2c communication in 05 microservices
preface
Following the above, here are some of the pitfalls we encountered in upgrading to Java11 (if you have any other problems, please leave a comment).
First, the font problem
In Linux, Java11 uses fonts for captcha and Excel functions, which triggers font issues in Java11.
Solution:
- createfontconfig.propertiesThe file in
$JAVA_HOME/lib
Directory creationfontconfig.propertiesFile.
As follows:
version=1
sequence.allfonts=default
Copy the code
- Install the fonts
sudo yum install fontconfig
sudo yum install urw-fonts
sudo fc-cache -f
Copy the code
Open JDK Github Issues: github.com/AdoptOpenJD…
Javax.xml. bind does not exist
Java11 removes Java EE modules, including java.xml.bind (JAXB).
Boot prompt
WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file: / com/thoughtworks/xstream/xstream 1.4.10 / xstream - 1.4.10. Jar) to field parator at java.util.TreeMap.comCopy the code
The solution is that you can add dependencies manually.
<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>
Copy the code
Can look at the details: stackoverflow.com/questions/5…
Third, compilation error
The following classes could not be found due to partial API deletion
Sun. Misc. BASE64Encoder, sun. Misc. BASE64DecoderCopy the code
Solution: Use java.util.base64. Encoder and java.util.base64. Decoder instead
Iv. The built-in container cannot be started
When we used Eureka as the registry, we removed the dependent JAXB module.
The JAXB modules which the Eureka server depends upon were removed in JDK 11. If you intend to use JDK 11 when running a Eureka server you must include these dependencies in your POM or Gradle file.
Copy the code
Manual import is required:
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</dependency>
Copy the code
The statement
This series of articles is compiled and written by The author of micA, Rumeng Technology. If there is any reference or reprint, please keep the original author and indicate the source.