I installed omnet++ 5.0, set the PATH variable and it worked well. Then I needed to install omnet++ 4.2.1. So I added this folder to home, changed the variables PATH and OMNET_DIR from the omnetpp-5.0 (previously working fine omnet) to omnetpp-4.2 (the new one) in the bashrc file.
And do everything omnet++ related in that terminal. You can even open an other terminal with the other OMNeT++ version the same way and use both of them in parallel. (you should also start the IDE from the terminal using the omnetpp command)