5/20/2016

Bazel, Eclipse and Java: how to fix the class resolution

Usually the required generated classes are:
bazel-out/local-fastbuild/bin/experimental/examples/protobuf/_javac/address_book_proto_java/libaddress_book_proto_java_classes/


In Eclipse, right click on a project, Properties | Java Build Path | Libraries | Add External Class Folder. Navigate to the generated class folder and add them.

How to add Java project to Eclipse?
1. Create Java Project, say, xelha
2. Create a Source Folder under the project, omap
3. Add a folder in the omap Source Folder. Link the actual location to the folder. Make sure to navigate to the package name folder. For example, if the package name is "package ai.deepmap.hadoop.io;", select the folder ai and link the folder to the ai folder.
4. Do step 3 for other packages you need to add.

No comments: