Tuesday, 07 October 2014 16:28

Development: Java RE 7. Fixing starts!

Written by 

Fixing the Java RE!

As you may know, JRE 7 has been the Most voted app by the Community in our latest IGG campaign. You've decided, through your votes, that JRE should be running on top of ReactOS, and now it's our time to begin developing the needed compatibility to make it work. If you want to discover how we're fixing it, just keep reading...

First of all: What's JRE 7?

JRE is just the acronym of the Java Runtime Environment. This sounds too geeky, however it is just the proper name of what sometimes is called "Java". If a desktop piece of software needs Java, then probably it needs, at least, the JRE installed in your operating system to work.

One of the main benefits of Java, at least for software developers, is its portability. This means that a piece of software written in Java can be run in different operating systems avoiding the developers to create a specific app for each OS.

Some Java apps...

However JRE is not just a library, but it relates to a concept called Java Virtual Machine. If you hear the Virtual Machine words, the first image that should cross immediately your mind, since now, is a "machine crawling in the floor". And well, let's admit that, software built with Java are not among the fastest in the world.

In other words, since Java have overhead and implements its own Environment, Java is probably going to drive us nuts regarding memory management. If our Memory Manager doesn't work and performs as the Window's one, it'll be pretty hard to make ReactOS compatible with JRE.


JRE 7: The Setup bug

Testing JRE 7 is a two-step process: First downloading the JRE 7 from Oracle's archives, and afterwards executing the JRE 7 installer. However the result was a really nice and blue-ish BSOD. Even more, attempting to run the JRE 7 installer seemed to end in a gorgeous registry corruption which was preventing further runs of ReactOS. A complete disaster!

Nope, this is not the BSOD. Just the Oracle Java archive.

During the testing process we discovered that a previous JRE version, JRE 6 setup, wasn't blowing up the ReactOS registry showing itself as a nice start pointing to discover potential bugs which could bite us after the corruption issue was fixed.


JRE 6: The Polling bug.

"To Poll or not to Poll? That's the question"

The first test after successfully installing JRE 6u41 was something as easy as writing "java" and hitting Enter

The good news was that the "Java" command was "understood" by the console (aka, the environment variables were correctly set). The bad news, well, erhh..a mysterious error was printed to the console as you can see in the following screenshot.

Polling..what??!

  • What does this error mean?
  • How we worked together as a team to find the issue!
  • How did we fix this important issue?

This, and much more, in the next "Development: Java RE" article.

    Several technicalities have been oversimplified to ease the comprehension of this article so it shouldn't be read as a paper. However if, in our try of easing the reading, you think any paragraph is misleading or you detect any technical typo, please use the comment section below to notify us. Thanks a lot!

Víctor Martínez

Víctor Martínez is the current ReactOS PR Team coordinator focused in partnerships and win-win strategies. After funding his own strategy company, he has been working as an operations and strategy advisor for several companies based in Russia, USA, and Europe. When he is not transforming Weakness into Revenue Streams, he is messing and breaking ReactOS Code.

