openai-java icon indicating copy to clipboard operation
openai-java copied to clipboard

OS/X Error running example

Open mik3hall opened this issue 1 year ago • 1 comments

(base) mjh@Michaels-MacBook-Pro openai-java % ./gradlew example:run

FAILURE: Build failed with an exception.

  • Where: Settings file '/Users/mjh/Documents/GitHub/openai-java/settings.gradle'

  • What went wrong: Could not compile settings file '/Users/mjh/Documents/GitHub/openai-java/settings.gradle'.

startup failed: General error during conversion: Unsupported class file major version 63

java.lang.IllegalArgumentException: Unsupported class file major version 63

Google turned up ( https://github.com/react-native-community/cli/issues/1719 ) changing grade/wrapper/gradle-wrapper.properties from...

distributionUrl=https://services.gradle.org/distributions/gradle-7.4.2-bin.zip

for me to...

distributionUrl=https://services.gradle.org/distributions/gradle-8.0.2-bin.zip

This seemed to get past the class file version error but I am getting another error I am looking at.

mik3hall avatar Mar 04 '23 13:03 mik3hall

The additional error was that at some point I had changed Terminal sessions and not set the API key. I had to run with --debug to see this. Could be clearer? I had added the gradle path to my .zshrc. Not sure if that made any difference. But if I'm supposed to be seeing turtles? The example now runs. The above change might not need to be to the latest gradle version to correct the class version error.

mik3hall avatar Mar 04 '23 14:03 mik3hall

I saw a couple other similar questions so I added an explicit null check to OpenAiService :+1:

TheoKanning avatar Mar 08 '23 01:03 TheoKanning