Opening a UNIX shell in Java

Hi,
I need to simulate the machine's native shell (sh), for that I open up a UNIX shell in my Java program.
My code works fine with windows shell ('cmd') but with unix ('sh') I failed to retrieve the machine's prompt.
I believe that the issue is unix-related and that the process I launched has no appropriate environment parameter, so i need the expert's opinion on that :).

These are the environment's variables as printed by the user:

# set
HOME=/
HZ=100
IFS=

LC_COLLATE=en_US.ISO8859-1
LC_CTYPE=en_US.ISO8859-1
LC_MESSAGES=C
LC_MONETARY=en_US.ISO8859-1
LC_NUMERIC=en_US.ISO8859-1
LC_TIME=en_US.ISO8859-1
LOGNAME=root
MAIL=/var/mail/root
MAILCHECK=600
OPTIND=1
PATH=/usr/sbin:/usr/bin
PS1=#
PS2=>
SHELL=/sbin/sh
TERM=ansi
TZ=Israel
_INIT_NET_STRATEGY=none
_INIT_PREV_LEVEL=S
_INIT_RUN_LEVEL=3
_INIT_RUN_NPREV=0
_INIT_UTS_ISA=sparc
_INIT_UTS_MACHINE=sun4u
_INIT_UTS_NODENAME=DEVSSSUN01
_INIT_UTS_PLATFORM=SUNW,Ultra-5_10
_INIT_UTS_RELEASE=5.8
_INIT_UTS_SYSNAME=SunOS
_INIT_UTS_VERSION=Generic_108528-13

The following are the environment's variables as printed by my java app:

_INIT_UTS_VERSION:Generic_108528-13
XFILESEARCHPATH:/usr/dt/app-defaults/%L/Dt
HZ:100
LC_CTYPE:en_US.ISO8859-1
NLSPATH:/usr/dt/lib/nls/msg/%L/%N.cat
LC_COLLATE:en_US.ISO8859-1
HOME:/
_INIT_UTS_ISA:sparc
_INIT_RUN_LEVEL:3
_INIT_UTS_RELEASE:5.8
LC_NUMERIC:en_US.ISO8859-1
LD_LIBRARY_PATH:/usr/java1.5/jre1.5.0_09/lib/sparc/client:/usr/java1.5/jre1.5.0_
09/lib/sparc:/usr/java1.5/jre1.5.0_09/../lib/sparc
SHELL:/sbin/sh
LOGNAME:root
_INIT_UTS_MACHINE:sun4u
_INIT_PREV_LEVEL:S
_INIT_UTS_NODENAME:DEVSSSUN01
LC_MONETARY:en_US.ISO8859-1
_INIT_RUN_NPREV:0
MAIL:/var/mail/root
TZ:Israel
LC_TIME:en_US.ISO8859-1
_INIT_UTS_PLATFORM:SUNW,Ultra-5_10
_INIT_NET_STRATEGY:none
LC_MESSAGES:C
_INIT_UTS_SYSNAME:SunOS
TERM:ansi
PATH:/usr/sbin:/usr/bin

And these are the environment's variables as printed by the user in the shell that was launched by the java app:

HOME=/
HZ=100
IFS=

LC_COLLATE=en_US.ISO8859-1
LC_CTYPE=en_US.ISO8859-1
LC_MESSAGES=C
LC_MONETARY=en_US.ISO8859-1
LC_NUMERIC=en_US.ISO8859-1
LC_TIME=en_US.ISO8859-1
LD_LIBRARY_PATH=/usr/java1.5/jre1.5.0_09/lib/sparc/client:/usr/java1.5/jre1.5.0_
09/lib/sparc:/usr/java1.5/jre1.5.0_09/../lib/sparc
LOGNAME=root
MAIL=/var/mail/root
MAILCHECK=600
NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat
OPTIND=1
PATH=/usr/sbin:/usr/bin
SHELL=/sbin/sh
TERM=ansi
TZ=Israel
XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt
_INIT_NET_STRATEGY=none
_INIT_PREV_LEVEL=S
_INIT_RUN_LEVEL=3
_INIT_RUN_NPREV=0
_INIT_UTS_ISA=sparc
_INIT_UTS_MACHINE=sun4u
_INIT_UTS_NODENAME=DEVSSSUN01
_INIT_UTS_PLATFORM=SUNW,Ultra-5_10
_INIT_UTS_RELEASE=5.8
_INIT_UTS_SYSNAME=SunOS
_INIT_UTS_VERSION=Generic_108528-13

Note that there is no prompt's variable (SP1) for the java app and\or the process that was launched by it.

Any idea?
Thanks in advance.
Guy

Most likely the shell has determined that it is not connected to a terminal, and hence is "non-interactive", so it does not print the prompts.

Can I change the shell's "non-interactive" mode to an "interactive"? Can I "trick" him, or this is it and there is nothing to do? although I believe that it should be a solution.

Thanks