lehphyro
Posts: 2
Joined: Fri Sep 02, 2011 1:58 pm

Re: Will the Raspberry Pi run Java?

Sun Sep 04, 2011 4:03 pm

This post is not about whether java is or isn't suitable for this hardware. There is an answer already, Raspberry Pi will run java, maybe not as fast as it could, but fast enough for most applications.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 25020
Joined: Sat Jul 30, 2011 7:41 pm

Re: Will the Raspberry Pi run Java?

Sun Sep 04, 2011 5:30 pm

Agree with the above three posts - although it may not have the performance of the official Oracle version, OpenSource Java implementations would be good enough for teaching it. Which is, after all, the purpose of the device.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

Svartalf
Posts: 596
Joined: Fri Jul 29, 2011 6:50 pm

Re: Will the Raspberry Pi run Java?

Mon Sep 05, 2011 2:14 pm

Quote from jamesh on September 3, 2011, 16:47
Given that the GPU code is entirely C (and assembler), I'd would profoundly disagree that C is a big fail. Oh, and the kernel is also all written in C. And many of those mobile phones that appear so popular nowadays!


Heh... You'd think they'd take the hint...but nooo... :D


Java may be good for games and certainly has its place, but not so good for work where you need to maintain decent performance. Any fool can write it? Surely.


Java has it's places and light-to-medium weight games, things like IDEs, dynamic content for websites...that sort of thing Java's okay as a tool for those tasks. I can tell you right now, though, that Java's unsuitable in a whole host of areas- things that need peak performance, things that need explicit deterministic behavior, and the like are NOT things to be choosing Java for. I'd sure not want my defibrillator running off of Java or Dalvik- it could be that the GC is to "die for" as it doesn't do it's required task because the system's too busy handling the GC operations.


Dealing with Oracle though? Yuuuugghhhh.


Heh... You got to my "ugh" threshold there with that. I'd think that having that detail alone would give most pause... ;)

princec
Posts: 31
Joined: Fri Sep 02, 2011 11:01 am
Contact: Website

Re: Will the Raspberry Pi run Java?

Mon Sep 05, 2011 2:39 pm

I wouldn't go adding FUD and a general display of ignorance about how Java works, how fast it is, or soft/hard realtime programming, in a thread from people interested in getting Java on the device...

Cas :)

Svartalf
Posts: 596
Joined: Fri Jul 29, 2011 6:50 pm

Re: Will the Raspberry Pi run Java?

Mon Sep 05, 2011 3:00 pm

Quote from princec on September 5, 2011, 15:39
I wouldn't go adding FUD and a general display of ignorance about how Java works, how fast it is, or soft/hard realtime programming, in a thread from people interested in getting Java on the device...

Cas :)

Heh... You misunderstand. Most of the people interested in getting it on the device operate under the thinking that it can solve all problems. Seriously. You even went so far as to prove that claim I just made, calling what I put up as FUD.

I want it on the device as much as you all- but I'm just unwilling to glorify the language like you appear to be.

It's not the best thing since sliced bread- and I should know, I've done about 10 years of enterprise level Java coding over the years. I've seen some pretty impressive things done with it. Even by my own hand.

However, It doesn't handle things like securities market transaction processing well. The GC stalls out time critical stuff at inopportune times. The medical device industry won't touch Java, .Net, or Android for anything that could be deemed life critical- quite simply, the FDA and similar organizations, won't cerify the stuff because it's NOT deterministic in the slightest.

Not FUD. Facts, unfortunately.

princec
Posts: 31
Joined: Fri Sep 02, 2011 11:01 am
Contact: Website

Re: Will the Raspberry Pi run Java?

Mon Sep 05, 2011 3:04 pm

What have securities and market transactions and life-critical applications got to do with RasPis? You use Realtime Java for that sort of stuff. So hardly relevant to the thread, and not relevant to the device.

Cas :)

Svartalf
Posts: 596
Joined: Fri Jul 29, 2011 6:50 pm

Re: Will the Raspberry Pi run Java?

Mon Sep 05, 2011 3:16 pm

Quote from princec on September 5, 2011, 16:04
What have securities and market transactions and life-critical applications got to do with RasPis? You use Realtime Java for that sort of stuff. So hardly relevant to the thread, and not relevant to the device.

Cas :)

Sigh...

It's still all observations about the language- and Realtime Java's NOT much better of an answer. Unless you're using native code and non GC managed memory allocations, you STILL have non-deterministic behavior.

As for education, the stated purpose for this device, you're talking about Computer Science education as the purpose for this device. Each and EVERY thing I have mentioned here are things you need to learn about Java from a CompSci point of view, so it's VERY relevant, sir.

You can't just magically wave a wand and have it all go away- or not need to understand all about it when you design with it. Worse, it's going to be readily apparent on this platform. You almost don't see it on most X86 machines because there's more than enough CPU muscle to make it not noticeable for a wide range of applications.

DanielSilva
Posts: 71
Joined: Sun Aug 28, 2011 7:07 pm

Re: Will the Raspberry Pi run Java?

Tue Sep 06, 2011 8:39 pm

I still don't understand why people tend to attach themselves so hard to a particular language.

princec
Posts: 31
Joined: Fri Sep 02, 2011 11:01 am
Contact: Website

Re: Will the Raspberry Pi run Java?

Tue Sep 06, 2011 10:01 pm

Skills and knowledge investment mostly. Besides, why change when it does nearly everything you need? Until some set of problems comes along Java doesn't solve nicely I'll be sticking with it.

Cas :)

DanielSilva
Posts: 71
Joined: Sun Aug 28, 2011 7:07 pm

Re: Will the Raspberry Pi run Java?

Wed Sep 07, 2011 4:41 pm

Because Java, or any other language for that matter, isn't some magical tool that solves all the problems you throw at it. Java is just one of the tools you should have on your toolbox but shouldn't be used to do all the work by itself.

Sure i could use an adjustable wrench to hammer a nail but that's not its job and a hammer would do a much better job on it.
I consider a much better investment learning a wide range of languages instead of relying in one alone but well, life choices i guess :)

Svartalf
Posts: 596
Joined: Fri Jul 29, 2011 6:50 pm

Re: Will the Raspberry Pi run Java?

Wed Sep 07, 2011 4:58 pm

Heh... 17 differing programming languages at this point. Each are usable in a wide overlapping range of tasks. Java, being one of them. Each has it's strengths and weaknesses.

The problem with siding with "just one language" is the "if all you've got is a hammer, everything looks like a nail" problem. I'd certainly not try to code something like Quake 3:Arena in Python, as an initial example of the thinking about one's tools. The attempts to do more than Quake1 in Java have been...heh...embarrassing...and the high-end games on the Android platform are NDK/SDK or pure NDK plays. The pure Java based X86 emulator's little more than a curiosity and has been laying fallow for years now- if you want X86 emulation it's QEMU or DOSBox that you'll be using. I'd be cautious what all I'd attempt with Java, based on those facts along with my own personal and professional experience with it.

Again, this is not saying that it shouldn't be attempted to be put on the R-Pi... I just don't see it magically bringing to the table what some might think it will here.

obarthelemy
Posts: 1407
Joined: Tue Aug 09, 2011 10:53 pm

Re: Will the Raspberry Pi run Java?

Wed Sep 07, 2011 5:14 pm

All of this is true, but the thing is Java is probably the language that offers the most jobs opportunities. Hopefully by the time people are starting to think in terms of jobs, they'll have moved up from the Pi, but you never know; and why not start with the most "marketable" skill, if we can manage to not turn kids off by that choice ?
I'm not saying Java is a particularly good language to write programs in, or to learn to program with, but that it is probably the most "rewarding" in the monetary/job sense. I think it would be good for the RPi to have an OK Java toolchain.

Svartalf
Posts: 596
Joined: Fri Jul 29, 2011 6:50 pm

Re: Will the Raspberry Pi run Java?

Wed Sep 07, 2011 5:27 pm

Quote from obarthelemy on September 7, 2011, 18:14
All of this is true, but the thing is Java is probably the language that offers the most jobs opportunities. Hopefully by the time people are starting to think in terms of jobs, they'll have moved up from the Pi, but you never know; and why not start with the most "marketable" skill, if we can manage to not turn kids off by that choice ?
I'm not saying Java is a particularly good language to write programs in, or to learn to program with, but that it is probably the most "rewarding" in the monetary/job sense. I think it would be good for the RPi to have an OK Java toolchain.

Uh, you're falling into the "marketable jobs" trap there. This is about teaching Computer Science- which can be mapped to marketable jobs, but isn't about that. If you're teaching "marketable skills", you're just doing vocational education there; which is only really worth about 2-4 years before it becomes OLD and not terribly useful. The schools focus on what's "marketable" which is whatever new fad management comes up with that lasts a handful of years and you end up with a glut of people that can't manage more than the "marketable" stuff.

Worse, OO is NOT the best way to teach basic computer science concepts. C/C++ probably isn't either- which would be the other "marketable" skill set. Python's probably a good choice to start with (Mainly because you can start out without OO and then move right into it easily...and it's good for doing concept building exercises at the least.). FreeBASIC might be another. Pascal was designed as a teaching language and FreePascal's a good choice in that regard.

DanielSilva
Posts: 71
Joined: Sun Aug 28, 2011 7:07 pm

Re: Will the Raspberry Pi run Java?

Wed Sep 07, 2011 5:38 pm

Quote from obarthelemy on September 7, 2011, 18:14
All of this is true, but the thing is Java is probably the language that offers the most jobs opportunities. Hopefully by the time people are starting to think in terms of jobs, they'll have moved up from the Pi, but you never know; and why not start with the most "marketable" skill, if we can manage to not turn kids off by that choice ?
I'm not saying Java is a particularly good language to write programs in, or to learn to program with, but that it is probably the most "rewarding" in the monetary/job sense. I think it would be good for the RPi to have an OK Java toolchain.

I somewhat agree with you but the bulk of java related jobs ( at least the high paying ones ) are J2EE ones, RPi might be a good tool to learn the basics of Java but as soon as you enter J2EE territory you'll find the RPi severely lacking in resources.

It just confuses me someone sticking ONLY to one language like Java ( just an example ) when you can easily effectively "learn" another similar language like C#, Vala etc in so short time considering they share so many traits and characteristics ... These days my favourite language when i need to write something in Linux is Vala, which i learned in about a week because it shared so many things with C# ( which i used to write small Windows apps ) and was a matter of looking at the documentation and see what were the differences. And i learned C# the same way by comparing it with Java which i used for years while building j2ee applications*.

* - Actually it was a mix of Coldfusion and Java but that's beside the point.

princec
Posts: 31
Joined: Fri Sep 02, 2011 11:01 am
Contact: Website

Re: Will the Raspberry Pi run Java?

Wed Sep 07, 2011 6:10 pm

@Svartalf - Quake3 was ported to Java years ago. J2SE is eminently capable of doing more or less anything you throw at it, in a desktop context. The world I think may have moved on last time you looked at Java (guessing maybe 10 years ago now?)

@others - this was a thread asking about Java on the device, not everyones personal reasons for "not using Java" based on various fallacies or rumours! Maybe start another thread about why Java's crappy.

Cas :)

Svartalf
Posts: 596
Joined: Fri Jul 29, 2011 6:50 pm

Re: Will the Raspberry Pi run Java?

Wed Sep 07, 2011 11:23 pm

Quote from princec on September 7, 2011, 19:10
@Svartalf - Quake3 was ported to Java years ago. J2SE is eminently capable of doing more or less anything you throw at it, in a desktop context. The world I think may have moved on last time you looked at Java (guessing maybe 10 years ago now?)


Try running it on an Atom board. Much like the PC emulator, it has performance issues.

As for looking at Java...didn't you read what I stated? I CODE in it. Professionally. NOW. Have to in order to do Android stuff and enterprise level app server stuff. Thing is...I know it's limitations, even in a "desktop context".

princec
Posts: 31
Joined: Fri Sep 02, 2011 11:01 am
Contact: Website

Re: Will the Raspberry Pi run Java?

Thu Sep 08, 2011 11:22 am

Android is not Java and fairly rightly deserves the colossal lawsuit against it from Oracle. And I still feel from your descriptions that it is you that is limited, rather than the tool. We don't seem to suffer any limitations.

mdafbmm
Posts: 3
Joined: Fri Jul 29, 2011 3:20 pm
Contact: Website

Re: Will the Raspberry Pi run Java?

Thu Sep 08, 2011 12:04 pm

@princec While Android != Java so to speak it's a good starting point for some in terms of using Java to write in. Not sure the lawsuit is deserved and sets a dangerous precedent for open platforms. But that seems a little off topic. I would agree however that a decent developer can usually transcend any perceived limitation.

I hope the RPi can run Java and (possibly being really naive) don't see any reason why it can't. I have used open Java in my Android phone using a chrooted Ubuntu distro. I have also read of other devices having similar success.

I really want to run subsonic on my RPi but worst case scenario is I'll just find/write some other way to stream my music.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 25020
Joined: Sat Jul 30, 2011 7:41 pm

Re: Will the Raspberry Pi run Java?

Thu Sep 08, 2011 12:06 pm

Quote from princec on September 8, 2011, 12:22
Android is not Java and fairly rightly deserves the colossal lawsuit against it from Oracle. And I still feel from your descriptions that it is you that is limited, rather than the tool. We don't seem to suffer any limitations.

Disagree completely with the lawsuit. Ridiculous patent.

And please, no more personal insults.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

princec
Posts: 31
Joined: Fri Sep 02, 2011 11:01 am
Contact: Website

Re: Will the Raspberry Pi run Java?

Thu Sep 08, 2011 12:23 pm

Svartalf appears to be inviting them; it would help if he did not place a veiled insult about our work by describing his own inability to get it to do what he wants.

If anybody else in this thread would like more real information about Java please head on over to java-gaming.org and/or lwjgl.org, where most of the world's experts on high-performance clientside Java can be found.

Cas :)

DanielSilva
Posts: 71
Joined: Sun Aug 28, 2011 7:07 pm

