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

Does not compile with Java 9 #7976

Open
JohannesHoppe opened this issue Apr 5, 2018 · 2 comments
Open

Does not compile with Java 9 #7976

JohannesHoppe opened this issue Apr 5, 2018 · 2 comments
Assignees

Comments

@JohannesHoppe
Copy link
Contributor

Description

This is a friendly reminder that swagger-codegen fails on Java 9.
Everything compiles as expected with Java 8.

Swagger-codegen version

all version 2.x and 3.x

Steps to reproduce

Install Java 9

java --version
java 9.0.4
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
mvn clean package
-------------------------------------------------------------------------------
Test set: TestSuite
-------------------------------------------------------------------------------
Tests run: 582, Failures: 128, Errors: 0, Skipped: 3, Time elapsed: 7.065 sec <<< FAILURE! - in TestSuite
checkOptionsHelp(io.swagger.codegen.lagomScalaApi.LagomScalaApiOptionsTest)  Time elapsed: 0.03 sec  <<< FAILURE!
java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct

....

This might be related to:
https://stackoverflow.com/questions/34947994/neon-how-to-run-on-jdk9

Suggest a fix/enhancement

Right now it's fine to install Java 8 as instructed in the README.
This issue hopefully helps other people when searching for a solution.
But this should be fixed some day, too! 😉

In example, on my Mac I did the following:

brew cask install caskroom/versions/java8

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
export PATH=${JAVA_HOME}/bin:$PATH

java -version
@JohannesHoppe JohannesHoppe changed the title [JAVA] Does not compile with Java 9 Does not compile with Java 9 Apr 5, 2018
@karux
Copy link

karux commented Oct 4, 2018

any status on this bug? this impacts java10 compatibility as well. java8 standard commercial public update support ends January 2019. JCP notice can be found at https://bugs.java.com/view_bug.do?bug_id=JDK-8049422

@ghost
Copy link

ghost commented Feb 11, 2019

A generated Java client with

  "useBeanValidation": true,
  "performBeanValidation": true,

can't also be built with Gradle and Java 11.

frantuma added a commit that referenced this issue Feb 13, 2019
ref #7976 - update mockito to support JDK9+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants