If you have somedirectory/code in your classpath, then that's wrong. You always need the base directory in your classpath (in this case it would be somedirectory). Java itself will search those roots for a directory called code containing a file called Constants.class.