EzDevInfo.com

opensuse interview questions

Top opensuse frequently asked interview questions

How to change the Monitor brightness on Linux?

How do I programmatically change the monitor brightness on Linux?

I'm using SLES 11.


Source: (StackOverflow)

Potential reasons dlopen could segfault?

What are some of the reasons dlopen could segfault besides the shared object not existing?

In my case, I know the shared object exists, but when my program goes to load it using dlopen, it segfaults. I checked in my lib folder and the shared object is there and the paths are all correct.

    handle = dlopen(libraryName.c_str(), RTLD_LAZY | RTLD_GLOBAL);

gdb bt:

#0  0x00000000001b94f5 in ?? ()
#1  0x00007fffefd96db6 in __do_global_ctors_aux () from /usr/local/lib/MY_LIB2.so
#2  0x00007fffefcf82c3 in _init () from /usr/local/lib/MY_LIB2.so
#3  0x00007fffed69c6c8 in ?? () from /usr/local/lib/MY_LIB1.so
#4  0x00007ffff7de9dc4 in call_init () from /lib64/ld-linux-x86-64.so.2
#5  0x00007ffff7de9ef6 in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
#6  0x00007ffff7dedf43 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
#7  0x00007ffff7de9c36 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#8  0x00007ffff7ded7ca in _dl_open () from /lib64/ld-linux-x86-64.so.2
#9  0x00007ffff5c5af26 in dlopen_doit () from /lib64/libdl.so.2
#10 0x00007ffff7de9c36 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#11 0x00007ffff5c5b4cf in _dlerror_run () from /lib64/libdl.so.2 
#12 0x00007ffff5c5afc1 in dlopen@@GLIBC_2.2.5 () from /lib64/libdl.so.2
#13 0x00007ffff6ecef7e in mynamespace::Factory::attachModule (this=0x61d440,    libraryName=...) at Factory.cpp:324
#14 0x00007ffff6ecefe6 in mynamespace::Factory::attachFunction (this=0x61d440, functionName=..., moduleName=...) at Factory.cpp:343
#15 0x00007ffff6ecdd16 in mynamespace::Factory::ReadFile (this=0x61d440, x=...) at Factory.cpp:111
#16 0x00007ffff6ecda62 in mynamespace::Factory::ReadDirectory (this=0x61d440, x=...) at Factory.cpp:79
#17 0x00007ffff6ecdc66 in mynamespace::Factory::ReadDirectory (this=0x61d440, x=0x417901 "/usr/local/lib/") at Factory.cpp:105

#18 0x0000000000410637 in main (argc=2, argv=0x7fffffffdd58) at main.cpp:78


Source: (StackOverflow)

Advertisements

Mapnik installation error on openSUSE 12.3

When trying to install mapnik on openSuse 12.3, ./configure command throws this error: Checking if compiler (g++) supports -std=c++11 flag... (cached) no C++ compiler does not support C++11 standard, which is required. Please use Mapnik 2.x instead of 3.x as an alternative

# more /proc/version
Linux version 3.7.10-1.24-desktop (geeko@buildhost) (gcc version 4.7.2 20130108 [gcc-4_7-branch revision 195012] (SUSE Linux) ) #1 SMP PREEMPT Wed Oct 2 11:15:18 UTC 2013 (375b8b4)

All dependencies are installed.


Source: (StackOverflow)

How to connect to mysql localhost on opensuse?

first the details of the configuration:

  1. openSUSE 11.3 with Parallels Plesk Panel 10 (64-bit) Server
  2. MySQL installed and running (no "skip-networking")
  3. java 1.6.0_24 (Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode))

The mysql server listens on 0.0.0.0:3306

netstat -lnp | grep mysql
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      3499/mysqld         
unix  2      [ ACC ]     STREAM     LISTENING     10916  3499/mysqld         /var/run/mysql/mysql.sock

Now the problem. I can not connect to the mysql from localhost with jdbc (mysql-connector-java-5.1.17-bin.jar) using this class:

public class Connect {
    public static void main(String[] args) {
        Connection conn = null;

        try {
            String userName = "user";
            String password = "password";
            // This also doesn't work with "localhost" in the connect string.
            String url = "jdbc:mysql://127.0.0.1:3306/database";

            System.out.println("URL: " + url);

            Class.forName("com.mysql.jdbc.Driver").newInstance();
            conn = DriverManager.getConnection(url, userName, password);
            System.out.println("Database connection established");
        } catch (Exception e) {
            e.printStackTrace();
            System.err.println("Cannot connect to database server");
        } finally {
            if (conn != null) {
                try {
                    conn.close();
                    System.out.println("Database connection terminated");
                } catch (Exception e) { /* ignore close errors */
                }
            }
        }
    }
}

More details:

telnet gives time out

telnet localhost 3306
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection timed out

nmap shows the port 3306 is filtered on localhost

nmap -p 3306 localhost
Starting Nmap 5.00 ( http://nmap.org ) at 2011-08-30 19:21 CEST
Interesting ports on localhost (127.0.0.1):
PORT     STATE    SERVICE
3306/tcp filtered mysql

Nmap done: 1 IP address (1 host up) scanned in 2.31 seconds

If I connect from outside to the servers 3306 port with the Connect class, everything works fine.

As I think this is something with the firewall. This is the automatically generated firewall from the plesk configuration center.

iptables -nvL
Chain INPUT (policy DROP 0 packets, 0 bytes)
target     prot opt in     out     source               destination         
ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED 
REJECT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:!0x17/0x02 reject-with tcp-reset 
DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0           state INVALID 
ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           
ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:10000 
ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:4306 
DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:12443 
ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:11443 
ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:11444 
ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:8447 
ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:8443 
ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:8880 
ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:80 
ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:443 
ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:21 
ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:22 
ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:587 
ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:25 
ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:465 
ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:110 
ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:995 
ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:143 
ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:993 
DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:106 
ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:3306 
ACCEPT     tcp  --  *      *       127.0.0.1            0.0.0.0/0           tcp dpt:5432 
DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:5432 
ACCEPT     tcp  --  *      *       127.0.0.1            0.0.0.0/0           tcp dpt:9008 
ACCEPT     tcp  --  *      *       127.0.0.1            0.0.0.0/0           tcp dpt:9080 
DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:9008 
DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:9080 
DROP       udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:137 
DROP       udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:138 
DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:139 
DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:445 
DROP       udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:1194 
ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:53 
ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:53 
DROP       icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 8 code 0 
DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain FORWARD (policy DROP 0 packets, 0 bytes)
target     prot opt in     out     source               destination         
ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED 
REJECT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:!0x17/0x02 reject-with tcp-reset 
DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0           state INVALID 
ACCEPT     all  --  lo     lo      0.0.0.0/0            0.0.0.0/0           
DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain OUTPUT (policy DROP 0 packets, 0 bytes)
target     prot opt in     out     source               destination         
ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED 
REJECT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:!0x17/0x02 reject-with tcp-reset 
DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0           state INVALID 
ACCEPT     all  --  *      lo      0.0.0.0/0            0.0.0.0/0           
ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0

Furthermore I can connect with perl to the local mysql.

$dsn = "dbi:mysql:$database:localhost:3306";
$connect = DBI->connect($dsn, $user, $pw);

I would be regretful for any hint to the solution of this. Martin


Source: (StackOverflow)

Distributing a program in linux without the source

I want to be able to distribute a program in Linux without distributing the source with it. The current solution is distributing a tar.gz with a precompiled binary. What is the easiest way to have this binary be placed in the Applications Menu? Is there a way to do this that is common across most linux distributions, but Ubuntu, Fedora, and OpenSUSE would be the priority.


Source: (StackOverflow)

Error with bootstrap loader and kernel

We are working on a project to learn how to write a kernel and learn the ins and outs. We have a bootstrap loader written and it appears to work. However we are having a problem with the kernel loading. I'll start with the first part:

bootloader.asm:

    [BITS 16]
    [ORG 0x0000]
;
;    all the stuff in between
;
;    the bottom of the bootstrap loader

     datasector  dw 0x0000
     cluster     dw 0x0000
     ImageName   db "KERNEL  SYS"
     msgLoading  db 0x0D, 0x0A, "Loading Kernel Shell", 0x0D, 0x0A, 0x00
     msgCRLF     db 0x0D, 0x0A, 0x00
     msgProgress db ".", 0x00
     msgFailure  db 0x0D, 0x0A, "ERROR : Press key to reboot", 0x00

     TIMES 510-($-$$) DB 0
     DW 0xAA55

     ;*************************************************************************

The bootloader.asm is too long for the editor without causing it to chug and choke. In addition, the bootloader and kernel do work within bochs as we do get the message "Welcome to our OS". Anyway, the following is what we have for a kernel at this point.

kernel.asm:

[BITS 16]
[ORG 0x0000]

[SEGMENT .text]         ; code segment
    mov     ax, 0x0100          ; location where kernel is loaded
    mov     ds, ax
    mov     es, ax

    cli
    mov     ss, ax          ; stack segment
    mov     sp, 0xFFFF          ; stack pointer at 64k limit
    sti

    mov     si, strWelcomeMsg       ; load message
    call        _disp_str

    mov     ah, 0x00
    int     0x16                ; interrupt: await keypress
    int     0x19                ; interrupt: reboot

_disp_str:
    lodsb                       ; load next character
    or      al, al          ; test for NUL character
    jz      .DONE

    mov     ah, 0x0E            ; BIOS teletype
    mov     bh, 0x00            ; display page 0
    mov     bl, 0x07            ; text attribute
    int     0x10                ; interrupt: invoke BIOS

    jmp     _disp_str

.DONE:
    ret

[SEGMENT .data]                 ; initialized data segment
    strWelcomeMsg   db  "Welcome to our OS",    0x00

[SEGMENT .bss]              ; uninitialized data segment  

Using nasm 2.06rc2 I compile as such:
nasm bootloader.asm -o bootloader.bin -f bin
nasm kernel.asm -o kernel.sys -f bin

We write bootloader.bin to the floppy as such:
dd if=bootloader.bin bs=512 count=1 of/dev/fd0

We write kernel.sys to the floppy as such:
cp kernel.sys /dev/fd0

As I stated, this works in bochs. But booting from the floppy we get output like so:

Loading Kernel Shell
...........
ERROR : Press key to reboot

Other specifics: OpenSUSE 11.2, GNOME desktop, AMD x64 Any other information I may have missed, feel free to ask. I tried to get everything in here that would be needed. If I need to, I can find a way to get the entire bootloader.asm posted somewhere. We are not really interested in using GRUB either for several reasons. This could change, but we want to see this boot successful before we really consider GRUB.

EDIT: The bootstrap loader is suppose to be 512 bytes, written to the boot sector (very first sector) of the disk. Take my word for it, bootloader is 512 bytes compiled. The kernel is suppose to be in the very next sector.


Source: (StackOverflow)

Lib directory on 64-bit OpenSuse distribution

A project I'm working on uses a non-standard distribution system, which internally downloads and compiles the dependency libraries. This crock launches, for each library, the configure script giving as prefix an internal directory of the compiling system. Then it runs make and make install, then it verifies the content by searching the install directory with the lib/<mylib>.a file. This last step fails.

Trying to understand what's happening, I compiled a pair of random libraries by myself, including one I'm the author of. I noticed that under my distribution (openSUSE, 64 bit) the installing path is not populated with /lib, but with /lib64 instead.

It's clear that this is a setting of the distribution, and I'm pretty sure that this setting concerns a configuration of autotools shipped with the distro.

Is there a way of changing this behavior or, as an alternative, to read this information from the system (so that I can patch the above mentioned crock)?

Thanks for your help

Update: I learnt about the --libdir flag in configure, so I think I can solve my problem. Still I would like to know if there's a way of knowing this detail from somehow querying the distribution (e.g. read some configuration file).


Source: (StackOverflow)

Where is .bashrc or .bash_profile on OpenSuse linux?

I'm trying to install rvm, and it wants me to edit my .bashrc or .bash_profile files to include rvm... But I can't FIND these files anywhere. A quick google search shows that they might not exist until I make them (weird), but I can't see any reference to WHERE I should make them.

EDIT: Okay, it from one of the responses, it looks like I need to put them in my /home directory...and I can use ls -la to see if they are really there or not (they are not), but when I make the files, and put:

 [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

in them, as instructed by rvm, even when I make a new shell, I still can't type "rvm" and get anywhere.

Does that mean the files are in the wrong place, or that I made them wrong, or that the thing I put in them is wrong....I don't even know where to begin...

I made the files (as root), by typing "vi .bashrc" and vi ".bash_profile"... but when I look at them, the files seem to be named just "bashrc" and "bash_profile". SO, I did "mv bashrc .bashrc" and that seemed to do the trick AND hid them...but...I still can't type "rvm" in a new shell...

Edit: When I type

$HOME/.rvm/scripts/rvm

I got a "permission denied" error, even while root. So I went there, and the "rvm" file doesn't have executable permissions, for whatever reason... SO I set it to be executable. So now I don't get that error anymore...but I ALSO still can't run RVM, even in a new shell.

SOLUTION:

I was completely mis-understanding what "root of your home directory" meant, and was trying to put them in the directory named "home". INSTEAD, I was supposed to put them in the place where $HOME was pointing to. Now that the files are in the right place (and .bashrc at least already existed, so i just edited it), everything is working perfectly


Source: (StackOverflow)

Python 2.7 print() error

I have a strange error using sep, file, (etc.) arguments of python's print() function. I tried to google it out, dag around stackoverflow, and read python's documentation but I came up with nothing. I have attached a simple snippet, I would deeply appreciate any help.

# python
Python 2.7.2 (default, Aug 19 2011, 20:41:43) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print("blah"*10, sep=" | ")
  File "<stdin>", line 1
    print("blah"*10, sep=" | ")
                        ^
SyntaxError: invalid syntax

Source: (StackOverflow)

Java application throws `Gtk-WARNING **: cannot open display:` even when xserver is not required

I have a Java application that uses WebRenderer for a java headless browser. WebRenderer does not require xserver to run and I have confirmed this by uninstalling all x11 libs and xserver components.

However the problem is it throws an error: Gtk-WARNING **: cannot open display: in certain conditions. Upon research I found that it usually throws that error with systems that have openJDK installed. Also when the current java version is from Sun but openJDK is still installed. To fix it I would need to uninstall libatk-wrapper-java and libgtk2.0-0 (which also removes default-jre, cedtea-netx, libatk-wrapper-java-jni, libgtk2.0-bin, and openjdk-6-jre).

It also throws the same error in openSUSE (with Java from Sun). Would there be any way to fix this error without having to start up xserver or uninstalling a bunch of components that could be required for something else? Any help is appreciated.


Source: (StackOverflow)

Application crashes, but no core dump generated

I have an issue where my application keeps on dumping core after few day/weeks, but unfortunately, generates no core dump.

We tried to set ulimit -c unlimited with no success, so we incorporated setrlimit functionality in the code itself, but had no luck with that approach either. And, on top of that, we added MALLOC_CHECK_ too.

Interestingly, when we tried to initiate a manual core dump (using kill -ABRT <pid>), it did generate a core dump.

I could see the following message in /var/log/message

kernel: [2302077.396021] myapp[22140]: segfault at 54552e42 ip 00000000f773f36f sp 00000000fffdc48c error 4 in ld-2.11.3.so[f7727000+1f000]

Environment: sles11

Any suggestions on how to make the application generate core dumps more reliably?


Source: (StackOverflow)

Qt : Unable to load TTF file

I have a Qt-embedded application that I develop in OpenSuse 11.4 where I need to load a TTF font file. However when I call int QFontDatabase::addApplicationFont() function, it's returning -1.

Upon reading the documentation, I found out that adding application fonts on Unix/X11 platforms without fontconfig is currently not supported.

I checked through YaST whether I have fontconfig installed, and it is installed - but I don't think it's related coz I'm using a qt-embedded library. I'm thinking I gotta have fontconfig support qt-embedded library, but how do I do that?

Does fontconfig even support qt-embedded? Can anybody tell me what's going on?


Source: (StackOverflow)

How to define ESC char in git?

I want to use coloring in git output, e.g.:

git log --decorate --color

When I issue this command I get output looking like ESC[1;32m where ESC is in reversed color.
This looks to me as a valid escape sequence, except that the \033 must be sent and not the characters E, S and C.
When I issue an ls command, I get coloring of the files according to the rights. So nothing wrong with the capabilities.

Is there an environment variable that must be set to the value of the ESC char? Or am I looking in the wrong direction?
I am running openSUSE 11.1


Source: (StackOverflow)

Why is the system CPU time (% sy) high?

I am running a script that loads big files. I ran the same script in a single core OpenSuSe server and quad core PC. As expected in my PC it is much more faster than in the server. But, the script slows down the server and makes it impossible to do anything else.

My script is

for 100 iterations
Load saved data (about 10 mb)

time myscript (in PC)

real    0m52.564s
user    0m51.768s
sys    0m0.524s

time myscript (in server)

real    32m32.810s
user    4m37.677s
sys    12m51.524s

I wonder why "sys" is so high when i run the code in server. I used top command to check the memory and cpu usage.enter image description here It seems there is still free memory, so swapping is not the reason. % sy is so high, its probably the reason for the speed of server but I dont know what is causing % sy so high. The process that is using highest percent of CPU (99%) is "myscript". %wa is zero in the screenshot but sometimes it gets very high (50 %).

When the script is running, load average is greater than 1 but have never seen to be as high as 2.

I also checked my disc:

strt:~ # hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   16480 MB in  2.00 seconds = 8247.94 MB/sec
 Timing buffered disk reads:   20 MB in  3.44 seconds =   5.81 MB/sec

john@strt:~> df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       245G  102G  131G  44% /
udev            4.0G  152K  4.0G   1% /dev
tmpfs           4.0G   76K  4.0G   1% /dev/shm

I have checked these things but I am still not sure what is the real problem in my server and how to fix it. Can anyone identify a probable reason for the slowness? What could be the solution? Or is there anything else I should check?

Thanks!


Source: (StackOverflow)

Invalid JAVA_HOME when build with cordova

I am trying to emulate an app on my device with cordova in OpenSuse Leap 42.1.
But when I tried to emulate the app with the cordova run I get the error below:

cordova run
Running command: /home/soufraz/Projects/apps/myproject/platforms/android/cordova/run 
ERROR: Error: Failed to run "java -version", make sure that you have a JDK installed.
You can get it from: http://www.oracle.com/technetwork/java/javase/downloads.
Your JAVA_HOME is invalid: /usr/lib64/jvm/java-1.8.0-openjdk-1.8.0

ERROR running one or more of the platforms: Error: /home/soufraz/Projects/apps/myproject/platforms/android/cordova/run: Command failed with exit code 2
You may not have the required environment or OS to run this project

I have the java installed and the paths set in ~/.profile.
Which is the configuration error in my environment?

Below my .profile:

JAVA_HOME=/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0
export JAVA_HOME

ANDROID_HOME=/home/soufraz/Install/android-sdk-linux
export ANDROID_HOME

PATH=$PATH:$ANDROID_HOME:$JAVA_HOME

Info about java version:

java -version
openjdk version "1.8.0_60"
OpenJDK Runtime Environment (build 1.8.0_60-b27)
OpenJDK 64-Bit Server VM (build 25.60-b23, mixed mode)

And here the list of jvm folder:

ls -l
total 28
lrwxrwxrwx 1 root root 24 Nov 12 11:28 java-1.7.0-openjdk -> java-1.7.0-openjdk-1.7.0
drwxr-xr-x 1 root root  6 Nov 12 11:28 java-1.7.0-openjdk-1.7.0
drwxr-xr-x 1 root root  6 Nov 11 17:26 java-1.8.0-openjdk-1.8.0
lrwxrwxrwx 1 root root 21 Nov 11 17:26 jre -> /etc/alternatives/jre
lrwxrwxrwx 1 root root 27 Nov 12 11:28 jre-1.7.0 -> /etc/alternatives/jre_1.7.0
lrwxrwxrwx 1 root root 28 Nov 12 11:28 jre-1.7.0-openjdk -> java-1.7.0-openjdk-1.7.0/jre
lrwxrwxrwx 1 root root 27 Nov 11 17:26 jre-1.8.0 -> /etc/alternatives/jre_1.8.0
lrwxrwxrwx 1 root root 28 Nov 11 17:26 jre-1.8.0-openjdk -> java-1.8.0-openjdk-1.8.0/jre
lrwxrwxrwx 1 root root 29 Nov 11 17:26 jre-openjdk -> /etc/alternatives/jre_openjdk

[edit] View tree with three levels:

tree -L 3
.
├── java-1.7.0-openjdk -> java-1.7.0-openjdk-1.7.0
├── java-1.7.0-openjdk-1.7.0
│   └── jre
│       ├── bin
│       └── lib
├── java-1.8.0-openjdk-1.8.0
│   └── jre
│       ├── bin
│       └── lib
├── jre -> /etc/alternatives/jre
├── jre-1.7.0 -> /etc/alternatives/jre_1.7.0
├── jre-1.7.0-openjdk -> java-1.7.0-openjdk-1.7.0/jre
├── jre-1.8.0 -> /etc/alternatives/jre_1.8.0
├── jre-1.8.0-openjdk -> java-1.8.0-openjdk-1.8.0/jre
└── jre-openjdk -> /etc/alternatives/jre_openjdk

Source: (StackOverflow)