Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: package javax.xml.bind.annotation does not exist #175

Closed
AndyNicholls opened this issue Oct 1, 2020 · 5 comments
Closed

error: package javax.xml.bind.annotation does not exist #175

AndyNicholls opened this issue Oct 1, 2020 · 5 comments

Comments

@AndyNicholls
Copy link

I am trying to build the jar files using ant on windows 10. I am getting the message 'error: package javax.xml.bind.annotation does not exist'. Searching the net indicates this package is no longer shipped with the java SE JDK. I am using ant to build. Stackoverflow suggest adding the --add-modules java.xml.bind compiler option, but I could not get this to work with ant . I have seen some work-arounds by updating the pom.xml file, but I am not using maven.

I also had an issue with log4j not found. I fixed this by adding log4j to the .classpath file.

Apache Ant(TM) version 1.9.15 compiled on May 10 2020
JAVA_HOME=C:\Program Files\Java\jdk-15

C:\Users\andrewn\Documents\Personal\sdk-java-master>ant jar
Buildfile: C:\Users\andrewn\Documents\Personal\sdk-java-master\build.xml

compile:
[javac] Compiling 332 source files to C:\Users\andrewn\Documents\Personal\sdk-java-master\target\classes
[javac] warning: [options] bootstrap class path not set in conjunction with -source 8
[javac] C:\Users\andrewn\Documents\Personal\sdk-java-master\src\main\java\net\authorize\api\contract\v1\ANetApiRequest.java:11: error: package javax.xml.bind.annotation does not exist
[javac] import javax.xml.bind.annotation.XmlAccessType;
[javac] ^
[javac] C:\Users\andrewn\Documents\Personal\sdk-java-master\src\main\java\net\authorize\api\contract\v1\ANetApiRequest.java:12: error: package javax.xml.bind.annotation does not exist
[javac] import javax.xml.bind.annotation.XmlAccessorType;
[javac] ^
[javac] C:\Users\andrewn\Documents\Personal\sdk-java-master\src\main\java\net\authorize\api\contract\v1\ANetApiRequest.java:13: error: package javax.xml.bind.annotation does not exist
[javac] import javax.xml.bind.annotation.XmlElement;
[javac] ^
[javac] C:\Users\andrewn\Documents\Personal\sdk-java-master\src\main\java\net\authorize\api\contract\v1\ANetApiRequest.java:14: error: package javax.xml.bind.annotation does not exist
[javac] import javax.xml.bind.annotation.XmlSeeAlso;
[javac] ^
[javac] C:\Users\andrewn\Documents\Personal\sdk-java-master\src\main\java\net\authorize\api\contract\v1\ANetApiRequest.java:15: error: package javax.xml.bind.annotation does not exist
[javac] import javax.xml.bind.annotation.XmlType;

@gnongsie
Copy link
Contributor

gnongsie commented Oct 5, 2020

Hi,

Thank you for reaching out to us about this.

Unfortunately, the Java version for this code is capped at JDK 1.8 (which has LTS till 2030). JDK >=1.9 has made changes to the JRE which has removed some of these imports which were originally part of the JRE.

Kindly downgrade the JDK to 1.8 (or Java 8).

@Staticsubh
Copy link

We are facing the exact issue with Java 11.

@devharsh
Copy link

devharsh commented Dec 7, 2020

switch to 1.8.0_261 as 1.8.271.09 gives issues

@prakashtjp
Copy link

I don't want to downgrade to 1.8. What is the fix for Java 17?

@gnongsie
Copy link
Contributor

We have updated the SDK to use JakartaEE from v3.0.0, which will have continued support for Java 9 and higher.
Please note that we have released the final version (v2.0.7) for Java 1.8, and we have discontinued support for Java 1.8 and lower.
Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants