Java (OpenJDK)

So I’ve been following the progress of Haiku for about a year and a half now. I’ve been intending to develop a lot of user-friendly software for Haiku (probably mostly in Python). I wrote a basic repository for my own needs while I was using Haiku so I could re-install Haiku constantly (Almost every night). The only thing that kept me (and is still keeping me) from using Haiku is the lack of Java support.

For me to properly develop for Haiku I would like to immerse myself in the environment by using it as my primary OS. The latest bit of information about the OpenJDK port is here. Has there been any progress since then? It’s literally the only thing keeping me from Haiku. I’m fine porting small things like the wireless drivers I require, graphics drivers, etc (Well I’m getting a new laptop with an ATI card and that might be a bitch…).

I’m just wondering: Is anyone working on the OpenJDK port anymore? If so, fantastic! If not, I could probably find a bit of time to port some code and help out, I just don’t understand why the OpenJDK port isn’t more active. It’ll help increase the userbase and pull in more developers.

Haiku is the only OS birthd from the death of BeOS I see left standing, I would love to see it pick up a little more. I think this could easilly be my all-time favourite OS, please offer me some insight, I find the information for Haiku to be painfully disorganized (I think I’ll organize it myself … It’s honestly only the lack of Java holding me back from Haiku)

Cheers,
ti.teg.tnod.I

P.S. Another thing I’ve been wondering: Is Haiku planning on dropping the BeOS backwards compatability? If so, when?

1 Like

Update on Java port requires contacting one of the developers working on it. I think it stopped or stalled but can’t say for sure. You need to email the programmer directly.

I think they added a newer ATI driver to Haiku for Radeon HD cards which may work for you.

Not many people use Java. I don’t. Neither do the people I know. I imagine very few people use Java and only for a couple of programs. I believe it would bring very few end users to Haiku and don’t believe worth the time or effort. Qt & SDL give Haiku lots of apps & games to play with.

For development to pick up in Haiku would require getting to R1 or late Beta sooner. That’s when it’ll catch the interest of more people and will be seen as more serious.

BeOS compatibility will be dropped in R3 (or even R2). Depends on the application situation. I think Haiku will have enough apps available that they could drop the compatibility in R2. Some want to drop it now but not likely to happen.

Thanks for the info! You see I’m usually hooked on a Java game (Such as Runescape or Minecraft), and it’s usualy what I do to unwind. In fact, the only reason anyone I know can provide for not using Haiku is the lack of Java support.

Maybe I’ll install Haiku on a box and play with it some more.

[quote=ti.teg.tnod.I]Thanks for the info! You see I’m usually hooked on a Java game (Such as Runescape or Minecraft), and it’s usualy what I do to unwind. In fact, the only reason anyone I know can provide for not using Haiku is the lack of Java support.

Maybe I’ll install Haiku on a box and play with it some more.[/quote]

Maybe port the game to another language.

BeOS compatibility won't be dropped that soon. With R2 the aim is to introduce new APIs for GCC4 only, and leave the GCC2 API in place for compatibility. This will allow us to rethink/redesign a lot of things, and correct API failures without sacrificing compatibility.

The GCC2 API will probably be maintained a while, and eventually be moved out to an optional package before it will no longer be supported. But that's far in the future anyway, AFAIR we're still busy getting R1 out of the door :-)

You can always switch to a browser based game that uses HTML + Javascript. I’ve played Ikariam from Gameforge on Haiku. Ikariam is little slow and best played when they first introduce new world. Gameforge has other games which may work with web browser but I haven’t tested any of them. I think their other games will work too since Ikariam does but cannot say for sure.

http://us.gameforge.com/browser-games

Haiku is more for developers right now. For end users, Haiku is a 2nd or 3rd OS until it gets to late Beta or R1. Good for playing around with.

I am also interested in Haiku and maybe one day using it with (mostly server-side) java and tools like Eclipse. Will also keep an eye out!

My personal opinion is that languages like Java,.net etc. they all just need to die and the sooner the better. Just like Flash must die.

You may be taking about something specific, but java is a very popular choice for business server-side software engineering so I doubt it is going anywhere soon.

Seriously thatguy, when someone asks about and is interested in OpenJDK it’s not nice at all to spew out this kind of opinion. Encouragement and support would be much more welcome. Please try to respect and value others point of view.

Btw, I’d work on the java port if I had time and my todo-list wasn’t very long already.

I don’t understand this hate for JAVA: I think is a very beautiful language (a lot better of C/C++ for its a lack of pionters, garbage collection, biggest API): the write once run everywhere thing is HUGE!

I think it should merited more success it had.

The confront with Flash is absurd JAVA is real programming language and it is open source, too…

So, I think Haiku should have this language, too…

[quote=tqh]Seriously thatguy, when someone asks about and is interested in OpenJDK it’s not nice at all to spew out this kind of opinion. Encouragement and support would be much more welcome. Please try to respect and value others point of view.

Btw, I’d work on the java port if I had time and my todo-list wasn’t very long already.[/quote]

Whats wrong with c/c++ ? the java interpretters are written in c/c++. My biggest beef is the performance overhead of these languages. Java while better then .net still comes with a heavy performance penalty for anything that requires heavy lifting. Its works great for net applications however.

I remeber Java applets, they where horriable, I have used java applications, also horriable performance. Much like I have watched my machine overhead jump dramatically with alot of commercial apps that have moved to .net. Which is insane in reality. I know microcsofts motiviation is to drive the hardware market so they keep adding heavy features to push the upgrade cycle, anyone who denys this is crazy. Java just never really took off but for similar reasons. Its been great on the web though with its run anywhere type capability and html5 embraces javascript with the canvas functions.

Java was a technology looking for a application. At this point mono and .net are taking its place.The only people using it are server operators becuase it offers a short development cycle. Performance isn’t much of a concern with the compute power these clusters have.

Are there any apps that even run java as a language anymore in a desktop enviroment ? I know theres a bunch of server side stuff.

whats the benefit to haiku as a desktop system to have jdk ? Is the juice worth the squeeze ?

It just shows how little you know of Java and it’s on the border of trolling when you state your personal opinion ‘it should die’, which has nothing to do with the subject. It just shows you rather express what ‘you think’ instead of helping the poster talking about Java.

It’s also very stupid when many of the core Haiku developers work in Java or .Net in their daytime jobs so that they can spend their spare time working on Haiku.

Could we get back to talking about helping the original poster instead! All of the Haiku devs try to reach out and help newcomers, why not support Haiku and do the same!

My last post on this off-topic nonsense.

The problem with C/C++ is they are not “safe” languages: that is for their low level nature you can referring pointer to not reachable memory (and it horribly crashes), bound of array is not checked (and it crash again or worst: undefined behavior), the lack of a real string type (at least in C, I’m not sure the string type is part of the official C++ standard), the GNU C API is error prone (in a lot of functions if you pass a NULL pointer it crash but man says it must set simply errno to EINVAL!)in all this case JAVA returns and exception (C++ maybe but can disabled… BeOS/Haiku seems not to use it, for example) stating clearly what error is… C/C++ crash and leave you alone with GDB :–)))

The other big problem is memory leaks using malloc() o new y ou can fogot to use the free() or delete before exiting from the function… Java use the garbage collector: no memory is lost.

I don’t remember JAVA Applets to be too slow… maybe they take more time to start (remember JAVA is in reality a “virtual” computer and must “boot” to start your application) but when started no differences at least if your JVM use jit compilation and not interpretation…

