Com libs not found in Java

Hello dexter forums.

We’re currently trying to access the components on our gopigo, but BlueJ will not pick up any of our imported com packages. So far I have installed Pi4J for java and the associated JAR files. If I am missing a step I would like to know what it is. I appreciate the help.

Hi,

I think you haven’t setup your library folder appropriately.
Can you show me what your project folder looks like so that I can compare it?

If you haven’t provided a correct path to the *.java library files, than, yes, you will end up having this problem.

Your project directory should look like this:

 MyProject/ ===> com/ ===>  dexterind/ ===> gopigo/ ===> [all library files]
            ===> MyProject.java

And when you compile you do need this following line of commands:

sudo -p mkdir ./bin
sudo javac -d ./bin -classpath .:classes:/opt/pi4j/lib/'*' ./MyProject.java /src/com/dexterind/gopigo/*.java ./src/com/dexterind/gopigo/behaviours/*.java ./src/com/dexterind/gopigo/components/*.java ./src/com/dexterind/gopigo/events/*.java ./src/com/dexterind/gopigo/utils/*.java;

Hi,
I agree with you. Thanks for sharing this excellent answer.