Perils of javac, part 2

Is anyone successfully using -sourcepath on 1.4.2_04?

I cannot get it to work at all just from a basic commandline. I can’t believe that Sun would not have a regression test for this: I can’t believe it’s actually broken!

But I’ve followed the docs exactly and it doesn’t work :(.

I get:


error: cannot read: source.java

With a subdirectory “src” containing a file called “source.java” which is not in any package. Doesn’t work even if source.java is in a package. Doesn’t work even if you place source.java in a subdirectory of the name of it’s package (itself in the subdiectroy “src”).

BUT if I move the file from the sourcepath into the current working directory, it works fine.

It seems that it’s just completely broken :(.

PS perhaps we could do with a new category “JDKs” for all issues relating to:

  • new releases of java (1.4.2_04, 1.5 beta, 1.5 final etc)
  • contentious: problems with JDK tools like this one :wink: (IMHO it should probably be dealt with on a more general java forum; however, sun’s JDC is absolutely vile as a user-experience so I sympathise with all those who don’t use it)
  • discussions on the difficulties of getting people to download JRE etc
  • discussions on the future of the JRE
  • etc (there’s quite a lot of chatter on these topics…)

Sigh. Yes, it’s a bug. Yes, at least one Sun engineer has marked it as closed, won’t fix.

In fact the tool docs for javac are completely wrong (would like to throttle whoever is responsible for this):

According to the closed bug reports, this is not true. In fact it is NOT to “search for class …definitions”; it is only to “search for class definitions that are imported by one or more of the source files specfied later on the command-line; sourcepath is ignored when trying to find the files specified later on the command-line”.