6 comments
Comment actions Permalink

This is all handled in the idea.sh launcher script which is in the bin/ subdirectory of the IDEA install directory. If you look there you'll see the first thing it does is find a JDK to use to run IDEA itself. If you tell it by setting (and exporting) IDEA_JDK it will use that. If you don't set it (or JAVA_HOME) it will try to locate "java" in the execution path (the PATH environment variable) and if there's one there, it will use that, after verifying it's a JDK and not just a JRE.

That's what you have to work with.


Randall Schulz

0
Comment actions Permalink

I tried changing

    JAVA_BIN_PATH=`which java`
to
    JAVA_BIN_PATH="~/java/" (this is where I installed Java)



Now get


dirname: missing operand

Changed " to ` and now get permission denied on the java folder

0
Comment actions Permalink

JAVA_BIN_PATH is used internally. You should not set it. Furthermore, unless you export the variables in question, they won't be seen by the IDEA launcher script.

There's a big difference between back-ticks and double quotes. The former runs wha's enclosed within them and substitutes the command's output where the back-ticked expression appeared. The latter just quotes some otherwise special characters (spaces and glob pattern characters, e.g., but not variable references).

If you can run "java -version" (e.g.) and get an answer (not a "java: command not found" diagnostic), then Java is intalled. However, there must also be a "javac" command (that is, you're specifying a JDK, not just a JRE).

So again, set and export JAVA_HOME or IDEA_JDK to the base directory of the JDK isntallation you want IDEA to use. And to be clear, the directory you give should have the bin/ directory (where, e.g., the java, javac and many other commands are found) as the immediate subdirectory of the directory you give. Don't give the bin/ directory as the value of JAVA_HOME or IDEA_JDK.


Randall Schulz

0
Comment actions Permalink

"So again, set and export JAVA_HOME or IDEA_JDK to the base directory of the JDK isntallation you want IDEA to use. And to be clear, the directory you give should have the bin/ directory (where, e.g., the java, javac and many other commands are found) as the immediate subdirectory of the directory you give. Don't give the bin/directory as the value of JAVA_HOME or IDEA_JDK."

Would you tell me how to do this? There are no comments in the idea.sh file to indicate changing anything in there.

Just (Line 72):


IDEA_HOME=`dirname "$SCRIPT_LOCATION"`/..
IDEA_BIN_HOME=`dirname "$SCRIPT_LOCATION"`


Do you change these entries?
0
Comment actions Permalink

I'm talking about setting environment variables from outside the IDEA launcher script.

% export JAVA_HOME=/usr/lib/jvm/java-1.6.0-sun-1.6.0
% .../idea.sh


If you're launching from a desktop icon, edit the icon's properties, find the command string and add "JAVA_HOME=/usr/lib/jvm/java-1.6.0-sun-1.6.0 " before whatever command is there now (you don't use the "export" command in that case).

(And, of course, find the real location of the installed JDK on your system. The strings I gave reflect my old, openSUSE 11.1 installation, now used only for web surfing and email.)


Randall Schulz

0
Comment actions Permalink

Hi Jay,

You may find this thread useful.

Denis

0

Please sign in to leave a comment.