hi
i’m using ubuntu and i have a little project with several packages i wrote in eclipse.
when i am trying to compile (run javac) from the terminal i get numerous errors like:
Writeable.java:14: cannot find symbol
symbol : class IllegalFilterArgumentException
location: class oop.ex1.filters.Writeable
throw new IllegalFilterArgumentException();
now in eclipse everything was fine. i was told its because i need to run javac from a directory that can see all java files in my project, but it didn’t work. any ideas? thanks
If you are using packages (as you are, from the error message), you must arrange your source files in package structure, and then call
javacfrom the root of this structure. For example this way:oopex1filtersWriteable.javaIllegalFilterArgumentException.javaThen you’ll call it this way:
Alternatively to “calling from the root directory” you could pass this root directory as an option to javac:
(You may also want to give other options to
javac, look at its help page.)