Live data from Hacker News

Java Pain

tbray.org

51–60 of 151 posts

Re: Java Pain

#51
post #4

$CLASSPATH pain is one of the first things a new Java developer encounters — maybe the last, in many cases. The only reason it's not quite as bad in .NET is that it can usually reference at least the framework in a well-known location. But generally, whatever you call the problem that $CLASSPATH is designed to solve (assembly binding, reference resolution), it's an unsolved problem.

not sure what .Net issues you're referring to, but they sound sort of obscure

Re: Java Pain

#52
Executable jar anyone? It's not that hard. Generating a standalone executable (a jar plus a bundled JRE) is not as simple as it should be, but it's certainly doable.

Re: Java Pain

#53
post #47

The confusing series of shell scripts most Java services (Cassandra, Kafka, Elasticearch) come wrapped in are a constant annoyance. Not only do they rarely if ever follow common shell command idioms, but trying to configure production services turns into tracing environment variables through a series of shell scripts sprinkled across my system. It's nothing wrong with Java the language, but the platform just seems to…

I was about to say "omg yes" -- as someone who writes piles of java code, this is a constant pain. However, look at the other tools: I run python out of a virtualenv. I use rvm to run multiple rubys, and that shit breaks all the time for me. (Or rather, I use it infrequently enough that I never learn it well enough; I use it for the first time again every 2-3 months). That said, java is a special bit of shit. Those s…

Re: classpath. You mean like this[1]?

[1] http://docs.oracle.com/javase/6/docs/technotes/tools/windows...

Re: Java Pain

#54
post #46

The confusing series of shell scripts most Java services (Cassandra, Kafka, Elasticearch) come wrapped in are a constant annoyance. Not only do they rarely if ever follow common shell command idioms, but trying to configure production services turns into tracing environment variables through a series of shell scripts sprinkled across my system. It's nothing wrong with Java the language, but the platform just seems to…

Java just has a slow to adapt ecosystem, and that slowness seeps into everything Java touches. The fact that it's 2014 and there is no Java Repl highlights this. Java is FINALLY adding Lambda functions (a lackluster implementation at that), but guess what? There already exist billions of lines of code written in "noun based" Java. Our shop has a client that refuses to upgrade from Java 5. There's no chance in hell th…

Not just lambda functions, but functions period.

Java through 1.7 does not even have functions, the closest thing you can get is to write a class and give it a static method (which of course is not a closure).

AFAIK in Java 1.8 you still cannot define or call functions outside of a class. So it's still "noun based."

Re: Java Pain

#55
This is why I wrote this open source package

https://github.com/paulhoule/centipede

you can create a new project with from a maven archetype that has log4j and Spring set up for you. A centipede application contains a bunch of little command line applications that are defined simply by writing classes that implement CommandLineApplication; Spring automatically finds all of these and makes them available.

Centipede also defines a per-user configuration mechanism that means you have no excuse to hardwire database passwords into your version control.

Re: Java Pain

#56
post #47

Earlier quoted context omitted.

I was about to say "omg yes" -- as someone who writes piles of java code, this is a constant pain. However, look at the other tools: I run python out of a virtualenv. I use rvm to run multiple rubys, and that shit breaks all the time for me. (Or rather, I use it infrequently enough that I never learn it well enough; I use it for the first time again every 2-3 months). That said, java is a special bit of shit. Those s…

Re: classpath. You mean like this[1]? [1] http://docs.oracle.com/javase/6/docs/technotes/tools/windows...

eh, you're quite right; it's the recursive I really need. oops. fta:

   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.

Re: Java Pain

#57
post #56

Earlier quoted context omitted.

Re: classpath. You mean like this[1]? [1] http://docs.oracle.com/javase/6/docs/technotes/tools/windows...

eh, you're quite right; it's the recursive I really need. oops. fta: 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.

Yeah I use uberjars sometimes too. Java deployment in general is awkward/subpar. Some of the newer tech like dropwizard has helped with this, but it's still far from ideal.

Re: Java Pain

#58
IMHO, the best way to distribute java programs is create a single jar and the append that jar to this shell script:

    #!/bin/sh
    exec java $JAVA_OPTS -jar "$0" "$@"

Re: Java Pain

#59
IMHO, the best way to distribute java programs is create a single jar and the append that jar to this shell script:

#!/bin/sh exec java $JAVA_OPTS -jar "$0" "$@"

Re: Java Pain

#60
post #20

´./gradlew run´ Good luck trying to compile a C project without autotools/make either.

You know there are tools other than `autotools` right? I use qmake and CMake all the time. it is mostly - "qmake && make" for me. Yes, you will have to learn CMake - but I don't think that is any different than learning ant/maven/gradle.
Post reply on HN