by x0x0 · 12y ago · 0 comments
That said, java is a special bit of shit. Those shell scripts are really complex. Most java shops have had problems with classpaths exceeding the 32k limit in shells! And java is yet another language where the morons who run it refuse to sand off some of the really sharp edges most likely because their heads are in their asses. To give two really simple examples:
1 - why the fuck can't I import a directory full of jars? eg
--classpath ./lib/jars/*
or better yet, recursively descend --classpath ./lib/jars/**
For personal projects I often use ant just to manage the classpath.2 - a nullsafe repeated dereference operator, like groovy. If I'm pulling out a.b.c.d out of a nested object, in real code, I have to say if
String address = null;
if (a != null)
if (a.b != null)
if(a.b.c != null)
if(a.b.c.d != null)
address = a.b.c.d.address;
return address;
// vs groovy
String address = a?.b?.c?.d?.address;
this is the sort of minor irritant that you have to deal with all day long with deep class hierarchies, and there's some really low hanging fruit to instantly make my life better. sigh.And for java, the combination of ant, maven, ivy, etc, are a special set of hell.
[1] http://docs.oracle.com/javase/6/docs/technotes/tools/windows...
Subdirectories are not searched recursively.
our solution has typically been to unjar all the libs and turn everything into a single giant jar, though this often leads to 100+M jars. 1 - why can't I import a directory full of jars? eg
--classpath ./lib/jars/*
or better yet, recursively descend
--classpath ./lib/jars/**
I usually do this as (in zsh): -cp "$(print -l ./lib/jars/**/*.jar | tr '\n' :)"Use the -Djava.ext.dirs command line flag to do it.
> like Groovy [...] String address = a?.b?.c?.d?.address
The Groovy backers have been talking for years every now and then about making ?. ripple though the . after it, so using a?.b.c.d.address would have the same effect as a?.b?.c?.d?.address , but nothing ever gets done. Better look for a language solution being actively maintained for its original purpose, instead of its backers going off on tangents looking to entangle itself in every pie.
You are doing it wrong then.
So, besides the use of a BS idiom "you're doing it wrong", the parent comment doesn't add much value to the discussion.