Skip to content

Instantly share code, notes, and snippets.

@TomNussbaumer TomNussbaumer/idea14fix.md
Last active Sep 12, 2015

Embed
What would you like to do?
IDEA 14 Community Edition: quick fix for vmoptions containing spaces

Normally vm options stored in idea.vmoptions and idea64.vmoptions contain no spaces. But whenever you need to set an option which contains one, the idea.sh will fail.

A common use-case for a vm option containing a space is the following line:

-Duser.name=Tom\ Nussbaumer

This will override the user name used in all templates with the given one. To get IDEA working with such a setting you have to edit file idea.sh.

At the very end of the script there is the following block:

LD_LIBRARY_PATH="$IDE_BIN_HOME:$LD_LIBRARY_PATH" "$JDK/bin/java" \
....
$VM_OPTIONS "-Djb.vmOptionsFile=$VM_OPTIONS_FILES_USED" \
....

Prefix this block with eval and quote the $VM_OPTIONS variable like this:

eval LD_LIBRARY_PATH="$IDE_BIN_HOME:$LD_LIBRARY_PATH" "$JDK/bin/java" \
....
"$VM_OPTIONS" "-Djb.vmOptionsFile=$VM_OPTIONS_FILES_USED" \
....

Done.

BTW, you don't have to modify the global vmoptions files. You can to it in IDEAs local configuration directory. For IDEA 14 community edition this directory is located at $HOME/.IdeaIC14/config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.