Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bash: export: `-Xmx512m': not a valid identifier when I set MAVEN_OPTS variable

I'm on OpenSuse, I'm following this tutorial to set up Maven.

When I ran this :

export MAVEN_OPTS=-Xms256m -Xmx512m

I got the following error:

bash: export: `-Xmx512m': not a valid identifier

I've followed that tutorial's steps, the Maven I downloaded is Version 3.5.2.

like image 828
Ouissal Benameur Avatar asked Nov 24 '17 11:11

Ouissal Benameur


2 Answers

The space in between both options makes the shell interpret this as two different arguments. You need to protect the options with quotes:

export MAVEN_OPTS="-Xms256m -Xmx512m"
like image 119
Mureinik Avatar answered Sep 21 '22 19:09

Mureinik


You need quotes around the value, as it contains a space.

export MAVEN_OPTS="-Xms256m -Xmx512m"
like image 30
Tim Avatar answered Sep 21 '22 19:09

Tim