WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Oracle Java JDK8 on Raspi  (Read 7667 times)

Offline Canuma

  • Newbie
  • *
  • Posts: 3
Oracle Java JDK8 on Raspi
« on: October 28, 2015, 07:56:25 PM »
I am pretty new to tinycore linux and i am still in progress of finding out how stuff works. So far i was able to set up a basic system. For my project however, i need java. The only hint i found so far is http://forum.tinycorelinux.net/index.php/topic,16261.msg96676.html#msg96676
However, i am not quite sure how to do that.
Question:
Am I right to assume there is no ready to run java tcz?
If so, could someone provide a short step by step guide how to install the jdk? How can i build my own tcz? (It is stated in the link above, that I should not use /opt, but instead build a tcz)
Sorry if this was answered elswhere...

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11670
Re: Oracle Java JDK8 on Raspi
« Reply #1 on: October 28, 2015, 08:47:05 PM »
Hi Canuma
A  tcz  is a directory tree packed into a  squash  file system. There's a Wiki entry on extension building:
http://wiki.tinycorelinux.net/wiki:creating_extensions

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: Oracle Java JDK8 on Raspi
« Reply #2 on: October 28, 2015, 10:18:58 PM »
I think I got java working in piCore 5 just by copying the JavaVM stuff across.
It was a long time ago now.
If I remember right I just copied the raspbian java directories across, took a bit of path sorting but it did work.
If I knew how to do tcz it would have helped, it's on my very long list.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Oracle Java JDK8 on Raspi
« Reply #3 on: October 28, 2015, 11:42:09 PM »
« Last Edit: October 28, 2015, 11:43:47 PM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Canuma

  • Newbie
  • *
  • Posts: 3
Re: Oracle Java JDK8 on Raspi
« Reply #4 on: October 29, 2015, 05:02:20 PM »
Thank you so much guys.
Java works now like a charme. In case somebody else find it usefull, here is what i did:

