Sharing Global Libraries

We have a team of developers using Eclipse and I am trying to convince them to switch to IntelliJ. They have pretty easy time getting a new person up and running using Eclipses user libraries. They simply SVN checkout and then impot a user library. I have my .ipr and .iml files in SVN, but it is still not trival to get up and running. The two main issues are specifying the JDK and the global libraries. I have been searching posts on how to share settings and found a few, but they all say just commit your .ipr and .iml and then use Path Variables to remove hard coded paths. However, I don't see any hard coded paths in my .ipr or .iml files (attached). The global libraries are only listed as "tags" in the .iml file (e.g. <orderEntry type="library" name="Java3d" level="application" />) which does not specify the location (hard coded or otherwise). When these get loaded, it takes a long time for a new person to go and add the locations of the global libraries, which are the same relative path from SVN_ROOT on all machines. There has to be a better solution that I am missing.

I am using IntelliJ 12.1 on Windows 7 (though other coworkers will be using Linux and OSX)



Attachment(s):
MAV.ipr.zip
MAV.iml.zip
7 comments

Hi Matthew,

Application libraries are configured at $IDEA_CONFIG_HOME/options/applicationLibraries.xml, so, you can just copy that file to a new machine. $IDEA_CONFIG_HOME might be overridden at $IDEA_HOME/bin/idea.properties, here is the information about default values - http://devnet.jetbrains.com/docs/DOC-181

Another approach is to export target settings (main menu | file | export settings) - a single *.jar file and then import it at new environment (main menu | file | import settings). Note that the ide allow to choose what settings should be exported and, as the exported file is just a *.jar with $IDEA_CONFIG_HOME content, you can manually unpack it and perform fine-tuning if necessary.

Denis

0

Thanks, that looks like what I needed. I exported my setting into the attached file. In the file I just exported global libraries. In the applicationLibraries.xml, I can see the paths as I would hope. It turned my absolute paths into relative paths and replaced them with $SVN_ROOTS. For example, <root url="file://$SVN_ROOT$/RobotControl/ThirdParty/ThirdPartyJars/Java3d" />. My coworker can load these settings, but they are not recognized. We then set a path variable called SVN_ROOT, but his system still does not recognize the paths. The path does contain the required directory struture and code (e.g. RobotControl/ThirdParty/ThirdPartyJars/Java3d), so we are  bit confused. How do we get the importing system to recognize the global libraries?

Thanks again,
Matt



Attachment(s):
settings.jar
0

You need to configure that path at the ide path variables.

Denis

0

I believe we are setting the path variable, though maybe we are doing it incorrectly.

The settings.jar contains relative paths with $SVN_ROOT$. For example, <root  url="file://$SVN_ROOT$/RobotControl/ThirdParty/ThirdPartyJars/Java3d"  />. Then in Intelli, we go to File > Settings > Path Variable and add:

SVN_ROOT

C:\VCS



Where C:\VCS is the absolute path of the location of SVN_ROOT. However, this does not seem to be recognized, meaning that File > Project Structure > Global Libraries lists all the libraries such as:
Java3d      $SVN_ROOT$/RobotControl/ThirdParty/ThirdPartyJars/Java3d

But they are all underlined in red indicating it does find these files. When we define the path variable, does it need the dollar signs ("$SVN_ROOT$") or have we defined it correctly above?

Also, My system is Windows 7 and my coworker is Mac OSX. Should this matter?


Thanks for your assistance again,
Matt

0

Try to restart the ide after path variables setup

Denis

0

Ahh...the restart trick.That did it.

Thanks,

Matt

0

Please sign in to leave a comment.