Post Reply 
OpenWRT or router install
06-01-2015, 22:59
Post: #21
RE: OpenWRT or router install
(06-01-2015 22:38)alexinc Wrote:  root@OpenWrt:/# ls -l /usr/share/java/jre/bin/java
-rwxr-xr-x 1 10 143 3420 Sep 27 00:58 /usr/share/java/jre/bin/java
root@OpenWrt:/# ls -l /usr/share/java/jre
lrwxrwxrwx 1 root root 12 Jan 6 21:23 /usr/share/java/jre -> ejre1.7.0_71
root@OpenWrt:/# ls -l /usr/share/java
-rwxr-xr-x 1 root root 33542660 Jan 6 21:21 ejre-7u71-fcs-b14-linux-arm-sflt-headless-26_sep_2014.tar.gz
drwxr-xr-x 4 10 143 576 Jan 6 21:22 ejre1.7.0_71
lrwxrwxrwx 1 root root 12 Jan 6 21:23 jre -> ejre1.7.0_71

OK, so the java executable does exist but trying to run it produces a "not found" message. This usually means there is a problem with linker dependencies in the .so files that the executable is loading. Another possibility is that the java file has the wrong architecture (for example, soft float instead of hard float). Can you check whether OpenWRT is built for soft float or hard float?

The ldd tool (if this is present in OpenWRT) is useful for debugging linker dependency problems. What is the output from this command?

ldd /usr/share/java/ejre1.7.0_71/bin/java

It should be something like this:

Code:
nash@debian:~$ ldd /sd1/jre/ejre1.7.0_45/bin/java
        libpthread.so.0 => /lib/arm-linux-gnueabi/libpthread.so.0 (0x4008c000)
        libjli.so => /sd1/jre/ejre1.7.0_45/bin/../lib/arm/jli/libjli.so (0x40130000)
        libdl.so.2 => /lib/arm-linux-gnueabi/libdl.so.2 (0x40070000)
        libc.so.6 => /lib/arm-linux-gnueabi/libc.so.6 (0x4014c000)
        libgcc_s.so.1 => /lib/arm-linux-gnueabi/libgcc_s.so.1 (0x400ac000)
        /lib/ld-linux.so.3 (0x2a000000)
Find all posts by this user
Quote this message in a reply
06-01-2015, 23:03
Post: #22
RE: OpenWRT or router install
You might want to try this hard-float version of Java SE Embedded:

ejre-7u71-fcs-b14-linux-arm-vfp-hflt-client_headless-26_sep_2014.tar.gz
Find all posts by this user
Quote this message in a reply
06-01-2015, 23:53 (This post was last modified: 06-01-2015 23:58 by alexinc.)
Post: #23
RE: OpenWRT or router install
for soft-float i'm getting:

root@OpenWrt:/# ldd /usr/share/java/ejre1.7.0_71/bin/java
ldd: can't open cache '/etc/ld.so.cache'
checking sub-depends for '/lib/libpthread.so.0'
checking sub-depends for 'not found'
checking sub-depends for 'not found'
checking sub-depends for 'not found'
checking sub-depends for '/lib/libgcc_s.so.1'
libpthread.so.0 => /lib/libpthread.so.0 (0x00000000)
libjli.so => not found (0x00000000)
libdl.so.2 => not found (0x00000000)
libc.so.6 => not found (0x00000000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00000000)
not a dynamic executable

hard-float didn't make any difference:

root@OpenWrt:/# ldd /usr/share/java/ejre1.7.0_71/bin/java
ldd: can't open cache '/etc/ld.so.cache'
checking sub-depends for '/lib/libpthread.so.0'
checking sub-depends for 'not found'
checking sub-depends for 'not found'
checking sub-depends for 'not found'
libpthread.so.0 => /lib/libpthread.so.0 (0x00000000)
libjli.so => not found (0x00000000)
libdl.so.2 => not found (0x00000000)
libc.so.6 => not found (0x00000000)
ld-uClibc.so.0 => ld-uClibc.so.0 (0x00000000)
Find all posts by this user
Quote this message in a reply
07-01-2015, 09:39
Post: #24
RE: OpenWRT or router install
(06-01-2015 23:53)alexinc Wrote:  for soft-float i'm getting:

root@OpenWrt:/# ldd /usr/share/java/ejre1.7.0_71/bin/java
ldd: can't open cache '/etc/ld.so.cache'
checking sub-depends for '/lib/libpthread.so.0'
checking sub-depends for 'not found'
checking sub-depends for 'not found'
checking sub-depends for 'not found'
checking sub-depends for '/lib/libgcc_s.so.1'
libpthread.so.0 => /lib/libpthread.so.0 (0x00000000)
libjli.so => not found (0x00000000)
libdl.so.2 => not found (0x00000000)
libc.so.6 => not found (0x00000000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00000000)
not a dynamic executable

