I use openjdk for my work, but sometimes I need oracle's JRE. I thought that I could use 'env' command for this, but can't figure out why it's not working.
oracle's jdk in
when I'm running:
env JAVA_HOME=/usr/lib/jvm/jdk-8-oracle-x64 java -version
java version "1.7.0_75"
OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-3)
OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)
but if i try:
env JAVA_HOME=/usr/lib/jvm/jdk-8-oracle-x64 env|grep JAVA
I have 'feeling' that this is somehow related to process forking and inheritance. I know that i can simply use export name=variable command and etc. But would appreciate get explanation is it possible with 'env' command and how. Thank you! (I am using debian linux, unstable repo)