I have java oracle 7 installed. To build some library from the source code I do have to install openJDK 7. I don't know why they require but they do require it.
What's the safe way to install openJDK 7 when java oracle 7 is already installed?
openjdk-7-jdk is a installable package. There is no problem with a parallel installation.
sudo apt-get install openjdk-7-jdk
And maybe you should install Oracle Java via PPA:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer