I've got maven broken (everything worked before) when I write:

export JAVA_HOME = / Library / Java / JavaVirtualMachines / jdk1.8.0_101.jdk / Contents / Home

It works and when I restart the terminal again writes:

Exception in thread "java.lang.UnsupportedClassVersionError: org / apache / maven / cli / MavenCli: Unsupported major.minor version 51.0at java.lang.ClassLoader.defineClass1 (Native Method)

Which team on the Mac will set this value permanently?

    1 answer 1

    The export command sets the environment variables only for the current session. To permanently add the file .bash_profile

    It usually lies in the $HOME directory $HOME

     ls -a $HOME/ | grep .bash .bash_history .bash_profile .bash_sessions 

    If not, simply create an empty file with the touch command.

     cd $HOME touch .bash_profile 

    And add the environment variables you need to it, for example:

     export BOOST_ROOT=/Users/Vladimir/Downloads/boost_1_61_0 export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home 

    In order for the changes to take effect, immediately execute the source command or restart the terminal

     source $HOME/.bash_profile echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home 
    • one
      Thank! It helped ... - Pavel