Skip to content

[BUG] supportJava6=true creates a client with dependencies that do not support Java 6 #8383

Description

@GiamBoscaro

Goodmorning,

I am trying to generate an API client in Java with Open API. Sadly, it needs to work with java 6. I enable the flag, and everything works fine in the development environment (Eclipse) running on Java 11 with compliance for Java 6. When I export the JAR and try to run it in the staging environment with JRE 1.6, I get the error ClassDefNotFound okhttp3/Interceptor. If I try to download this dependency from Maven I then get Unsupported major.minor version 52.0.

So, I am wondering if the flag supportJava6 actually does something or not, since it seems like it requires at least Java 8.

Am I doing something wrong?

I generated the client from the CLI Docker like this:

// from docker-compose.yml

version: "3.6"
services:

  openapi:
    image: openapitools/openapi-generator-cli
    volumes:
      - ".:local"
    command: generate -g java -I local/in/api.yml -o /local/out/java-client --additional-properties=supportJava6=true

Best regards

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions