Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for June 20, 2013
Pencil, Pencil, and Pencil
Dividing the Linux desktop
LWN.net Weekly Edition for June 13, 2013
A report from pgCon 2013
Generations Won For Java
Posted Aug 21, 2012 10:21 UTC (Tue) by pboddie (subscriber, #50784)
Posted Aug 21, 2012 10:21 UTC (Tue) by bojan (subscriber, #14302)
It runs everywhere!
Posted Aug 21, 2012 12:35 UTC (Tue) by man_ls (subscriber, #15091)
Life is good again! Such is progress!
Posted Aug 21, 2012 14:12 UTC (Tue) by fb (subscriber, #53265)
Compared to the possible amount of deployment/running errors you can get running C/C++, I'd say that Java (and all the associated tooling around it) actually brought a great deal of sanity to the table.
Posted Aug 21, 2012 15:01 UTC (Tue) by man_ls (subscriber, #15091)
As to runtime errors, you are right about C/C++, but there is a reason why people put up with them. And Java is not without issues. I don't know if you have ever been in jar hell: looking for an error which manifests only on the web server, caused (supposedly) by a specific version of one the libraries installed, but you have no way to find out whether it was embedded in the JRE, loaded from the classpath, from the library path, or embedded in the .war file. (Normally you assume it is using the .jar in the .war, and only after a lot of head-scratching you work up from there.)
For development you need not only a way to manage all of the above, but also an alien build system (Ant, alien even to the JDK) and a way to manage dependencies (Maven), and then you have a lot of random packages not integrated with anything else -- not even with those already in the system. No wonder the only way to do sane development with Java is from within Eclipse, which provides a lot of the missing pieces -- but good luck trying to package and run that code elsewhere.
Makes autotools look like something easy. At least you run a standard set of commands: ./configure && make && make install and you are done, sometimes -- or you google the error.
./configure && make && make install
Posted Aug 21, 2012 15:19 UTC (Tue) by Cyberax (✭ supporter ✭, #52523)
>make the whole thing run in a sensible way for end users without having to type an arcane command. A configuration nightmare.
That's partially true. Java launchers are system-dependent, though WebStart helps somewhat.
But it's the same problem with Python, you have to package a Python app separately for Linux, Windows and Mac OS X.
Three answers in one
Posted Aug 21, 2012 16:23 UTC (Tue) by man_ls (subscriber, #15091)
But it's the same problem with Python
Posted Aug 21, 2012 22:52 UTC (Tue) by Cyberax (✭ supporter ✭, #52523)
Now try that with Python. On Windows.
Go on, do it. You'll have to install Python first, or you won't be able to run anything. After you've installed it you might notice that clicking on a script results in an ugly console window (even though you might have a GUI app), so you need some sort of runner.
Posted Aug 21, 2012 23:16 UTC (Tue) by man_ls (subscriber, #15091)
pip install package
I don't know much about WebStart, but I have not seen it used for anything remotely serious. For packaging, distributing, installing and using software on a regular basis, and for basic configuration management, Python is great; I don't know the steps needed to package something using WebStart though.
Posted Aug 22, 2012 2:42 UTC (Wed) by Cyberax (✭ supporter ✭, #52523)
>Once installed I can beat your single link with a single command: pip install package. I can dictate it to aunt Tilly over the phone.
- Pip? Is it a character from the Great Expectations? Do you want me to reread this awful novel? How dare you!
Once you say "command line" you are WAY outside the realm of acceptable for end-user apps. WAAAAAAY too far.
> I don't know much about WebStart, but I have not seen it used for anything remotely serious. For packaging, distributing, installing and using software on a regular basis, and for basic configuration management, Python is great; I don't know the steps needed to package something using WebStart though.
Java has a package management system, it's called Maven. It's somewhat similar to pip/setuptools except that it works at _build_ _time_. And as a result you can generate Java WebStart packages, self-installing executables, etc.
The greatest problem with Java really is its 'heavy' JVM. Sun missed the opportunity to make it lightweight, alas.
Apache's role in all of this
Posted Aug 22, 2012 10:13 UTC (Wed) by man_ls (subscriber, #15091)
Maven is not in Java, it is an outside package. Which brings us to another one of Java's treats: the big ecosystem of Apache software. But wait, why is such a big corpus of code necessary at all? To provide for Java deficiencies, which means the 50MB+ JRE monstrosity is not even enough to have a decent set of collections. Each useful third-party package you find out there is likely to depend on a few Apache libraries, meaning that you will be soon managing tens of .jar files. To bring this into perspective, there are 39 Apache Commons projects, which are supposed to provide foundation libraries. Which is why Maven is needed. Whew!
Posted Aug 22, 2012 15:38 UTC (Wed) by Cyberax (✭ supporter ✭, #52523)
Actually, it is possible to install Java using browsers' automatic plugin detection.
>To provide for Java deficiencies, which means the 50MB+ JRE monstrosity is not even enough to have a decent set of collections.
Please, stop repeating nonsense. Commons-collections is a dead project, it hadn't been necessary for a loooooooong time. Sun JVM in fact has one of the best collection libraries, including parallel and non-blocking collections which you'd be hard-pressed to find in other languages.
You also might actually browse the list of apache-commons libraries. About a half of them are either thin wrappers over several other libraries and/or long-dead projects.
Posted Aug 22, 2012 16:12 UTC (Wed) by man_ls (subscriber, #15091)
Posted Aug 21, 2012 15:44 UTC (Tue) by pboddie (subscriber, #50784)
And the best retort to "install a JRE" is, of course, "which one?" I have to run stuff which only works with Sun's Java - it can't be anything like IcedTea that most probably implements the breadth of the required functionality - and so the practice of industry hacks targeting a single, narrow, effectively proprietary platform continues, but everyone can claim that they're using open standards.
Oh, and those industry hacks will all be working in a cathedral-style project up to their necks in dodgy code and with "security through obscurity" being one of the project value statements.
But I agree with you that high-level languages with managed environments can and should provide significant simplification over systems programming languages like C and C++. The emergence of stuff like Maven indicates that there's plenty of complexity remaining, however.
Posted Aug 21, 2012 16:16 UTC (Tue) by Cyberax (✭ supporter ✭, #52523)
Posted Aug 21, 2012 16:39 UTC (Tue) by man_ls (subscriber, #15091)
Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
Besides, Oracle only distributes JVMs for a very limited set of 8 operating system and processor architecture combinations: Linux x86, Linux x64, Mac OS X, Solaris x86, Solaris SPARC, Solaris x64, Windows x86, Windows x64. Considering that ARM systems probably outnumber all these combined, it is a great limitation.
In all this discussion I haven't even brought out the most annoying point of Java development: its "native" graphical toolkits AWT and Swing, which are not integrated with any environments and look alien everywhere. Luckily there is SWT, but it does not precisely simplify the configuration management problem.
Posted Aug 22, 2012 9:21 UTC (Wed) by cortana (subscriber, #24596)
Posted Aug 22, 2012 14:54 UTC (Wed) by pboddie (subscriber, #50784)
Meanwhile, with Java runtime environments, if you don't want to run the Sun JRE or just can't, even if OpenJDK should do the job because of its common heritage and proximity to the Sun JRE, that's no guarantee it will work. As I noted, people in certain industries are great at touting the supposed openness of a technology while deploying something that only works with one vendor's specific product.
It also doesn't inspire confidence that Oracle as a vendor, ignoring the reputation currently enjoyed by the company after its recent behaviour, still lives on pre-Internet time with respect to security updates. That said, I do wonder how much attention any of the JREs get in comparison to widely-used open source projects.
Posted Aug 22, 2012 15:07 UTC (Wed) by cortana (subscriber, #24596)
Posted Aug 22, 2012 1:07 UTC (Wed) by pflugstad (subscriber, #224)
I've had a lot better luck with those than I have with the various IcedTea incantations on ARM/Linux.
Posted Aug 22, 2012 8:48 UTC (Wed) by nim-nim (subscriber, #34454)
SUN used its 'rewrite everything in Java' mantra to create an ecosystem with no legacy code to manage, and apps so balkanized they could never grow to a full system, and then exploited this situation to avoid thinking about deployment.
In fact, it promoted bad engineering for years to postpone as much as possible tackling the deployment problem, and the attitude got so pervasive it infected SUN Java competitors (don't reuse code, copy it, don't propagate fixes, fork libs, everyone should hardcode classpath dependency chains, use maven to download specific binary artifacts to avoid thinking about code lifecycle, use osgi to pile up jar files without having to sort them, only successful commercial environment: application servers with dedicated sysadmins to sort the mess and the app server trying to salvage deployment because core Java is unable to do it).
As a result more than a decade later, when enough Java code accumulated SUN/Oracle finally has to tackle deployment, they've hit a hard wall of technical debt, and the modularization of Java gets postponed from release to release (it will be in Java 7, oops, let's split java 7 in 7 and 8 with the modularization in 8, oops, 8 will ship without it wait for 9 instead, etc).
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds