0

I am using deprecated Java Sun packages that can only be found in rt.Jar, when I compile in jdk 1.8 it works fine, but I am now using jdk 11 and when I compile it throws the following

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:compile (default-compile) on project agency: Compilation failure: Compilation failure: com/simpay/uba/agency/mapper/XmlBuilder.java:[8,43] error: package com.sun.xml.internal.bind.marshaller does not exist com/simpay/uba/agency/mapper/XmlCharacterHandler.java:[12,43] error: package com.sun.xml.internal.bind.marshaller does not exist com/simpay/uba/agency/mapper/XmlCharacterHandler.java:[19,44] error: cannot find symbol symbol: class CharacterEscapeHandler

Basically I'm trying to unescape a CDATA payload before sending so I need the following libraries above. Below is my maven plugin I added which works fine on jdk 1.8

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>11</source> 
                    <target>11</target> 
                    <fork>true</fork>
                    <compilerArgs>
                        <arg>-XDignore.symbol.file</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.0</version>
                <configuration>
                    <source>11</source> 
                    <target>11</target> 
                    <fork>true</fork>
                    <compilerArgs>
                        <arg>-XDignore.symbol.file</arg>  
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
      </plugins>

I even tried this link solution from this link but it seems like that <bootclasspath/> has been deprecated also. I tried 3.0, 3.3, 3.8.1, 3.7, and 3.6 of the maven compiler plugins. No effect also. I have looked at the following links link1 link2 none of which solves my problem on jdk 11.

DaviesTobi alex
  • 610
  • 1
  • 9
  • 34

0 Answers0