I want to set environment using shell scrip in Ubuntu 10.04 and want to access in java program. I have wrote shell script like this:
#! /bin/sh export JAVA=
What are you trying to do exactly?
Running JAVA=/home/ubuntu java SystemEnv works fine (i.e. it outputs "/home/ubuntu")
JAVA=/home/ubuntu java SystemEnv
If you want to export environment variables to the parent process, you have to source it:
source ./myscript.sh . ./myscript.sh # Alternative form