You have to have classes aand bin your classpath when you try to compile the class c. This allows the compiler to verify that they exist, to find out what methods they have, etc.
javacquite sensitive to package names and classes. The simplest thing is to collect all three at the same time javac example/a.java example/b.java example/c.java.
( src), :
javac -cp src src/example/c.java
, , , , example. - javac example , a.class b.class.