r/linuxquestions • • Jun 12 '20

Resolved Why does everyone hate Java applications?

I see it generally everywhere I go as a Linux user: almost everyone has some kind of problem with Java applications. I understand Java as a development platform has some rather infuriating holes regarding its deployment methods, and the most common issue I've seen are memory leaks and just how memory hungry the applications can be by themselves.

Is it a concept of purity? Or is is just because of some other reason that seems to escape me? I use some Java applications almost daily without problems. So why the grudge?

Opinions, rather than absolute answers, are expected.

Resolved -- Technically, there have been several wonderful and informative answers here on this post. Some answer the question better than others. However, not one singular answer is fitting enough to answer this question, so I thank everyone who took the time out of their day to enlighten me about Java and its rather unfortunate history. Thanks again!

128 Upvotes

137 comments sorted by

View all comments

16

u/henry_kr Jun 12 '20

From a Sysadmin point of view, I'm not keen on Java because:

  • Services are really slow to start up and stop.

  • They use a lot of resources, memory in particular.

  • They reinvent the wheel with logging, and don't use standard system provided logging.

Now this is all from my personal experience, and it could be that the particular programs that were running on systems I was responsible for were badly written, but I see the same problems with different Java programs time and time again.

5

u/Delta-9- Jun 12 '20

They reinvent the wheel with logging, and don't use standard system provided logging.

Holy fuck, this. I spent a week trying to get Tomcat to play nicely with Logrotate and finally gave up. For this reason alone, fuck Java and the NIC it rode in on.

1

u/gehzumteufel Jun 12 '20

Tomcat plays fine with logrotate. The key is to truncate the file instead of rotating the actual file. If you rotate the file, you just lose the logs because it attempts to still write to that deleted file.

1

u/vacri Jun 13 '20

It was a different java app, not Tomcat, but I had a problem with truncate-style logrotation in that the application would simply seek to the location in the file where the log 'should' be and write it there. This meant if I truncated a 10MB logfile, the next logline would be written after seeking 10MB into the file... filling it up with 10MB of zeroes...

1

u/gehzumteufel Jun 13 '20

Wow what a piece of shit app. That's really unfortunate.

1

u/henry_kr Jun 13 '20

I also forgot to mention that the logs themselves have never been very useful to me. When I've been called out at 3am (thankfully that was in an old job and I don't do that any more) I don't want to read pages and pages of stacktraces, I want to see what it's failing to connect to etc etc.

2

u/vacri Jun 13 '20

In addition to the logging, the config annoys me. Most other apps have "a config file" and maybe "a conf dir of snippets", all in one location. "big java apps" are a pain in the neck to troubleshoot regarding config - their launchers go through so many different scripts, picking up detritus each time, with config being added here, there, and everywhere. And then it all gets added as opts on the actual launch commandline anyway.

1

u/henry_kr Jun 13 '20

Yes, how could I forget about this! Don't forget setting important stuff in the environment too! You can't just take a working config file from one box and put it on another and expect it to work, even though that approach is pretty much an industry standard for *nix software.