15 comments

  • Comment Link Not-So-Technical Typos: Friday, 10 October 2014 19:15 posted by Not-So-Technical Typos:

    I like the bit at the end about making a comment if you "detect any technical typo", but these are just normal non-techy typos:
    Missing spaces: "needs,at" "Poll?That's" and "console(aka,".
    Misspelled words: "beneficts" → "benefits" and "inmediatly" → "immediately".

    Report
  • Comment Link FYI Friday, 10 October 2014 19:33 posted by FYI

    You might be interested to know that you can use the JRE without running Oracle's installer.
    PortableApps.com releases it as "jPortable" with each version coming out shortly after Oracle releases their own local version, there are no changes to the binaries (the jPortable Installer downloads the standard installer and extracts the necessary files to the appropriate location) and the "jPortable Launcher" can be used to easily launch Java "jar" files with it.
    Perhaps this can help you if you want to get started testing Java 7 before you finish getting Oracle's Java 7 Installer to work.

    Links
    jPortable: http://portableapps.com/apps/utilities/java_portable
    jPortable Launcher: http://portableapps.com/apps/utilities/java_portable_launcher

    Report
  • Comment Link unlimited edition Friday, 10 October 2014 19:51 posted by unlimited edition

    Yea, an article about running an app that fails..., please be more technical ;)

    Report
  • Comment Link castarco Tuesday, 14 October 2014 08:04 posted by castarco

    I think too that it would be interesting to read more technical articles :) .

    Report
  • Comment Link Mohammad Hadi Hosseinpour Wednesday, 15 October 2014 17:09 posted by Mohammad Hadi Hosseinpour

    I think we can use an open-source VM for Java, instead of using closed-source ones. ;)
    For example we can use Kaffe, joeq or Intel ORP.

    Report
  • Comment Link Víctor Martínez Thursday, 16 October 2014 23:56 posted by Víctor Martínez

    @Not-so-technical-typos: Thanks! They should be fixed now :)
    @FYI: Yup, there are even "tricks" to install JRE without an "installer". I will show some of them in the next upcoming articles, we became experts about how to make JRE portable :D
    @Unlimited Edition and @castarco: This is, ofc, just the first introduction to "JRE and ReactOS ComEd love". The main objective of this post is: Understanding what JRE is from the user pov, understanding JRE needs regarding ReactOS development, and advancing an introduction to the first bug we found (The Polling bug). More technical details are coming in the next chapter/s. Hope you'll enjoy them ;)
    @Mohammad Hadi Hosseinpour : Well, problem is that people voted to have JRE supported so...we're forced to develop compatibility towards the "closed-source" one. The good news is that any improvement to support properly JRE will probably help to support properly Kaffe, joeq or Intel ORP.

    Report
  • Comment Link FYI Friday, 17 October 2014 15:53 posted by FYI

    @Mohammad Hadi Hosseinpour you're welcome to test with any open-source Java VM you like. File bug reports on JIRA so they can get fixed, though they will have a lower priority than the bugs relating to Oracle's Java VM because like Victor says "people have voted to have JRE supported". And some bug reports for an open-source Java VM might be able to help with supporting Oracle's Java VM too.

    Report
  • Comment Link CSRedRat Monday, 20 October 2014 07:38 posted by CSRedRat

    Nice!

    Report
  • Comment Link vincent Thursday, 23 October 2014 10:40 posted by vincent

    maybe can help if you try to use a more simple java virtual machine, for example an open source java virtual machine like jamVM....

    Report
  • Comment Link Axel Saturday, 25 October 2014 12:35 posted by Axel

    How about trying to get openJDK running first? Debugging should be much easier since the sources are availbale. As the Oracle JRE is now based on OpenJDK, this should greatly benefit to task to get the Oracle version up and running. What's more, virtually all Java applications should run just fine on OpenJDK by now (which was not true some years ago) - and last but not least OpenJDK better fits ReactOS as both are open source. Nice article BTW.

    Report
  • Comment Link Axel Saturday, 25 October 2014 12:43 posted by Axel

    PS: The source code emitting the hotspot error can be seen here (not the same version though, it's in line 3577):
    https://searchcode.com/codesearch/view/60709092/

    if( !VirtualProtect((char *)_polling_page, os::vm_page_size(), PAGE_NOACCESS, &old_status) )
    fatal("Could not disable polling page");

    So obviously the call to VirtualProtect fails under ReactOS. Perhaps this is of use to the devs...

    Report
  • Comment Link castarco Tuesday, 28 October 2014 19:38 posted by castarco

    I miss more news :p , three weeks without new info, whoa. I'm infoaholic.

    Report
  • Comment Link Lu Tuesday, 04 November 2014 17:18 posted by Lu

    Yes, more news. I am not a savvy programmer, but any news on REACTOS now is welcome news, as you seem to have crossed the rubicon with a pretty workable beta version. I followed you for years every 3-6 months once or so, and was frustrated by the slowness of development, and I despaired that this dream WINDOWS (XP) alternative would ever come out. Now I have more hope and your blog should be more frequent. We could leave many ideas and suggestions and perhaps others can help with bugs.

    I just wonder if your poll was a little premature. There weren't that many pollers i think, so it wasn't too representative perhaps? To many geeks? Not enough normal people? :)

    Anyhow, I hope that Cinta Notes and Screenhunter will work on your beta version which I hope to install soon, as I use that constantly for research. IF I didn't need those two programs I would have already moved away totally from my XP install to the dual boot Linux Mint 15 install on my computer. I detest Windows! Then again Linux Mint is still somewhat buggy and slow reacting. FYI I have Linux also installed on a Lenovo B590 that comes without Operating system other than basic DOS, and it installed Linux Mint 15 without a hitch.

    Now that you have a paid programmer, you ought to give us a better roadmap that I have searched for everytime on your entire website, but which is hard to find if you had one at all. I guess you didn't want to give people false hope. But a roadmap can be tentative and it might inspire other windows haters to help when they see there is movement in your development which didn't seem like it for quite a while. I am actually surprised to see you are still working at it.
    I am also interested in your security, as I have heard rumors that even in Ubuntu there are some open source coding lines that have dubious meaning and could be used to hack into it or spy? Anyhow I use XP without Windows OWN firewall of course as I don't trust them and use my own. I understand that REACTOS also has a registry??? Hmmm... How can you make it secure against hacking and what are the prospects?
    Trying to post this I noticed that I could not see "the two words below" , until I enabled Google in NOSCRIPT for this page. Why are you so deeply in bed with Google??? It may scare some away that have something to contribute? Maybe you are too gullible? :) Anyhow I wish you progress.
    One more idea is that you could build in a social network with other REACTOS users --if they so wish -- like a built in skype-chat-email service with encryption of course. Of course that all depends also who is on your board of directors! Ha! If Gates takes you over like he did Skype and Minecraft forget that kind of service. IOW, people are looking for security and privacy still, inspite of all the contrary propaganda.
    Peace and Love
    Lu

    Report
  • Comment Link this link Wednesday, 17 December 2014 00:22 posted by this link

    I really appreciate this post. I've been looking all over for this! Thank goodness I found it on Bing. You have made my day! Thx again!

    Report
  • Comment Link you could try these out Friday, 19 December 2014 08:18 posted by you could try these out

    Utterly composed content , thanks for selective information .

    Report

Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.