JAVA - environment variable not passing


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting JAVA - environment variable not passing
# 1  
Old 11-06-2007
JAVA - environment variable not passing

Here is part of my script:
export ERT
export CYE
export AYE
java -classpath ${CLASSPATH} -DCYE="${CYE}" -DAYE="${AYE}" -DERT="${ERT}" classname

I've verified in my script that all three variables have values.
Once the JAVA app runs it only has the ERT values. CYE and AYE come through as null. I've tried altering the script in everyway I can think of.
The JAVA gets the variables all in the same way (for example: system.getenv("CYE"))

Any idea what the problem is?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Setting up Java environment on VMware Solaris 10

Hello chings , Oracle Solaris OS Install (JDK) My host is win7 X64 and guest is solaris 10 X64 . My share file name is sharefile10 I unzip the file from host so I dont need type tar or gzip command through solaris . I have downloaded JDK from oracle offical website and the name : ... (4 Replies)
Discussion started by: SSUUser
4 Replies

2. Shell Programming and Scripting

How to pass the environment name while calling java program from unix script?

Hi, I'm trying to test one unix shell script in dev environment. But I'm not sure how to pass the environment in my java program calling code. I'm trying to use -DconsumerEnv="DEV" but unfortunately I get 'null' while trying to print the value from java class. System.out.println("Environment: "+... (4 Replies)
Discussion started by: Pramit
4 Replies

3. UNIX for Dummies Questions & Answers

No Java runtime environment (JRE) error

Hi all, I am trying to install a .bin file for that it requires IBMJava2-AMD64-142-JRE-1.4.2-13.8.x86_64.rpm to be installed. I have installed this rpm but when i try to install .bin file, it complains that no JRE found. How to solve this. Thanks in advance! #... (0 Replies)
Discussion started by: lramsb4u
0 Replies

4. Shell Programming and Scripting

Expand an environment variable in sed, when the variable contains a slash

I'm trying to make a sed substitution where the substitution pattern is an environment variable to be expanded, but the variable contains a "slash". sed -e 's/<HOME_DIRECTORY>/'$HOME'/'This gives me the following error: sed: -e expression #1, char 21: unknown option to `s'Obviously this is... (2 Replies)
Discussion started by: Ilja
2 Replies

5. Programming

Uncompress a gzip and bzip file using java on unix solaris environment

Hi, I need to uncompress a gzip and bzip file using java on unix solaris environment. I also need to retreive the header information of the file inorder to differentiate between gzip and bzip file. Please help Pooja (0 Replies)
Discussion started by: wadhwa.pooja
0 Replies

6. Programming

Binary not getting executed from Java on Solaris environment

In the Java programme, I am calling function, "Runtime.getRuntime().exec( cmdarray ); " with the array of arguments in which first argument is the binary(C-executable) file and argv1,argv2 and so on. This will be executed on Sun OS system.. I can execute using "sh -c cmdarray" on the shell... (0 Replies)
Discussion started by: shafi2all
0 Replies

7. UNIX for Dummies Questions & Answers

passing arguments from shell to java

Hi: I have a script called runjava: The content --- search=$1 dpi=$2 prefix=$3 input=$4 output=$5 java -Djava.library.path=./lib/path/Lib -classpath .:lib/path/Lib/mylib.jar myclass $search $dpi $prefix $input $output How does myclass parse arguments --- String searchTerm =... (3 Replies)
Discussion started by: kenpeter
3 Replies

8. Shell Programming and Scripting

Newbie Question: passing a variable into java from script?

I'm currently working on my second ever ksh script! So I apologize if this is a stupid question - I've searched the forum and on google and haven't seen anything :confused: I'm running my script with an input at startup that variable determines a couple of other values(int) that I store into... (1 Reply)
Discussion started by: Cailet
1 Replies

9. UNIX for Dummies Questions & Answers

Passing environment variables to parent shells

Hi, I am using bash and need to run a set of tcsh scripts that set environment variables. Is there a way to do this? Any help greatly appreciated. (3 Replies)
Discussion started by: konndanley
3 Replies

10. Post Here to Contact Site Administrators and Moderators

Java Programming in UNIX Environment

A suggetion: Don't we need to start Java Programming in UNIX Environment Forum ? (1 Reply)
Discussion started by: cub
1 Replies
Login or Register to Ask a Question
asadmin-unset(1AS)						   User Commands						asadmin-unset(1AS)

NAME
asadmin-unset, unset - removes one or more variables from the multimode environment SYNOPSIS
unset env_var [env_var]* Removes one or more variables you set for the multimode environment. The variables and their associated values will no longer exist in the environment. OPERANDS
env_var environment variable to be removed. Example 1: Using unset to remove environment variables asadmin> export AS_ADMIN_HOST=bluestar AS_ADMIN_PORT=8000 AS_ADMIN_USER=admin AS_ADMIN_PASSWORD=password asadmin> export AS_ADMIN_PREFIX=server1.jms-service asadmin> export AS_ADMIN_HOST=bluestar AS_ADMIN_PORT=8000 AS_ADMIN_USER=admin AS_ADMIN_PASSWORD=******** AS_ADMIN_PREFIX=server1.jms-service asadmin> unset AS_ADMIN_PREFIX asadmin> export AS_ADMIN_HOST=bluestar AS_ADMIN_PORT=8000 AS_ADMIN_USER=admin AS_ADMIN_PASSWORD=******** Using the export command without the argument lists the environment variables that are set. Notice the AS_ADMIN_PREFIX is not in the envi- ronment after running the unset command. EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-export(1AS), asadmin-multimode(1AS) J2EE 1.4 SDK March 2004 asadmin-unset(1AS)