* download jdk (Linux ARM v6/v7 Hard Float ABI) http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
* transfered it to my box via scp
* install squashfs-tools
* make extension directory
Code: [Select]
mkdir -p /home/tc/extension/usr/local/java* extract
Code: [Select]
tar xvzf jdk-8u65-linux-arm32-vfp-hflt.tar.gz -C /home/tc/extension/usr/local/java/* make an assign file in /etc/profile.d/ (I used nano, course you might do it even with echo)
Code: [Select]
sudo nano /etc/profile.d/java.sh* insert and save:
Code: [Select]
export JAVA_HOME=/usr/local/java/jdk1.8.0_65/
export PATH=$PATH:$JAVA_HOME/bin
* add /etc/profile.d to filetool.lst (again, i like nano... ;-) )
Code: [Select]
nano /opt/.filetool.lst* insert and save:
Code: [Select]
etc/profile.d* make jdk1.8.0_65.tcz
Code: [Select]
sudo -s
cd /home/tc/extension
mksquashfs extension/ jdk1.8.0_65.tcz
* now copy jdk1.8.0_65.tcz to your tce/optional folder and add it to your onboot.lst (path is probably different for you, so no code, but i guess you might know how to copy stuff)
* before you backup, you want to safe the jdk1.8.0_65.tcz elsewhere and finally rm extension folder, jdk-8u65-linux-arm32-vfp-hflt.tar.gz and jdk1.8.0_65.tcz
*now
Code: [Select]
backup and reboot
*test if everything works as expected:
Code: [Select]
java -version*it should say
Code: [Select]
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) Client VM (build 25.65-b01, mixed mode)






Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: Oracle Java JDK8 on Raspi
« Reply #5 on: October 29, 2015, 10:29:05 PM »
Thanks Canuma,

You should put in the tcz repository.
Does that have the FX stuff?
I have not checked for a while, I thought it was taken out from version 8.33.

I had to use Raspbian with JavaFx for one project, piCore with Java should be smaller and more reliable.
JavaFX can be used for non x11 GUI's and is GPU accelerated.

Regards
Gavin

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: Oracle Java JDK8 on Raspi
« Reply #6 on: October 29, 2015, 11:38:01 PM »
Looks to be someone already does nightly builds of OpenJFX
http://108.61.191.178/

Not sure yet which one will work with your tcz or the difference between the three versions.


Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: Oracle Java JDK8 on Raspi
« Reply #7 on: November 02, 2015, 11:46:33 PM »
Thanks Canuma,

I used your clearly explained method of making a .tcz to make one for websocketd.
Compresses the 5Mb file to 1.9MB, added it to bootlist, still got a <20sec boot,
filetool.sh -b is much quicker as I am not backing up the websocket binary as well.
I will figure out how to make a md5 file later.

I can now go back a read the corebook and understand it a bit more:)

Regards
Gavin

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11670
Re: Oracle Java JDK8 on Raspi
« Reply #8 on: November 03, 2015, 12:49:41 AM »
Hi gavinmc42
Quote
I will figure out how to make a md5 file later.
Code: [Select]
md5sum ExtensionName.tcz > ExtensionName.tcz.md5.txtReplace  ExtensionName  with the name of your extension.

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: Oracle Java JDK8 on Raspi
« Reply #9 on: November 03, 2015, 01:37:57 AM »
Thanks,

md5sum is in busybox, so comes standard.
Still only know or use a fraction of those commands.
Hmm eject - no cdrom on my Pi , guess that won't work;)
For USB CDROM drives?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11670
Re: Oracle Java JDK8 on Raspi
« Reply #10 on: November 03, 2015, 01:46:48 AM »
Hi gavinmc42
Quote
Hmm eject - no cdrom on my Pi , guess that won't work;)
For USB CDROM drives?
Code: [Select]
tc@box:~/guilib/grabber/grabber-1.1$ eject --help
BusyBox v1.19.3 (2011-10-30 01:47:29 UTC) multi-call binary.

Usage: eject [-t] [-T] [DEVICE]

Eject DEVICE or default /dev/cdrom

        -t      Close tray
        -T      Open/close tray (toggle)

tc@box:~/guilib/grabber/grabber-1.1$
For a list of the available  busybox  commands, just enter  busybox  in a terminal.

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: Oracle Java JDK8 on Raspi
« Reply #11 on: November 03, 2015, 02:33:49 AM »
Was joking ;D

Offline Canuma

  • Newbie
  • *
  • Posts: 3
Re: Oracle Java JDK8 on Raspi
« Reply #12 on: November 03, 2015, 03:05:12 AM »
@gavinmc42
Glad it helped :-)
Unfortunatelly i am not sure about JavaFX, but you may try it with the port you mentioned.
For sharing the tcz, i am not comfortable with that, i guess it should be polished a bit more (for example, the env script should probably also go into the tcz, also there is certainly lot of other stuff to be taken care of)
Besides, java is a real hog. The tcz is huge and it would be great to actually remove stuff i don't need. But for now, it serves its purpose.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Oracle Java JDK8 on Raspi
« Reply #13 on: November 03, 2015, 03:22:20 AM »
Might not be of any relevance, but I had to use this (in addition to what was mentioned by Canuma in reply #4) for some apps with Java 7 on x86:
Code: [Select]
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JAVA_HOME/jre/lib/i386/
Download a copy and keep it handy: Core book ;)

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: Oracle Java JDK8 on Raspi
« Reply #14 on: November 03, 2015, 08:35:48 PM »
Hi Canuma,

Java + JFX is a hog, not sure having these beasts fits the Tiny Core philosophy.
500+MB? compressed tcz ?MB. Boot time?
Works on Raspbian, but that is a 4GB+ OS so Java is only a small part.
Can do some interesting stuff out of the box, I did this real quick.
https://www.raspberrypi.org/forums/viewtopic.php?f=81&t=104117&p=730773#p730773
Java + FX does work right now on Raspbian, needs some work which you have done to get it going on PiCore.

Yep Misalf, sorting out the PATH stuff is most of the work to get it running.

Still haven't found anything small that does the same accelerated stuff as easy yet.
The fact that Oracle has backed away from FX on ARM worries me a little.
But it still would be easier to backup a 600MB OS than a 4GB+ one.

Been looking at Ubuntu Snappy and Win10 IoT, they are around 500MB, but no GUIs.
Currently I'm thinking piCore plus some sort of native non X11 WebKit/WebGL for UI's.
There has been some work recently getting OpenGL to work on Pi's.
Processing 3 does work, slowly, it is a layer on top of Java.

If I need to do something quick or refactor the above project then PiCore + JFX will be worth another look.
When I get spare time :o I may look at how hard it is to get Netbeans talking to piCore+Java.

Thinking about Pi 2 and Quad cores and future models it makes more sense to look at Go plus something like OpenGLxx.
A language that can handle parallel processes without heavy lifting. Go is a 32MB tcz + a GUI library ?MB

Regards
Gavin