If you're using Ubuntu the recommended place to put user environment
variables is ~/.pam_environment -
https://help.ubuntu.com/community/EnvironmentVariables
Probably your integration tests are spawned using another shell than bash.
Can you try to put JAVA_HOME into ~/.pam_environment like below,
JAVA_HOME DEFAULT=/home/chamara/Programs/Java1.6/jdk1.6.0_45
PATH DEFAULT=${JAVA_HOME}/bin:${PATH}
-Chintana
On Wed, Nov 6, 2013 at 12:50 AM, Chamara Ariyarathne <[email protected]>wrote:
> I have set JAVA_HOME in my machine as following in the ~/.bashrc
>
> export JAVA_HOME=/home/chamara/Programs/Java1.6/jdk1.6.0_45
> export PATH=$PATH:$JAVA_HOME/bin
>
> And variables set in the machine are;
>
> $ echo $JAVA_HOME
> /home/chamara/Programs/Java1.6/jdk1.6.0_45
>
> $ echo $PATH
>
> /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/chamara/Programs/Java1.6/jdk1.6.0_45/bin
>
> In the ESB_HOME/bin/wso2server.sh when the following configuration is
> present
>
> echo $JAVA_HOME
> if [ -z "$JAVACMD" ] ; then
> if [ -n "$JAVA_HOME" ] ; then
> if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
> # IBM's JDK on AIX uses strange locations for the executables
> JAVACMD="$JAVA_HOME/jre/sh/java"
> else
> JAVACMD="$JAVA_HOME/bin/java" ; LINE 117
> fi
> else
> JAVACMD=java
> fi
> fi
>
> if [ ! -x "$JAVACMD" ] ; then
> echo "Error: JAVA_HOME is not defined correctly."
> echo " CARBON cannot execute $JAVACMD"
> exit 1
> fi
>
> I can start the esb server without any error. But when I try to run
> integration tests the following error comes
>
> [2013-11-06 05:40:44,488] INFO
> {org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
> /home/chamara/Programs/Java1.6/jdk1.6.0_45/bin/java
> [2013-11-06 05:40:44,490] INFO
> {org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
> Error: JAVA_HOME is not defined correctly.
> [2013-11-06 05:40:44,490] INFO
> {org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
> CARBON cannot execute
> /home/chamara/Programs/Java1.6/jdk1.6.0_45/bin/java/bin/java
>
> But if I modify the wso2server.sh as following; in the line 117;
>
> JAVACMD="$JAVA_HOME"
>
> Then I can run the integration tests.
>
> What is the problem here? Is it due to some wrong java related
> configuration in my machine?
>
> --
> *Chamara Ariyarathne*
> Senior Software Engineer - QA;
> WSO2 Inc; http://www.wso2.com/.
> Mobile; *+94772786766 <%2B94772786766>*
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
--
Chintana Wilamuna
Architect - Solution Architecture
WSO2, Inc.; http://wso2.com
lean.enterprise.middleware
phone: +94 72 145 4545
blog: http://engwar.com/
photos: http://flickr.com/photos/chintana
linkedin: http://www.linkedin.com/in/engwar
twitter: twitter.com/std_err
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev