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

Unable to compile (using kotlinc) #34

Closed
ghost opened this issue May 18, 2023 · 3 comments
Closed

Unable to compile (using kotlinc) #34

ghost opened this issue May 18, 2023 · 3 comments

Comments

@ghost
Copy link

ghost commented May 18, 2023

Hi Diego,

I tried to compile MetaTerm using kotlinc, in my Fedora Linux 38 VM. Unfortunately, it failed to build and threw me errors in the process. I have OpenJDK version 17.0.6. And yes, I've made sure the $JAVA_HOME environment is set to a valid path. I outputted the stderr to a log file. Below are the errors I encountered.

https://pastebin.com/hNbzckrj

It feels like this is my own fault, but I’m not sure what I did wrong. For the record, I know nothing about Kotlin. Am I supposed to compile MetaTerm.kt in the src/jvmMain/kotlin directory? If that’s not what I meant to be doing, it might be the culprit. Any help is greatly appreciated.

Kind regards,
Novian Cahyadi

@diegoberaldin
Copy link
Owner

Hi! This is a gradle project so you need to use gradle to run and compile it. If you want to compile if from the command line rather than using an IDE, you can use the Gradle wrapper executable that is in the root directory of the project.

So cd to the directory where you cloned the project and run a simple
./gradlew run
and it should do the trick.

@ghost
Copy link
Author

ghost commented May 19, 2023

Thank you so much for the response.

I tried to compile MetaTerm again on my Fedora 38 guest, following your solution by running gradlew run. Unfortunately, it still failed to build. But from what I gleaned out of the error messages, it seems that OpenJDK 17.0.6 is not supported, and Gradle requires a newer version of it. So I installed OpenJDK 20.0.1, and switched to this version by running sudo update-alternatives --config java. At last, the build was successful!

Just to double-check, I decided to compile MetaTerm on my openSUSE Tumbleweed host with OpenJDK 18.0.2. And sure enough, it also went smoothly. So it appears that OpenJDK version 18 is the minimum requirement that needs to be present to compile MetaTerm. May I suggest listing this as a dependency? I think the information could be useful for people who run a point-release Linux distro (e.g. Debian Stable), which might not have access to the newer versions of packages from the standard repository.

At any rate, once again I thank you for the help. I can run your program now, and I shall file a bug report when I spot one.

Kind regards,
Novian Cahyadi

@ghost ghost closed this as completed May 19, 2023
@diegoberaldin
Copy link
Owner

diegoberaldin commented May 20, 2023

Thank you very much for your patience and collaboration! Yes, definitely it is worth adding that note about the requirements for anyone willing to compile. Sometimes figuring out what's wrong by looking Gradle errors can be tricky (even after years of working with it) 😂

This issue was closed.
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

1 participant