#889 HJ generates class files in wrong directories

Mathias Ricken

When using the HJ compiler from within DrJava, the HJ compiler generates class files for classes not in the default package in the wrong directories.

Example: The foo.bar.HelloWorld class is in the directory

The class files should be generated in the same directory (or in the foo/bar subdirectory of the build directory).

Due to a bug, the class files are generated in /Users/mgricken/bin/hj.release/examples/foo/bar/foo/bar.
The package part of the directory is replicated in the directory of the source file. The class files are even generated there if a build directory is set, i.e. the compiler ignores the build directory setting.


  • Mathias Ricken
    Mathias Ricken

    I fixed part of this bug in revision 5401.
    When using a project with a build directory set, DrJava will now put the classes in the right place. Without a build directory set, the problem still exists.

    This is because the HJ compiler does not mimic the javac behavior of putting classes in the same directory as the source file, if no destination directory is specified.