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

Please provide more detailed build specifications #4590

Open
GrahamJenkins opened this issue Dec 16, 2024 · 1 comment
Open

Please provide more detailed build specifications #4590

GrahamJenkins opened this issue Dec 16, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@GrahamJenkins
Copy link

Hello, this is in response to comment by @ZacSharp in issue #4421 .

I was attempting to build the 1.21(.0) branch, which while it may not be formally supported going forward, I would assume that the build instructions would be accurate. After experiencing multiple build related issues and attempting to resolve dependencies based on the output of the errors, I realized that things aren't exactly clear.

In no particular order: (keep in mind this was on the 1.21 branch, but much or all may apply to the master branch)

  1. What java version(s) are required or supported?
    Originally I was running Java 8, but have seen the switch to 21 for minecraft 1.21+. So my assumption is that I probably require Java 21. Unless I'm trying to build something for 1.19. Or 1.20? A list of compatibility would not be 100% in the scope of this repo, but at least a note of which MC versions require which java. I am also assuming that the build process requires the runtime Java version that will be used.
    Gradle logs at times reported inconsistent information regarding the target version, and while I don't have exact errors saved, I saw errors that mentioned Java 8, 1.8, and 21.
    Edit: There is a note in Setup mentioning: If you have errors with a package missing please make sure you have setup your environment, and are using Oracle JDK 8 for 1.12.2-1.16.5, JDK 16+ for 1.17.1, and JDK 17+ for 1.18.1.
  • It seems that this may simply need to be updated for versions that require Java 21. Please clarify?
  1. Are there additional packages that are required? As a Linux user, I generally will only install openjdk-21-jre. However some of the errors I encountered mentioned being unable to find tools.jar. I never fully resolved this, however my suspicion was that it was either requiring an additional package such as openjdk-21-jdk or would require some manual copying/symlinking between versions.

  2. This is speculation, but the current SETUP.md mentions Java 8. So either A this is outdated (and see point 1) or B this is accurate, in which case it bears mentioning to the user that even if they are running Java 21 for running recent Minecraft versions, they are also going to require Java 8 to build. While running multiple Java versions may be an exercise left to the reader, IMHO it would bear mentioning that this may be a requirement. (I believe this requires defining a java home variable and/or updating the gradle settings file)

  3. Building uses a repository-provided gradlew. Am I correct in assuming this is the dependency, and at the time of writing it uses Gradle 6.9.4?

  4. Just for reference, I attempted to build baritone from the main branch, with a system running openjdk version "21.0.5" 2024-10-15 OpenJDK Runtime Environment (build 21.0.5+11-Ubuntu-1ubuntu124.04) OpenJDK 64-Bit Server VM (build 21.0.5+11-Ubuntu-1ubuntu124.04, mixed mode, sharing)

When attempting to build on this version, I am given the following error:```

  • What went wrong:
    Could not compile settings file '/home/user/code/baritone/settings.gradle'.

startup failed:
General error during semantic analysis: Unsupported class file major version 65

java.lang.IllegalArgumentException: Unsupported class file major version 65```

Thanks for your time, I am not saying that every single version of everything should be indefinitely supported. I am saying that even as an experienced user/developer relatively familiar with building software, I can't seem to figure out the exact dependencies required to build and I would appreciate a bit more details in the SETUP.md file.

@GrahamJenkins GrahamJenkins added the enhancement New feature or request label Dec 16, 2024
@ZacSharp
Copy link
Collaborator

You might want to proof-read #4587. Unless I forget about it I'll also add a line about needing a jdk rather than jre.

  1. Yes, Java 21 is correct for the 1.21.x branches and Java 8 for master.
  2. You probably need a jdk and if your system puts it into weird places some autodetection magic might go wrong. I have no idea what gradle does and our build plugin definitely does some weird things to find the path to the java being used (because it needs all dependencies for proguard)
  3. It was way outdated. You shouldn't need multiple java versions at once, but it might reduce reinstallation efforts if you do install them in parallel (by now I accumulated 5+ on my system and at least 3 of them are in use)
  4. The gradlew file is a trick used by gradle so it doesn't need to be installed as a system dependency while still being light enough to be committed into version control. It's a thin wrapper which automatically downloads the actual gradle executables for whatever version the configuration wants. You can look at gradle/wrapper/gradle-wrapper.properties to check which version it uses. For 1.19.4 that's 8.2, for 1.21.1 it's 8.7 and for master it is indeed 6.9.4
  5. That java version looks fine for 1.21.x, but waaay to new for master and maybe too new for 1.19.4.

Putting details into SETUP.md comes with the problem of keeping those up to date and there's just too many configurations. Updating the instructions for any one of them requires at least some knowledge of the setup.
You could build baritone on a mac, windows, various linuxes, using some IDE or an editor plugin. Finding the installation path of java differs across the various operation systems and the IDE/editor might also be managing some java installations for you. Gradle can hiccup in various ways so locating gradle caches is also a thing. And then there's stuff which also differs between Baritone branches because the build process changed.
Most of that shouldn't even need explanation from our side, because there's nothing Baritone specific to say about them. It's not our job to tell you how to use your IDE, or install java on whatever weirdness your OS happens to be. The bare minimum is telling you what you need and how to kick off the build once you got the manual dependencies installed, both of which I hope I addressed properly in my attempt at updating SETUP.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants