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

Java 6 support? #10

Closed
eis opened this issue Jun 28, 2021 · 3 comments · May be fixed by #11
Closed

Java 6 support? #10

eis opened this issue Jun 28, 2021 · 3 comments · May be fixed by #11

Comments

@eis
Copy link
Owner

eis commented Jun 28, 2021

Can this be made to work with Java 6? That is the oldest major java release that would have Azul openjdk distribution available (https://www.azul.com/downloads/?package=jdk#download-openjdk)

@eis
Copy link
Owner Author

eis commented Jun 28, 2021

Notes:

  1. Maven version last to support java 6 is 3.2.5

Sources:

  1. Maven 3.2.5 will default to http link to central which is not longer supported - this can be worked around with explicit https configuration

  2. Java 6 will error on connecting to central since it will require tls 1.2, and Java 6 only supports up to 1.1 (Java 7 supports tls 1.2 but it is disabled by default)

Sources:

To work around this, we can use insecure endpoint as explained in http://insecure.repo1.maven.org.

  1. On compiling we get errors since "Diamond types" and multi-catches are not supported in Java 6. Thus, this code will not build on java 6. However, we can downgrade these features.
  2. Compiler-plugin, surefire-plugin and hamcrest-library versions need to be downgraded if they are to be run on Java 6.

eis added a commit that referenced this issue Jun 28, 2021
eis added a commit that referenced this issue Jun 28, 2021
eis added a commit that referenced this issue Jun 28, 2021
eis added a commit that referenced this issue Jun 28, 2021
eis added a commit that referenced this issue Jun 28, 2021
@eis
Copy link
Owner Author

eis commented Jun 28, 2021

f677da3 shows that this could be done. However, too many sacrifices for it to be in master.

@eis eis closed this as completed Jun 28, 2021
@eis
Copy link
Owner Author

eis commented Jun 28, 2021

Another alternative which could enable using latest java + plugins but build the code with older jdk would be to use toolchains: https://blog.bmarwell.de/en/testing-maven-with-toolchain-and-github-actions/

eis added a commit that referenced this issue Jun 28, 2021
eis added a commit that referenced this issue Jun 28, 2021
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

Successfully merging a pull request may close this issue.

1 participant