Context
I am using Katalon Studio for an OpenAI-powered web scraping project. I scrape a website, for some PDFs, and use OpenAI to parse those for some data.
Problem
After losing some days to dabbling in this, I have discovered someone made a simple-openai library that works with JVM languages. I added it to my build.gradle:
plugins {
id 'groovy'
id "com.katalon.gradle-plugin" version "0.1.1"
}
repositories {
mavenCentral()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/MikeWarren2014/KatalonStudioSDK")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
dependencies {
implementation 'me.mikewarren.katalonstudiosdk:katalon-studio-sdk:1.0'
implementation("com.squareup.okhttp3:okhttp:4.12.0")
// https://mvnrepository.com/artifact/org.apache.pdfbox/pdfbox
implementation 'org.apache.pdfbox:pdfbox:2.0.24'
// https://mvnrepository.com/artifact/io.github.sashirestela/simple-openai
implementation 'io.github.sashirestela:simple-openai:3.5.1'
}
…create OpenAIUtils keyword for my project…using the SimpleOpenAI stuff…
…and then face the following error messages:
| Description | Resource | Path | Location | Type |
|---|---|---|---|---|
| The project was not built since its build path is incomplete. Cannot find the class file for java.net.http.HttpClient. Fix the build path then try building this project | MyCaseScraper.prj | C%%Users%FCP%OneDrive%Desktop%Software development%MyCaseScraper%MyCaseScraper.prj | Unknown | Java Problem |
| The type java.net.http.HttpClient cannot be resolved. It is indirectly referenced from required .class files | OpenAIUtils.groovy | /C%%Users%FCP%OneDrive%Desktop%Software development%MyCaseScraper%MyCaseScraper.prj/Keywords/me/mikewarren/myCaseScraper/utils | line 1 | Java Problem |
It says that I need to configure the Build Path, but am not sure why…
I check the Build Path in the Katalon Studio Preferences, and see the following:
I check the Installed JREs and see the following:
Execution Environments, the child menu option, returns the following:
It seems like the SimpleOpenAI is using some different version of java.net.http.HttpClient than the Katalon Studio…but iirc, that is a core class from the JRE…
This error message only popped up when I import io.github.sashirestela.openai.SimpleOpenAI and start using it…
package me.mikewarren.myCaseScraper.utils
import io.github.sashirestela.openai.SimpleOpenAI
import io.github.sashirestela.openai.domain.assistant.VectorStore
public final class OpenAIUtils {
private static SimpleOpenAI openAI;
private static VectorStore captchaStore, pdfStore;
public SimpleOpenAI GetOpenAI() {
if (this.openAI == null)
this.openAI = SimpleOpenAI.builder()
.apiKey(System.getenv("OPENAI_API_KEY"))
.build();
return this.openAI;
}
}