Re: Will the Raspberry Pi run Java?

Thu Sep 08, 2011 8:17 pm

Quote from princec on September 8, 2011, 12:22
Android is not Java and fairly rightly deserves the colossal lawsuit against it from Oracle. And I still feel from your descriptions that it is you that is limited, rather than the tool. We don't seem to suffer any limitations.

Unless Google uses/used code directly taken form the Sun/Oracle sources they have absolutely no basis for their "lawsuit". And Java IS limited on the desktop side, as long as you have a fast processor and plenty of memory Java programs will run OK but as soon as you start using it on low power systems, like Atom processors ( pretty much most netbooks and stuff ), it starts to trail like a snail.

Eclipse is still my favourite IDE and i use it extensively on my workstation but trying to run it on my EeePC is as painless as going to the dentist and doing a root canal ... You could say that it's the software that is crippled but trying Netbeans gives you the same painful experience.

Java has limitations, mostly speed, on medium to large desktop applications and there's no denying it ... the J2EE platform still is my platform of choice if i have to do some web side stuff but on the desktop it's another story altogether.

You can ramble on and disagree but that doesn't change anything :)

The bottom line is, Java will most likely run on the Raspi just not that speedy, which is just fine considering the board is for education and being the "King of Speed" isn't what matters.

sgf
Posts: 4
Joined: Sun Aug 07, 2011 7:00 pm
Contact: Website

Re: Will the Raspberry Pi run Java?

Fri Sep 16, 2011 6:28 am

@svartalf: "However, It doesn't handle things like securities market transaction processing well." I've seen a surprisingly large number of automated trading systems written in Java. Some of them would probably qualify as "high-frequency". I don't know what tricks they're pulling to get performance right.

@princec: "And please, no more personal insults." "Svartalf appears to be inviting them; it would help if he did not place a veiled insult about our work by describing his own inability to get it to do what he wants." - If you see a complaint against a programming language as a personal insult that deserves retaliation in kind... you should probably take a step back. If only because your posting style is starting to undermine whatever logical points you raise.

"Works for me. If it doesn't work for you, despite me not knowing what you're actually trying to do, you're doing it wrong." is not a great argument. It's difficult to defend against "Language X is crap - it doesn't work for me." with anything other than finding out exactly what they're trying to do, and what problems they were having with Language X.

(The fact that Quake 3 can be implemented in Java is not massively surprising. It's a 10-year-old game that was mostly bottlenecked on the graphics card at the time anyway. I guess this is why it makes a good demo for RasPi!)

Tying back this whole thing to RasPi, I think the fact that it's apparently rather difficult to get a high-performance implementation of the language for an arbitrary platform is a bit of a mark against it, but as it is, for educational and random embedded hobbyist use, that's not so important.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6183
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Will the Raspberry Pi run Java?

Fri Sep 16, 2011 7:26 am

"Svartalf appears to be inviting them; it would help if he did not place a veiled insult about our work by describing his own inability to get it to do what he wants."
Not speaking as a moderator, just as a forum member... nobody is inviting insults and if they were, that's no excuse to engage them. If I make a subjective statement like "C sucks", that's not meant to be a personal insult to Dennis Ritchie.

And this is not aimed at anyone in particular, just a general reminder - everyone is entitled to express their views, as long as it's done in a respectful way. It's great that people can debate here, but it doesn't take much for things to get out of hand :( .

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 25020
Joined: Sat Jul 30, 2011 7:41 pm

Re: Will the Raspberry Pi run Java?

Fri Sep 16, 2011 7:57 am

And just for completeness, I installed and ran three languages on the Raspi last night, OCaml, Scala, and Clojure. Scala and Clojure both require Java, and both worked (Using OpenJDK). Both were a bit slow though, OCaml seemed pretty quick, but i don't know these languages so wasn't able to test to any great extent.

So in short, OpenJDK worked on the Raspi. Any complaints about OpenJDK should be directed at the developers of OpenJDK, not Raspi!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

princec
Posts: 31
Joined: Fri Sep 02, 2011 11:01 am
Contact: Website

Re: Will the Raspberry Pi run Java?

Fri Sep 16, 2011 10:41 am

No complaints at all for RasPi - I just wanted to share the results of my investigations about Java on ARM based devices. Basically: slow, only useful as a toy at this stage.

And dudes - svartalf implies that we (Puppygames) can't write fast, efficient code in Java, because he can't write fast, efficient code in Java; and by inference, that nobody else can write fast, efficient code in Java, and that therefore Java itself is inherently slow anywhere you might find it. This we take issue with. Not only is this blatant trolling in a thread entirely unrelated to the OP's query, we find it to be professionally insulting. Take it up with me by email if you wish as this thread is seriously off topic.

Cas :)

Return to “General discussion”