Search code examples
macosapache-axissoapuiwsdl2javajava-home

Axis 2 can't see JAVA_HOME on my Mac (soapUI and wsdl2java)


Question : Why can Axis 2 not see where Java home is? Have I set it incorrectly?

Summary : I'm attempting to use Axis 2 with soapUI to generate Java objects from a wsdl on my Mac. However, I get the error "You must set the JAVA_HOME variable before running Axis2 Script."

If I type echo $JAVA_HOME into the command line, it says

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

I've navigated to the JavaVirtualMachines folder and the jdk is indeed there.

I also have edited ~/.bash_profile to say

export JAVA_HOME=$(/usr/libexec/java_home)


Solution

  • Are you launching SoapUI by clicking on an icon? In that case, SoapUI wouldn't necessarily have access to environment variables set in your bash startup scripts.

    Take a look at this question and this one about setting environment variables so that they're accessible to GUI apps. Basically, you may have to modify some system-wide configuration files.