Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Modules "google.cloud.vertexai" and "proto.google.cloud.vertexai.v1" conflict in module-info.java

AAGfx
New Member

Hello,

I am working on a JavaFX project has a module named module-info.java. I added the dependency with artifact named "google-cloud-vertexai". This dependency imports automatically "google.cloud.vertexai" and  "proto.google.cloud.vertexai.v1" modules. And when I use packages in java class, it requires adding dependencies to module-info.java. The problem is, modules have different packages with same name "com.google.cloud.vertexai.api". And they causes confliction in module-info-java. If I remove the module-info.java everything about Vertex AI is fine. But I could not use with module-info.java. Code requires both module, hence I need to import both. Please help, I need to use Gemini AI in Java.

0 1 206
1 REPLY 1

Hi @AAGfx,

Welcome to Google Cloud Community!

It seems that modularized projects are not yet supported in Google Cloud SDKs which caused this behavior. If you don't plan on using module-info.java, a workaround is to use a version of Java less than 9.

I highly suggest to file a feature request and share your use case. Please note that I can't provide any details or timelines at this moment. However, you may keep an eye on the release notes for any latest updates or new features related to Vertex AI.

Hope this helps.