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

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;
	}
}

1 Like

Hi there,

Thank you very much for your topic. Please note that it may take a little while before a member of our community or from Katalon team responds to you.

Thanks!

This class is available in the Java 11 and newer.

You are using Katlaon Studio v8.6.x, which bundles the Java 8, too old.

You need Katalon Studio v9.x

Is that the version that takes away the debugger if you’re not paying for the software?

I don’t know about the debugger.

All I know is that the CustomKeyword was taken away from the free plan as of v9.1.0.

… and seeing that this is literally a custom keyword that I’m trying to write…

Seems like I need to get away from Katalon Studio ASAP

1 Like

Not necessarily. You can use v9.0.0 or v9.0.1 and freeze yourself with it. V9.0.1 runs on JDK17 and allows you to develop Keywords. That’s the last and greatest version of Katalon Studio Free for you.

But nobody would stop you to get away from Katalon.

Also, you have enough Kudo points to do over a year worth for the purchase of an Enterprise license so you can do your custom keyword(s). And some left over for a Starbuck’s coffee gift card. :slight_smile:

Edit: The debugger was taken away in version 7 into the Enterprise only license, I believe. Keywords were taken away in version 9.