В Windows кликните правой кнопкой мыши на "мой компьютер" ->свойства->дополнительные параметры->переменные среды->системные переменные и там добавьте "M2_HOME" и "C:\Program Files\maven\" .
В Linux можно добавить строку "export M2_HOME=/opt/maven"в файл /etc/profile .
mvn -version
JAVA
- The variables defined under System variables are available across all the users of the system, and those defined under User variables for sanaulla are available only to the user, sanaulla.
- Click on New under User variables for <your username> to add a new variable, with the name JAVA_HOME, and its value as the location of the JDK 9 installation. For example, it would be C:/Program Files/Java/jdk-9 (for 64 bit) or C:/Program Files (x86)/Java/jdk-9 (for 32 bit):
- The next step is to update the PATH environment variable with the location of the bin directory of your JDK installation (defined in the JAVA_HOME environment variable). If you already see the PATH variable defined in the list, then you need to select that variable and click on Edit. If the PATH variable is not seen, then click on New.
- Any of the actions in the previous step will give you a popup, as shown in the following screenshot (on Windows 10):
- You can either click on New in the first picture and insert the value, %JAVA_HOME%/bin, or you can append the value against the Variable value field by adding ; %JAVA_HOME%/bin. The semicolon (;) in Windows is used to separate multiple values for a given variable name.
- After setting the values, open the command prompt and then run javac -version, and you should be able to see javac 9-ea as the output. If you don't see it, then it means that the bin directory of your JDK installation has not been correctly added to the PATH variable.
Комментариев нет:
Отправить комментарий