hard-float didn't make any difference:

root@OpenWrt:/# ldd /usr/share/java/ejre1.7.0_71/bin/java
ldd: can't open cache '/etc/ld.so.cache'
checking sub-depends for '/lib/libpthread.so.0'
checking sub-depends for 'not found'
checking sub-depends for 'not found'
checking sub-depends for 'not found'
libpthread.so.0 => /lib/libpthread.so.0 (0x00000000)
libjli.so => not found (0x00000000)
libdl.so.2 => not found (0x00000000)
libc.so.6 => not found (0x00000000)
ld-uClibc.so.0 => ld-uClibc.so.0 (0x00000000)

Actually, it looks like hard float did make a small difference. There isn't a "not a dynamic executable" message at the end, unless you accidentally omitted this when copying and pasting the output.

The issue with missing libraries seems to be related to glibc support on OpenWRT. According to this thread (from 2011), OpenWRT doesn't support binaries compiled for glibc. Can you check on the OpenWRT forum whether this is correct? If so, you won't be able to run Java SE Embedded on OpenWRT.
Find all posts by this user
Quote this message in a reply
07-01-2015, 11:53
Post: #25
RE: OpenWRT or router install
(07-01-2015 09:39)simoncn Wrote:  Actually, it looks like hard float did make a small difference. There isn't a "not a dynamic executable" message at the end, unless you accidentally omitted this when copying and pasting the output.

The issue with missing libraries seems to be related to glibc support on OpenWRT. According to this thread (from 2011), OpenWRT doesn't support binaries compiled for glibc. Can you check on the OpenWRT forum whether this is correct? If so, you won't be able to run Java SE Embedded on OpenWRT.

ok, will dig a bit deeper and try to build firmware with glibc, as it seems i can configure which libc implementation to use (not near my machine now) e.g. here. Wink copy&paste was right, so there is this little difference between hard- and soft-float. i should go with hard-float then?
Find all posts by this user
Quote this message in a reply
07-01-2015, 12:10
Post: #26
RE: OpenWRT or router install
(07-01-2015 11:53)alexinc Wrote:  ok, will dig a bit deeper and try to build firmware with glibc, as it seems i can configure which libc implementation to use (not near my machine now) e.g. here. Wink copy&paste was right, so there is this little difference between hard- and soft-float. i should go with hard-float then?

From this message, I'm fairly sure that's correct. Your processor supports hard float, so it's likely that OpenWRT would have been compiled for hard float. You could double-check this by asking on the OpenWRT forum. Also, if you are compiling OpenWRT yourself for glibc, you should be able to make sure it's compiled for hard float as well.
Find all posts by this user
Quote this message in a reply
08-01-2015, 15:41 (This post was last modified: 08-01-2015 15:43 by alexinc.)
Post: #27
RE: OpenWRT or router install
getting closer, but not close enough! Wink after building openwrt with eglibc and using soft-float version of oracle embedded java i'm getting:

root@OpenWrt:/usr/share# java -version
java version "1.7.0_71"
Java™ SE Embedded Runtime Environment (build 1.7.0_71-b14, headless)
Java HotSpot™ Embedded Client VM (build 24.71-b01, mixed mode)

starting minimserver now is promising, but:

root@OpenWrt:/usr/share# /usr/share/minimserver/minimserver-0.8.3/bin/startc
MinimServer 0.8.3 update 50, Copyright © 2012-2014 Simon Nash. All rights reserved.
java.lang.UnsatisfiedLinkError: /usr/share/minimserver/data/tmp/native/libohNet.so: libstdc++.so.6: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864)
at java.lang.Runtime.loadLibrary0(Runtime.java:849)
at java.lang.System.loadLibrary(System.java:1088)
at org.jminim.lib.OhNetService.createLibrary(OhNetService.java:569)
at org.jminim.lib.OhNetService.createDeviceStack(OhNetService.java:476)
at org.jminim.lib.OhNetService.createDeviceFactory(OhNetService.java:379)
at org.jminim.lib.OhNetService.access$1800(OhNetService.java:47)
at org.jminim.lib.OhNetService$Proxy.createDeviceFactory(OhNetService.java:945)
at org.jminim.lib.MonitorService$Monitor.createDevice(MonitorService.java:259)
at org.jminim.lib.MonitorService$Monitor.listenerAdded(MonitorService.java:333)
at org.jminim.core.RuntimeImpl.addEventListener(RuntimeImpl.java:1258)
at org.jminim.lib.RuntimeService$Proxy.addEventListener(RuntimeService.java:212)
at com.minimserver.Server.doStart(Server.java:676)
at com.minimserver.Server.start(Server.java:508)
at org.jminim.core.ContextImpl.startComponent(ContextImpl.java:167)
at org.jminim.core.ContextImpl.start(ContextImpl.java:92)
at org.jminim.core.RootContextImpl.startComponent(RootContextImpl.java:47)
at org.jminim.core.ContextImpl.start(ContextImpl.java:92)
at org.jminim.core.RuntimeImpl.run(RuntimeImpl.java:1382)
at org.jminim.core.LauncherImpl.run(LauncherImpl.java:975)
at org.jminim.core.LauncherImpl.launch(LauncherImpl.java:107)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav​a:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jminim.launch.Launcher.doLaunch(Launcher.java:621)
at org.jminim.launch.Launcher.launch(Launcher.java:204)
at com.minimserver.launch.LaunchServer.main(LaunchServer.java:30)
MinimServer error: now stopped, use 'restart' or 'exit'
Enter command (? for help), or null to exit:
>

