IntelliJ switching between JBOSS_HOME - intellij-idea

Using intelliJ 15 Ultimate on MAC Yosemite.
I have two Jboss installation, jboss-eap-6.4 and wildfly-10.1.0.Final.
Depending on what project I am working on I need the "Run/Debug Configuration" to choose the correct JBOSS_HOME.
My bash_profile :
export JBOSS_HOME=/usr/local/jboss-eap-6.4
I also added convenience way to change in the terminal
alias setEAP='JBOSS_HOME=/usr/local/jboss-eap-6.4'
alias setWILDFLY='export JBOSS_HOME=/usr/local/wildfly-10.1.0.Final'
In Intellij I have :
Every time I run one of the Run/Debug it chooses the JBOSS_HOME set in bash_profile.
/usr/local/wildfly-10.1.0.Final/bin/standalone.sh
WARNING: JBOSS_HOME may be pointing to a different installation - unpredictable results may occur.
JBOSS_HOME: /usr/local/jboss-eap-6.4
I tried to create an External Tool where I export JBOSS_HOME, but this does not work. Anyway I can switch between JBOSS installation ? This could also be applicable to JAVA_HOME

You do not need to create scripts, just go to the Startup/Connection tab and add the value to the list of environment variables.

Related

Is there a way to fix the used Run/Debug configuration in IntelliJ?

I often switch between running/debugging tests locally in IntelliJ and using remote debugging my server. Therefore I have multiple run/debug configurations (the gradle ones were created automatically):
Whenever I execute a local test like PdfA...en.ttete this profile is selected by default in that combobox. But I want it to stay default on entry Remote...Debugging 5050 so that I can easily run this profile. Is there a fix?
Other solution would be to define a Hotkey for my favourite configuration. But I couldn't find it.

How to update JAVA_HOME for the entire system, not just my terminal?

When I swap my JAVA_HOME to point to another env and close terminal and open it back up, I can echo it and it shows the right path.
However some other applications (name IntelliJ IDEA) will hold the first JAVA_HOME until I log my user out. Simply quitting IntelliJ IDEA like terminal doesn't work.
Why is this? I'm curious where does someone like IntelliJ actually get my JAVA_HOME in case I have one set in my bash_profile and my config_fish for instance. How does intellij (and other programs) know where to look?
Not Sure about IntelliJ but in eclipse, you can set your environment in Window > preference > java > Installed JRE and add your path their
Okay, so there are such things as system env variables but in this case intellij wasn't pulling these from my system. Intellij instead knows how to look for your bash_profile among other configs (also zsh config and fish config)
See the source here: https://github.com/JetBrains/intellij-community/blob/master/plugins/terminal/resources/jediterm-bash.in

Where is JBOSS_HOME variable set for Intellij

So I'm trying to run JBoss server in Intellij, but there's a conflict between JBOSS_HOME path that Intellij reads from somewhere and the actual path to Jboss folder that is set in Run/Debug Configuration.
The Run/Debug Configuration Jboss path used to be the same as JBOSS_HOME, but it has changed, and it looks like JBOSS_HOME didn't get updated.
There is no environmental variable called JBOSS_HOME, so I guess Intellij stores it's own variables somewhere.
I've already checked File->Settings->Appearance & Behaviour->Path Variables
but there's no JBOSS_HOME variable set. I've tried restarting Intellij with no luck.
Any ideas guys?
Those are set individually per each application server defined, be it JBoss, Tomcat or something else. You can access and create/modify/remove them in 2 ways:
File -> Settings -> Build, Execution, Deployment -> Application servers
From the Run/Debug configuration window. From the dropdown list in your upper right corner where the run/debug buttons are, select Edit configurations..., select your JBoss run configuration from the tree on the left and click on the Config button (which will open a window pretty much identical to the one at point 1.)

IntelliJ 14 missing HOME env. variable

Whenever I start IntelliJ I see a notification balloon pointing out that I have an undeclared HOME variable. I can remove it but the same thing happens when I open IntelliJ again. I would like to fix it but I have no idea which HOME variable it is referring to.
The project is a Grails 2.4 project with a JDK7 on Windows 7.
Any suggestions?
Have you tried to set this enviroment variable in your windows system settings?
I think the name of this variable must be M2_HOME and must point to the path of your maven installation.
start -> right click on computer -> extended system settings -> enviroment
See also: http://maven.apache.org/download.cgi under section "Installation Instructions" and "Windows".

Can I commit and share VM options in IntelliJ?

To execute my application, or run or debug unit tests, I need to enable various VM options, include -javaagent:<aspectjweaver-path> or -Djava.library.path=<some native lib path>
I can see how to change these configurations manually in IntelliJ IDEA under "Edit Configurations..."
What, if anything, do I need to check in to my VCS to share these settings with other members of my team, and ensure they pick them up automatically whenever someone changes them in the VCS?
Alternatively is there a way to set these automatically in IntelliJ without even touching the edit configurations? Especially the aspectjweaver. When I build/test my project from the command line using maven this is all handled for me by specifying argLine arguments to the surefire plugin, but IntelliJ doesn't respect these settings. Perhaps there are alternative plugins that can help me out?
First, you need to share your run configuration. It's simply done by checking the Share box right to the configuration name in the run configuration dialog:
Your run configuration will then be saved to .idea/runConfiguration (or whatever your settings folder name is).
From Jetbrains Web Help:
If this check box is selected, the run/debug configurations become available to the other team members.
The shared run/debug configurations are kept in separate xml files under .idea\runConfigurations folder, while the local run/debug configurations are kept in the .idea\workspace.xml.
This field does not appear for the default run/debug configurations.