Search code examples
javamultithreadingcommand-linecompiler-errorsjavac

Java code not compiling with 'javac' but compiles in Eclipse


I have just written a Java multi-threaded program in Eclipse. It compiled fine and works like a charm.

However, as this is coursework we are required to ensure that it compiles in the command line using 'javac' otherwise we score ZERO!

So, some classes compile others don't. The error I'm getting is the following ( they are all similar just with different class names, this is one example)

GateRunnable.java:7: cannot find symbol
symbol  : class Station
location: class package.name.here.GateRunnable
    public GateRunnable(Station st) {
                        ^

Is this a javac issue? Any help appreciated.


Solution

  • To solve the problem I was having, it was simply necessary to compile all classes by using the following command:

    javac *.java 
    

    which compiles all java files in the directory.