The real problem of JAVA was the anti-concurrency policy of Microsoft that literally hired all Java developers… .NET in in reality a simple clone, but extended (remember the MS motto? "Embrace, extend, extinguish) of Java… as anyone can notate from that time JAVA not evolved much… as .NET done!
The ridiculous thing is that .NET use a virtual machine for not apparent reason as it can works only on Windows (and Windows works only on X86!)… Mono it is not at the level of JAVA on Linux it can’t simply run a Windows GUI .NET application… give errors and not else!

Java is used in mobile phones (Android is a Linux kernel, in top of it runs a JVM, all Application targeting Android are written in Java not C/C++), Interactive TV uses a Java dialect too (MHP), if you want to write a trigger in Oracle database you can use Java instead of the ugly PL/SQL…

As JAVA is in reality a computer there a bunch of language that run on it, JPithon, JRuby… C too (yes you can use pointers and crash the whole JVM in Java if you wish):

[quote=thatguy]
Are there any apps that even run java as a language anymore in a desktop enviroment ? I know theres a bunch of server side stuff.

whats the benefit to haiku as a desktop system to have jdk ? Is the juice worth the squeeze ?[/quote]

OpenOffice needs Java to be ported… simply for this Java is needed…
I think that more chooses of languages to use can encourage more developers to join haiku…

Not to mention that if Haiku devs could do their day time job in Haiku, Haiku would benefit a lot.

And Java applets are mostly slow because all UI interactions are done in a single thread, which leads to latencies, as events gets queued.

But what I am trying to say is that Haiku community should stay away of becoming an elitist community, instead keep on being an open, helpful and supportive one. Some of the comments in this and other threads really makes me fear that we are heading the wrong way if it continues like this.

1 Like

thatguy you are right but come off too strong saying “it should die.” Some people get use out of Java but I think Java is unimportant to majority of end users.

  1. Haiku’s goal is for home user. How many of them use Java applications in Windows or Linux?
  2. Java is slow (compared to C & even C++). Lacks performance. Its claim to fame is being portable but you still need the JVM.
    http://www.cherrystonesoftware.com/doc/AlgorithmicPerformance.pdf
    With Java, one identical statement can turn into 7 instructions versus 3 for C++. One reason why you lose speed.
    http://en.wikipedia.org/wiki/Comparison_of_Java_and_C%2B%2B#Performance
  3. People today use Java for online gaming mostly. Online games are either Java, Flash, Ajax or Windows client.
  4. What are popular Java applications that end users will use? Please list them for us. I can only think of online games like the poster mentioned. ie, I used a Java bittorrent client in 1999 and it ran horrible (hogged CPU + RAM). I then switched to a C++ one and the difference was night & day. From that time on I avoided Java like the plague and only used it a couple times when I had no other choice.
  5. OpenOffice still mostly works without Java.
    http://wiki.services.openoffice.org/wiki/Java_and_OpenOffice.org
  6. Java should really only be used for applications were it makes sense (like online games). Otherwise better to use C or C++.
  7. There’s a reason why most OSes are developed in C or C++ language. ie, performance

Java is a brand name used for several distinct things. In order to have a coherent opinion it’s important to know which of those things you’re writing about.

The Java language is a standardised C-family member with lots of nice syntactic sugar for writing object-oriented code. You can write software in this language and compile to native code, or as pcode for a virtual machine. The most obvious choice of VM is the Java VM, but Dalvik is also a very likely choice.

The Java Virtual Machine is a stack based virtual machine which executes a standardised byte code. A conformant implementation includes a verifier which ensures that only legal (and thus “safe”) byte code is executed. So the example of “crashing the whole VM” can’t (shouldn’t) happen. Verification ensures that all branches are valid, all references are type safe, visibility rules are obeyed etc.

The Java standard class libraries are roughly analogous to the C standard libraries. They aren’t part of the language itself, but programmers of the language will usually rely upon having them (and in addition perhaps other application-specific libraries). Their interface is strictly standardised, but the implementation is usually (for some pieces) native code.

[There are several further things with the Java brand name which are less important or less relevant.]

So for example, in the Android system the Java language is used, and some elements of the Java standard libraries (together with Android-specific libraries of course), but the virtual machine is not used. Instead Android’s Dalvik virtual machine is used instead.

I am wondering if there has been any talk of GCJ being ported to haiku? Since GCC4 work is already underway why not just port the GCJ frontend? it has support for about 90% of the the java api.

Also as far as all the java hate is concerned, Most of what you hate about java probably has nothing to do with the language itself, but the commercial implementations of it. Java isn’t just applets and its unfair to compare it to flash. With java you can create lightweight daemons and command line utilities the same way you can in any other language.

[quote=xitiomet]I am wondering if there has been any talk of GCJ being ported to haiku? Since GCC4 work is already underway why not just port the GCJ frontend? it has support for about 90% of the the java api.
[/quote]

90%? Are you sure? I don’t think it supports Java GUI application…

[quote=xitiomet]
Also as far as all the java hate is concerned, Most of what you hate about java probably has nothing to do with the language itself, but the commercial implementations of it. Java isn’t just applets and its unfair to compare it to flash. With java you can create lightweight daemons and command line utilities the same way you can in any other language.[/quote]

Yes you can write a REAL OS application, too… that resembles native application of the OS in which is running (that is: in Win XP it is a “LUNA” application, in Mac OSX is “AQUA” and in Haiku is… whatever funky name we want to give it…)

I’d like to mention the availability of JamVM and GNU Classpath as a basic fallback for OpenJDK. It can run Jetty on Haiku for instance (but not Tomcat or GUI applications).