Page 1 of 3

Java support

Posted: Sat Jan 30, 2016 8:38 pm
by bobiturboto
Java support is here, let's go start. My tv is F8000

Download the latest http://www.oracle.com/technetwork/java/ ... index.html for SoftFP ABI on your pc.
Make sure that you have installed java there with exported JAVA_HOME variable
My system is OS X based but the procedure for Linux is the same. Windows procedure it may be the same, but check the documentation.

You can create your JRE configuration to be minimal or full

Navigate to extracted java package and execute.

Minimal:

Code: Select all

./bin/jrecreate.sh --dest jre8 -p compact1
Full

Code: Select all

./bin/jrecreate.sh --dest jre8 --vm all
Compress the output directory

Code: Select all

zip -r jre8.zip jre8/*
Transfer jre8.zip to your tv /mtd_rwcommon directory.
Extract it's content.

Code: Select all

unzip jre8.zip 
Modify /mnt/etc/rc.sysinit file as following

Java executables path should be added to system path

Code: Select all

export PATH="$DISTROOT/sbin:$DISTROOT/bin:$DISTROOT/usr/bin:$DISTROOT/usr/sbin:$SYSROOT/sbin:$SYSROOT/bin:$SYSROOT/usr/bin:$SYSROOT/usr/sbin:/mtd_rwcommon/jre8/bin/:$PATH"
Java home sys variable should be added into the same file

Code: Select all

export JAVA_HOME="/mtd_rwcommon/jre8/" 
Restart the TV and test your java installation

minimal configuration

Code: Select all

root@tv:/mnt # java -version
java version "1.8.0_71"
Java(TM) SE Embedded Runtime Environment (build 1.8.0_71-b15, profile compact1, headless)
Java HotSpot(TM) Embedded Minimal VM (build 25.71-b15, mixed mode)
full jre

Code: Select all

root@tv:/mtd_rwcommon $ java -version
java version "1.8.0_71"
Java(TM) SE Embedded Runtime Environment (build 1.8.0_71-b15, headless)
Java HotSpot(TM) Embedded Client VM (build 25.71-b15, mixed mode)

Re: Java support

Posted: Sat Jan 30, 2016 9:34 pm
by sectroyer
Great work :) But instead of /mtd_rwcommon/ I would suggest putting on USB (to much data in /mtd_rwcommon CAN cause a brick :))

Re: Java support

Posted: Sat Jan 30, 2016 11:08 pm
by bobiturboto
Good point. I have more than 1GB free there, is save to leave it there or it will be better to be on my ext drive?

Re: Java support

Posted: Sun Jan 31, 2016 10:58 am
by sectroyer
Might be good but no warranty :) I had about 250MiB of free space and ALMOST bricked TV :)

Re: Java support

Posted: Sun Jan 31, 2016 9:30 pm
by bobiturboto
Unfortunately is not working from my drive.

Code: Select all

root@tv:/mnt # mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro,relatime)
none on /proc type proc (rw,relatime)
none on /sys type sysfs (rw,relatime)
none on /dev/sam type tmpfs (rw,relatime,size=4k)
none on /dtv type tmpfs (rw,relatime,size=30720k)
none on /freesia type tmpfs (rw,relatime,size=2048k)
none on /core type tmpfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,relatime,size=20480k)
tmpfs on /dev/shm type tmpfs (rw,relatime)
none on /sys/kernel/security type securityfs (rw,relatime)
/dev/mmcblk0p18 on /mtd_exe type squashfs (ro,relatime)
none on /sys/fs/cgroup type cgroup (rw,relatime,cpu)
/dev/mmcblk0p16 on /mtd_rwarea type emmcfs (rw,relatime)
/dev/mmcblk0p14 on /mtd_drmregion_a type emmcfs (rw,relatime)
/dev/mmcblk0p15 on /mtd_drmregion_b type emmcfs (rw,relatime)
/dev/mmcblk0p20 on /mtd_rocommon type squashfs (ro,noexec,relatime)
/dev/mmcblk0p22 on /mtd_contents type emmcfs (rw,relatime)
/dev/mmcblk0p24 on /mtd_rwcommon type emmcfs (rw,relatime)
/dev/loop0 on /mtd_rwcommon/widgets/manager/10130000000 type squashfs (ro,noexec,relatime)
none on /proc/bus/usb type usbfs (rw,relatime)
/dev/mmcblk0p21 on /mtd_emanual type emmcfs (rw,relatime)
/dev/mmcblk0p23 on /mtd_swu type emmcfs (rw,relatime)
none on /sys/kernel/debug type debugfs (rw,relatime)
/dev/sda1 on /dtv/usb/sda1 type tntfs (rw,noexec,relatime,uid=0,gid=0,umask=00,utf8,min_prealloc_size=64k,readahead=4M,case_sensitive,reset_journal,nobarrier,errors=continue,mft_zone_multiplier=1,nfs_max_len=1020)
/dtv/loop4 on /mtd_rwcommon/widgets/normal/10120000099 type squashfs (ro,noexec,relatime)
/tmp/loopnone on /mnt type ext4 (rw,sync,relatime,user_xattr,barrier=1,data=ordered)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
/tmp/loopnone on /bin/busybox type ext4 (rw,sync,relatime,user_xattr,barrier=1,data=ordered)
/dev/mmcblk0p16 on /etc/profile type emmcfs (rw,relatime)
/dev/mmcblk0p16 on /etc/passwd type emmcfs (rw,relatime)

Code: Select all

root@tv:/mnt # java -version
/mnt/bin/sh: java: Permission denied

root@tv:/mnt # echo $PATH
/mnt/opt/privateer/sbin:/mnt/opt/privateer/bin:/mnt/opt/privateer/usr/bin:/mnt/opt/privateer/usr/sbin:/mnt/sbin:/mnt/bin:/mnt/usr/bin:/mnt/usr/sbin:/dtv/usb/sda1/jre8/bin/:/tmp/bin:/usr/sbin:/usr/bin:/bin:/sbin:/etc/Scripts:/util:/mtd_appdata/Runtime/bin

root@tv:/mnt # /dtv/usb/sda1/jre8/bin/java -version
/mnt/bin/sh: /dtv/usb/sda1/jre8/bin/java: Permission denied
root@tv:/mnt # ls -al /dtv/usb/sda1/jre8/bin/java
-rwxrwxrwx    1 root     0             3520 Jan 30  2016 /dtv/usb/sda1/jre8/bin/java

Re: Java support

Posted: Sun Jan 31, 2016 9:42 pm
by sectroyer
Very simple:

Code: Select all

mount -o remount,exec "/dtv/usb/sda1/"
:)

Re: Java support

Posted: Sun Jan 31, 2016 10:33 pm
by bobiturboto
Yes I knew the solution and think the best place for the command it should be the same rc.sysinit or you will suggest som different init script?

Re: Java support

Posted: Sun Jan 31, 2016 11:59 pm
by sectroyer
Wonderfull would be: 99_99_JavaFix.init :)

Re: Java support

Posted: Mon Feb 01, 2016 1:17 am
by pabos
thank you bobiturboto !! :-)

Edit:
the .class file has to be executed with

Code: Select all

java -cp . ClassFile

instead of

Code: Select all

java ClassFile
(http://stackoverflow.com/questions/7485 ... main-class)

Re: Java support

Posted: Tue Feb 02, 2016 8:58 am
by setti
@bobiturboto
Nice tut, but what is your use case of java?