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

[BUG] Install issue on Mac M1 #242

Closed
6 tasks
spacether opened this issue Sep 21, 2023 · 12 comments
Closed
6 tasks

[BUG] Install issue on Mac M1 #242

spacether opened this issue Sep 21, 2023 · 12 comments

Comments

@spacether
Copy link
Contributor

spacether commented Sep 21, 2023

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request

User @yuericlin was unable to build the java program or run the docker image

Description

java build

Java build: one test failing: testGetServerURLWithVariables
note: java version (20) is higher than 11

brew installed version of maven says that it was built with java 20

Apache Maven 3.9.4 (dfbb324ad4a7c8fb0bf182e6d91b0ae20e3d2dd9) Maven home: /opt/homebrew/Cellar/maven/3.9.4/libexec Java version: 20.0.2, vendor: Homebrew, runtime: /opt/homebrew/Cellar/openjdk/20.0.2/libexec/openjdk.jdk/Contents/Home Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "13.5.2", arch: "aarch64", family: "mac" brew does not have 3.9.3

system info

Chip: Apple M1 Max
macOS: 13.5.2

docker run issue

docker: Error response from daemon: error creating overlay mount to /var/lib/docker/overlay2/86deda23b4fa75c8f536064cd2a1e289f3beae71592d41a3d3151d82fd3a1092-init/merged: too many levels of symbolic links.

openapi-json-schema-generator version
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs

similar-to install issue was resolved by installing java 11

Suggest a fix
@spacether
Copy link
Contributor Author

@yuericlin have you been able to install java 11 and get building working?

@yuericlin
Copy link

@yuericlin have you been able to install java 11 and get building working?

no, I have not found any work-around yet. :(

@spacether spacether linked a pull request Oct 2, 2023 that will close this issue
3 tasks
@spacether spacether mentioned this issue Oct 4, 2023
3 tasks
@spacether spacether removed a link to a pull request Oct 4, 2023
3 tasks
@spacether
Copy link
Contributor Author

@yuericlin can you try pulling the latest master branch and running mvn clean package and seeing if that works for your java 20? That works on my system using java 20.

@yuericlin
Copy link

@yuericlin can you try pulling the latest master branch and running mvn clean package and seeing if that works for your java 20? That works on my system using java 20.

yes, it works now, thank you so much!

however, there were some errors in the log,
"[main] WARN com.tngtech.archunit.core.importer.ClassFileProcessor - Error during import from jrt:/java.base/java/lang/Package.class, falling back to simple import
java.lang.IllegalArgumentException: Unsupported class file major version 64"

@spacether
Copy link
Contributor Author

spacether commented Oct 4, 2023

I think that that is a problem with your environment, not this software. Please work on downgrading your Java to 11 as that solved this issue previously. A different maven version may be needed.

@yuericlin
Copy link

That is a problem with your environment, not this software. Please work on downgrading your Java to 11 as that solved this issue previously. A different maven version may be needed.

I has downgraded my java to 11.0.20.1, but the maven installed by brew was built with java 20.0.2.
probably I need to build my own maven, :(

@spacether
Copy link
Contributor Author

Can you look for a lower version of maven that uses Java 11?

@spacether
Copy link
Contributor Author

spacether commented Oct 4, 2023

Can you also delete and re-pull this image and try to use it: openapijsonschematools/openapi-json-schema-generator-cli:latest
I merged a PR which should remove symlinks from the generated image, and should hopefully eliminate the too many levels of symbolic links. error.

@spacether
Copy link
Contributor Author

@yuericlin if I don't hear from you in the next two weeks I will close this issue due to inactivity

  • previous work shows that installing java 11 and a compatible maven version works for this issue
  • I merged in 2 PRs to improve functionality here, one to allow tests to pass in java 11, and another to remove symlinks from the docker image. I do not have an m1 mac so I am unable to verify if the symlink update fixes this issue

@yuericlin
Copy link

yuericlin commented Oct 16, 2023

Thank you @spacether , and sorry for the late response.

confirmed that symbolic link error is not appearing, but the other errors are still remaining, because I couldn't figure a straight forward way to downgrade maven without manually build from source (the maven build installed with brew only have java 20). btw, I did downgrade my java compiler to 11 even at the time we had the live debugging section.

So, feel free to close the ticket, since I can build the tool successfully.

@spacether
Copy link
Contributor Author

spacether commented Oct 16, 2023

Right but maven reports what Java it is using. When you did that maven was still using Java 20. Does docker now work for you?
Per this: maven uses the java pointed to by JAVA_HOME env variable: https://www.baeldung.com/maven-different-jdk so using java 20 is not a maven version issue, it is an environment variable issue.

@spacether
Copy link
Contributor Author

Closing per the above feedback. @yuericlin feel free to keep responding here.

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

2 participants