1

I'm trying to install Groovy via Puppet on SUSE SLES 11 SP2. I have the Groovy files installed, but now I need to set the environment variables. I'm using a shell script to set the values and when I echo the values, they are correct.

echo $JAVA_HOME
/myapplication/mypath/jdk1.6.0_30

When I run the command "groovy -version" I get this error: /bin/javaAVA_HOME is not defined correctly, can not execute: /myapplication/mypath/jdk1.6.0_30.
That's not a typo, that's actually the output I get! :)

This is the correct path to my java installation. Why is "/bin/java" replacing the "J" in "JAVA_HOME"? I searched /bin and /usr/bin and neither directory has a java directory.

If I set the values from the command line on the server, everything works fine.

Here is my shell script:

# groovy.sh
export JAVA_HOME=/myapplication/mypath/jdk1.6.0_30
export GROOVY_HOME=/myapplication/mypath/groovy-2.0.7
export PATH=$PATH:/myapplication/mypath/groovy-2.0.7/bin

Here is the snippet from my puppet module:

$groovy_sh = "/etc/profile.d/groovy.sh"

file { $groovy_sh:
ensure => present,
source => "puppet:///modules/groovy/groovy.sh",
owner => "myuser",
group => "mygroup",
mode => 777,
}
1
  • This turned out to be a Windows/Unix linefeed issue. I inluded the dos2unix package in my module and everything started working as expected.
    – kydiwl
    Aug 10, 2013 at 23:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.