Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use Maven without setting the Environment variable?

I want to use Maven for my project.

In my office computer , I don't have the Admin privilege . Hence I am not able to set the "System Variable". I have access only to "User Variable" where I can set only the Java_Home.

Can I use Maven without adding the M2_Home and editing the Path variable ?

like image 639
Kannan C Avatar asked Jan 22 '26 05:01

Kannan C


2 Answers

It depends if you are using it inside an ide or building project from terminal.

  • If you are using an IDE, there is probably an embedded maven ( there is one inside Eclipse and Intellij IDEA)
  • If you are building using CLI you can invoke maven using the full path for instance :

    /home/<your_folder>/tools/apache-maven-3.5.0/bin/mvn clean install from your project path

like image 148
Haythem ROUIS Avatar answered Jan 25 '26 00:01

Haythem ROUIS


You could set the M2_HOME user variable even you are not an administrator, and the variable path is unnecessary, you could easily do the same task referencing the maven fullpath bin directory.

like image 24
fdam Avatar answered Jan 25 '26 01:01

fdam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!