There are a lot of big things (lack of closures, type inference, etc, etc) to dislike about Java. This is a list, in no particular order of little things that make day to day Java development just that much more irritating. Most of these are just convenience methods whose omission is unforgivable. Libraries exist to address all of them, but that’s beside the point.
1) No string join method
How many times have I written this?
2) No way to set additional JVM parameters in manifest of executable jar
It’s really convenient to just double-click a jar … until you need to set your heap size or something and you have to go crawling back to a shell script.
3) java.net.URL constructor throws checked MalformedURLException rather than unchecked IllegalArgumentException
Seriously, what is so special about this exception?
4) java.io.File has no getExtension() method
Same as join() above.
5) No immutable collections. Collections.unmodifiableList() and friends don’t count
6) java.io.File.delete() silently does nothing if you try to delete a non-empty directory
It’s even more irritating to write deleteFolder() than join() and getExtension().
7) java.util.Random has a setSeed() method, but no getSeed() method
8) java.util.logging is built-in and incredibly lame
They sucked every ounce of the joy out of log4j.
9) JTree selection behavior gives me a headache every time I have to deal with it
10) No method to just read an entire InputStream or Reader into a byte array or string
Same as join() above.
Bonus) No method to copy a file!
java
java