Known issue. You need to specify --main on the command line, as follows: gcj primerprog.java --main=primerprog This should be downgraded to 'wishlist', since it's documented. In multi-class projects, it's obvious that you need to do this. There are plans to eventually make gcj clever enough to assume this when there's only one file on the command line, but there are way too many higher priorities.