Hi Luciano,

My apologies, while I'm subscribed to this bug for some reason I missed
the message from your last comment. To answer your question: besides re-
compiling openjdk 7 on their own, there is not much a user can do (* see
bellow for a hack-ish way)

This issue has been fixed in IcedTea 2.6+ which is only available for
Wily.

-> 2.6.1 (Wily)
$ java -XshowSettings -version 2>&1 | grep -e IcedTea -e os.arch -e 
sun.boot.library.path
    os.arch = ppc64le
    sun.boot.library.path = /usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/ppc64le
OpenJDK Runtime Environment (IcedTea 2.6.1) (7u85-2.6.1-5)

-> 2.5.6 (Vivid, Trusty)
$ java -XshowSettings -version 2>&1 | grep -e IcedTea -e os.arch -e 
sun.boot.library.path
    os.arch = ppc64
    sun.boot.library.path = /usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/ppc64
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-0ubuntu1.15.04.1)


I will check if we can update Vivid and Trusty to 2.6.x in the upcoming IcedTea 
2.6.2 release that I'm working on, otherwise I will provide an SRU with the 
patch to fix this.


** Ugly hack **
Remember: use at your own risk, don't try it at home, keep the kids away, yada 
yada. ;-)

It is possible to get os.arch to return "ppc64le" by modifying the
libjava.so file in jre/lib/ppc64

The following information is valid for Vivid, I haven't checked but Trusty 
offsets might be different. 
Using a hex editor (eg. hexedit), go to position 0x2B938, where it should show 
in ASCII "little..ppc64...GNOME_DESKTOP_SESSION_ID" and modify the 'ppc64' 
entry to 'ppc64le' (overwriting 2 null bytes).

$ cmp -lb libjava.so.orig libjava.so
178494   0 ^@   154 l
178495   0 ^@   145 e

$ java -XshowSettings -version 2>&1 | grep -e IcedTea -e os.arch -e 
sun.boot.library.path
    os.arch = ppc64le
    sun.boot.library.path = /usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib/ppc64
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-0ubuntu1.15.04.1)

With that, programs that depend on os.arch might work as expected (I
haven't test anything besides the -XshowSettings test above).

Depending on how the program behaves, you might also need to link the 'ppc64' 
lib arch dir to 'ppc64le', eg:
# cd /usr/lib/jvm/java-7-openjdk-ppc64el/jre/lib
# ln -s ppc64 ppc64le

If you do test this, let me know the results and what programs you
tested it with. I'm a bit curious on how well it might work. =)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1438575

Title:
  OpenJdk 7 and OpenJdk 8 miss-report the os.arch field and cause java
  apps to crash.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openjdk-7/+bug/1438575/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to