Sponsored Content
Top Forums Shell Programming and Scripting How to pass the environment name while calling java program from unix script? Post 302588824 by Pramit on Tuesday 10th of January 2012 04:05:52 AM
Old 01-10-2012
MySQL 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: "+ System.getProperty("consumerEnv"));

This is the code I'm using to call the java program from my unix script:
Code:
java -Xms64m -Xmx256m -Djava.library.path=$MY_CLASSPATH -cp $MY_CLASSPATH <<class-name>> -DconsumerEnv=$consumerEnv

I have verified that the value of $consumerEnv is coming as DEV.

Can anyone please help?
Thanks in advance.


Moderator's Comments:
Mod Comment Please use code tags!

Last edited by zaxxon; 01-10-2012 at 05:12 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Java program calling a UNIX command

I was wondering if it was possible to call a unix command directly from a Java program during run-time. This command could very very basic e.g. "ps -ef" returned as a string, all I need is a starting place so if anyone has any suggestion or examples I would be very grateful (2 Replies)
Discussion started by: QUartz Ite
2 Replies

2. 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

3. Shell Programming and Scripting

pass parameter back to calling program

Hi all, I am running AIX version 4. I have a shell script that is calling another script. I want the called script to obtain a value and pass it back to the calling script. So far, I know that to pass a parameter to a called script is as such: sh proc2.sh $1 $2 etc. What I don't know how... (11 Replies)
Discussion started by: jthomas
11 Replies

4. UNIX for Dummies Questions & Answers

calling a script from java

HI I need to build a GUI where a button could execute a script in Solaris 8. I am working with Sun ONE Studio 7 Enterprice Edition. Thanks (1 Reply)
Discussion started by: javierelizabeth
1 Replies

5. Shell Programming and Scripting

Calling Java Method from UNIX using shell script

Hi All, I need to call a java method from a shell script. I know we can use the command java ClassName to call the main method in it. But I need to call another method that is there in the class and pass an email to it. Can I use java ClassName.MethodName(email) Any help will be... (4 Replies)
Discussion started by: RahulK
4 Replies

6. Shell Programming and Scripting

Call java program from shell and pass values

Hi All, Can anybody please help me with how can i call my java program from shell and also pass parameter along with it so that the program can interpret the value/int and update the database. Thanks in advance Neha (1 Reply)
Discussion started by: Neha Goyal
1 Replies

7. Shell Programming and Scripting

how to execute a unix shell script from a java program

Hi All, well , i am facing this problem.. i have tried a few sample codes but there isn't any solution . could anyone please give a sample code as of how to do this... Please see the below details...and read the details carefully. I have written some code, logic is 1)from... (4 Replies)
Discussion started by: aish11
4 Replies

8. Shell Programming and Scripting

How we can pass the argument when calling shell script from perl script

Can someone let me know how could I achieve this In one of per script I am calling the shell script but I need to so one thing that is one shell script call I need to pass pne argument.In below code I am calling my ftp script but here I want to pass one argument so how could I do this (e.g:... (5 Replies)
Discussion started by: anuragpgtgerman
5 Replies

9. Shell Programming and Scripting

Triggering UNIX Script from a JAVA program

Hi I am trying to implement one program, where JAVA needs to trigger the backend UNIX script. Tried with options like String cmdArray = {"/bin/ksh","-c","/SCRIPT_ABSOLUTE_PATH/sampleScript.ksh /FILE_ABSOLUTE_PATH Test_File.dat TEST E SFTP"} When I trigger the script from front end with... (1 Reply)
Discussion started by: karumudi7
1 Replies

10. UNIX for Beginners Questions & Answers

Pass RegEx to java program in bash script

I can't seem to get this right. I've tried it every way imaginable using every trick I see on stackexchange and such. No luck. So nothing major here, something like: #!/bin/bash SEARCH="ARG1 ARG2 '((^EXACT$)|(.*InTheMiddle*)|(^AtBeginning*))'" java -cp /my/class/path MyClassName $SEARCH... (3 Replies)
Discussion started by: stonkers
3 Replies
OCF_HEARTBEAT_EDIR88(7) 					OCF resource agents					   OCF_HEARTBEAT_EDIR88(7)

NAME
ocf_heartbeat_eDir88 - Manages a Novell eDirectory directory server SYNOPSIS
eDir88 [start | stop | monitor | meta-data | validate-all] DESCRIPTION
Resource script for managing an eDirectory instance. Manages a single instance of eDirectory as an HA resource. The "multiple instances" feature or eDirectory has been added in version 8.8. This script will not work for any version of eDirectory prior to 8.8. This RA can be used to load multiple eDirectory instances on the same host. It is very strongly recommended to put eDir configuration files (as per the eDir_config_file parameter) on local storage on each node. This is necessary for this RA to be able to handle situations where the shared storage has become unavailable. If the eDir configuration file is not available, this RA will fail, and heartbeat will be unable to manage the resource. Side effects include STONITH actions, unmanageable resources, etc... Setting a high action timeout value is _very_ _strongly_ recommended. eDir with IDM can take in excess of 10 minutes to start. If heartbeat times out before eDir has had a chance to start properly, mayhem _WILL ENSUE_. The LDAP module seems to be one of the very last to start. So this script will take even longer to start on installations with IDM and LDAP if the monitoring of IDM and/or LDAP is enabled, as the start command will wait for IDM and LDAP to be available. SUPPORTED PARAMETERS
eDir_config_file Path to configuration file for eDirectory instance. (optional, string, default /etc/opt/novell/eDirectory/conf/nds.conf) eDir_monitor_ldap Should we monitor if LDAP is running for the eDirectory instance? (optional, boolean, default 0) eDir_monitor_idm Should we monitor if IDM is running for the eDirectory instance? (optional, boolean, default 0) eDir_jvm_initial_heap Value for the DHOST_INITIAL_HEAP java environment variable. If unset, java defaults will be used. (optional, integer, no default) eDir_jvm_max_heap Value for the DHOST_MAX_HEAP java environment variable. If unset, java defaults will be used. (optional, integer, no default) eDir_jvm_options Value for the DHOST_OPTIONS java environment variable. If unset, original values will be used. (optional, string, no default) SUPPORTED ACTIONS
This resource agent supports the following actions (operations): start Starts the resource. Suggested minimum timeout: 600. stop Stops the resource. Suggested minimum timeout: 600. monitor Performs a detailed status check. Suggested minimum timeout: 60. Suggested interval: 30. meta-data Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5. validate-all Performs a validation of the resource configuration. Suggested minimum timeout: 5. EXAMPLE
The following is an example configuration for a eDir88 resource using the crm(8) shell: primitive example_eDir88 ocf:heartbeat:eDir88 op monitor timeout="60" interval="30" SEE ALSO
http://www.linux-ha.org/wiki/eDir88_(resource_agent) AUTHOR
Linux-HA contributors (see the resource agent source for information about individual authors) resource-agents 1.0.3 07/05/2010 OCF_HEARTBEAT_EDIR88(7)
All times are GMT -4. The time now is 01:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy