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

Compilation error #3

Open
kincsescsaba opened this issue Jun 24, 2021 · 2 comments
Open

Compilation error #3

kincsescsaba opened this issue Jun 24, 2021 · 2 comments

Comments

@kincsescsaba
Copy link

Hi,
I get the following compilation error when running the build:
Compilation failure:
[ERROR] /home/kincsescsaba/IdeaProjects/svg-embedder/svg-buddy/src/main/kotlin/com/phauer/svgbuddy/SvgFontEmbedder.kt:[37,36] Unresolved reference: readString
[ERROR] /home/kincsescsaba/IdeaProjects/svg-embedder/svg-buddy/src/main/kotlin/com/phauer/svgbuddy/SvgFontEmbedder.kt:[91,15] Unresolved reference: writeString
[ERROR] /home/kincsescsaba/IdeaProjects/svg-embedder/svg-buddy/src/main/kotlin/com/phauer/svgbuddy/processing/CliParser.kt:[36,25] Unresolved reference: of
[ERROR] /home/kincsescsaba/IdeaProjects/svg-embedder/svg-buddy/src/main/kotlin/com/phauer/svgbuddy/processing/GoogleFontsClient.kt:[40,60] Unresolved reference: readAllBytes

Can you please check how to resolve this?

@Leif-W
Copy link

Leif-W commented Jul 15, 2021

TL;DR What version on Java is in use? I am guessing Java 8. You need Java 11.

There're 4 errors. Let's take a look at each.

For the first two errors, they seem related. A quick look at the source for SvgFontEmbedder.kt shows that Files.readString and Files.writeString are used. Files is imported from java.nio.file.Files. This API did not have .readString or .writeString methods until Java 11.

The third error in CliParser.kt, is also related. Searching for the next error, Path.of where Path is imported from the similarly named java.nio.file.Path, where the .of method was likewise introduced in Java 11.

The fourth error in GoogleFontsClient.kt comes from the use of ZipFile which is imported from net.lingala.zip4j.Zipfile which calls the method .getInputStream which returns a ZipInputStream which extends an InputStream that is imported from java.io.InputStream which has the .readAllBytes method, introduced in Java 9.

Therefore, you must be using Java 8, where Java 11 is required.

@kincsescsaba
Copy link
Author

You're right, Java 11 was only set in my IDE but not on the overall system. Got it set to the newer version, now works fine, thanks!

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