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

Error during local testing could not find or load main class #239

Open
Dogacel opened this issue Nov 8, 2022 · 2 comments
Open

Error during local testing could not find or load main class #239

Dogacel opened this issue Nov 8, 2022 · 2 comments
Labels
bug Something isn't working component-codegen question Further information is requested

Comments

@Dogacel
Copy link
Contributor

Dogacel commented Nov 8, 2022

I was following the readme and did

> ./gradlew :protoc-gen-pbandk:protoc-gen-pbandk-jvm:assembleDist
> ./gradlew :protoc-gen-pbandk:protoc-gen-pbandk-jvm:installDist

and when I tried to run protoc it gave me the could not find or load main class pbandk.gen.MainKt error. The solution was:

  • ./gradlew :protoc-gen-pbandk:protoc-gen-pbandk-lib:build
  • Use java-8 rather than java-11

I am not sure which lead to the solution just opening the issue to guide others.

@garyp
Copy link
Collaborator

garyp commented Nov 8, 2022

Hmm. We use Java 11 in the CI jobs, so it should definitely work fine with Java 11. How did you run protoc after the installDist step?

@Dogacel
Copy link
Contributor Author

Dogacel commented Nov 8, 2022

protoc --plugin=protoc-gen-pbandk=/Users/dogac/workdir/pbandk/protoc-gen-pbandk/jvm/build/install/protoc-gen-pbandk/bin/protoc-gen-pbandk \
--pbandk_out=kotlin_package_mapping="pbandk.*->com.*;testpb->testpb2":src \
*.proto

I was experimenting with the new package mapping option. If Java-11 is already in the CI jobs, probably the first command did the thing. But still, I was having compilation issues when running build with java-11. I was seeing issues with File. When I have some spare time, I will replicate and post the error codes during compilation with java-11.

@garyp garyp added bug Something isn't working question Further information is requested component-codegen labels Nov 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component-codegen question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants