Is there a predifined Path Variable for the project or module JDK?

I have a project that needs access to JDK_HOME/lib/jconsole.jar in it's library definition. Every time I upgrade the JDK on my machine, I need to update IntelliJ to understand that 1.6 refers to a path in the file system. I also have to update my project to point to the new JDK.

The use of Path Variables would seem to be the solution here. I am unable to find any reference to how to do this or indication if it is even possible.

What I would like to see stored in the project file (.ipr) is something like the following:

<library name="jconsole">
      <CLASSES>
               <root url="jar://$PROJECT_JDK$/lib/jconsole.jar!/" />
      </CLASSES>
      <JAVADOC />
      <SOURCES />
</library>

Is there a project or module path variable definition that I have missed?

I am using 8.1

Thanks

2 comments
Comment actions Permalink

Hello Michael,

There is no such predefined variable. You can define your own path variable
for this.

I have a project that needs access to JDK_HOME/lib/jconsole.jar in
it's library definition. Every time I upgrade the JDK on my machine, I
need to update IntelliJ to understand that 1.6 refers to a path in the
file system. I also have to update my project to point to the new JDK.

The use of Path Variables would seem to be the solution here. I am
unable to find any reference to how to do this or indication if it is
even possible.

What I would like to see stored in the project file (.ipr) is
something like the following:

<library name="jconsole">
<CLASSES>
<root url="jar://$PROJECT_JDK$/lib/jconsole.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
Is there a project or module path variable definition that I have
missed?

I am using 8.1

Thanks

---
Original message URL:
http://www.jetbrains.net/devnet/message/5232592#5232592

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

I understand that I can create a path variable, the question is how do I bind the value of the path variable to the value of the currently selected JDK? The goal is to define my JDK settings in one and only one place and have the configuration work without need for additional modification.

I see that there is a XML definition in the project file indicating some things about the JDK.


  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK" />

What I would like is a variable the was bound to the location referred to in the above declaration in my project file.

0

Please sign in to leave a comment.