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

Bot giving error: bad constant pool index: 0 at pos: 48461... [ADVICE ON HOW TO FIX] #153

Open
kevinzhao07 opened this issue Feb 13, 2024 · 2 comments

Comments

@kevinzhao07
Copy link

kevinzhao07 commented Feb 13, 2024

When first setting up the bot to run using sbt, I encountered this error when running sbt. I was able to fix the error but this is for anyone who may be facing a similar issue.

  1. Make sure you have Java JDK Installed. I am running openjdk 21.0.2
  2. Make sure you have Scala installed, by running brew install coursier/formulas/coursier && cs setup (for MAC). I am running 3.3.1
  3. Make sure you have sbt installed, by running brew install sbt. I am running 1.9.8

You should be able to find version by running: java --version, scala --version, sbt --version

I am doing this in 2024. The issue comes from the build.properties file in resy-booking-bot/project/build.properties. The sbt.version field is hardcoded to 1.7.1, which is a older legacy version that may not work with the latest version of Java JDK. Replace this value with your current sbt version.

EDIT: With doing this, you will also have to change the scalaVersion found in resy-booking-bot/build.sbt to one that is compatible with the sbt version. I am using 21.0.2, so changing this value to 2.13.11 works for me. I looked it up online and anything after 2.13.11 works well with 21.0.2 version of JDK.

@buildgreatthings
Copy link

If you want to avoid installing cs, you can use sbt to 1.9.5, scala 2.13.12 and keep openjdk at 21.0.2 (or lower). Changes to the build.properties still required.

@jrusso1020
Copy link

For those curious on exact steps to get the right versions on a mac you can do the following

install sdkman via https://sdkman.io/install

curl -s "https://get.sdkman.io" | bash

can run the below in same terminal or open a new one

source "$HOME/.sdkman/bin/sdkman-init.sh"

Install java/jdk via sdkman (I'm using 21.0.3 alright, but as mentioned above 21.0.2 works as we ll)

sdk install java 21.0.3

Install scala

sdk install scala 2.13.2

Install sbt

sdk install sbt 1.9.5

Update this line here

scalaVersion := "2.13.8"
to the scala version (2.13.2)

Update this line here to the sbt version(1.9.5)

Run sbt in project root directory, followed by a run once in sbt prompt and should see it download dependecnies and run the service/daemon with an output indicating success

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

3 participants