ldd isn't working on eglibc build openwrt! Undecided ldd not found, although its installed as package and listed in /usr/bin (like working one in uclib version)! Sad
Find all posts by this user
Quote this message in a reply
08-01-2015, 16:22
Post: #28
RE: OpenWRT or router install
(08-01-2015 15:41)alexinc Wrote:  getting closer, but not close enough! Wink after building openwrt with eglibc and using soft-float version of oracle embedded java i'm getting:

root@OpenWrt:/usr/share# java -version
java version "1.7.0_71"
Java™ SE Embedded Runtime Environment (build 1.7.0_71-b14, headless)
Java HotSpot™ Embedded Client VM (build 24.71-b01, mixed mode)

starting minimserver now is promising, but:

root@OpenWrt:/usr/share# /usr/share/minimserver/minimserver-0.8.3/bin/startc
MinimServer 0.8.3 update 50, Copyright © 2012-2014 Simon Nash. All rights reserved.
java.lang.UnsatisfiedLinkError: /usr/share/minimserver/data/tmp/native/libohNet.so: libstdc++.so.6: cannot open shared object file: No such file or directory

ldd isn't working on eglibc build openwrt! Undecided ldd not found, although its installed as package and listed in /usr/bin (like working one in uclib version)! Sad

As the message says, you are missing the libstdc++.so.6 file. If you have a working version of gcc/g++ for OpenWrt, it should contain this library.

As an alternative to ldd, you could try:

/lib/ld-linux-so.3 --list <full-path-to-java-executable>
Find all posts by this user
Quote this message in a reply
08-01-2015, 16:34
Post: #29
RE: OpenWRT or router install
ok, going to hunt for libstdc++.so.6! Smile nothing can stop me! Big Grin

root@OpenWrt:/usr/share/java/ejre1.7.0_71/bin# /lib/ld-linux.so.3 --list /usr/sh
are/java/ejre1.7.0_71/bin/java
libpthread.so.0 => /lib/libpthread.so.0 (0xb6fa1000)
libjli.so => /usr/share/java/ejre1.7.0_71/bin/../lib/arm/jli/libjli.so (0xb6f85000)
libdl.so.2 => /lib/libdl.so.2 (0xb6f72000)
libc.so.6 => /lib/libc.so.6 (0xb6e59000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6e3d000)
/lib/ld-linux.so.3 (0xb6fca000)
Find all posts by this user
Quote this message in a reply
08-01-2015, 16:45 (This post was last modified: 08-01-2015 16:45 by simoncn.)
Post: #30
RE: OpenWRT or router install
(08-01-2015 16:34)alexinc Wrote:  ok, going to hunt for libstdc++.so.6! Smile nothing can stop me! Big Grin

root@OpenWrt:/usr/share/java/ejre1.7.0_71/bin# /lib/ld-linux.so.3 --list /usr/sh
are/java/ejre1.7.0_71/bin/java
libpthread.so.0 => /lib/libpthread.so.0 (0xb6fa1000)
libjli.so => /usr/share/java/ejre1.7.0_71/bin/../lib/arm/jli/libjli.so (0xb6f85000)
libdl.so.2 => /lib/libdl.so.2 (0xb6f72000)
libc.so.6 => /lib/libc.so.6 (0xb6e59000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6e3d000)
/lib/ld-linux.so.3 (0xb6fca000)

Looks good! Smile

To see the full set of dependencies for MinimServer, you would also need to repeat this for /usr/share/minimserver/data/tmp/native/libohNet.so and /usr/share/minimserver/data/tmp/native/libohNetJni.so.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)