Friday, April 08, 2016

How to force java path in subscript (nested script call)

If you use a script that runs another script which starts a java virtual machine, you should need to specify which java command you want to use from the first script. Consider the following example :

startup.sh  --->  application.sh --> java command

I can modify startup.sh but not application.sh which calls java command. But I need a specify version a java.

So, I tried to solve this problem with :

  • linux 'source' command ... BAD!!!
  • linux 'alias' command... BAD!!!
But, I finally got a working solution by redefining a  'java' function before calling application.sh. GOT IT! When application.sh calls 'java', it invokes my function. Like this :


java() {
    /specificpath/jdk/bin/java "$@"
}
export -f java
sh ./application.sh


Enjoy!

15 comments:

simashree said...

Thanks for the great information in your blog Selenium Training in Chennai

seoindiarank chennai said...

Very nice post here thanks for it .I always like and such a super contents of these
post.Excellent and very cool idea and great content of different kinds of the valuable
information's. seo company in chennai

Webtrackker Noida said...

Webtrackker technology is the best IT training institute in NCR. Webtrackker provide training on all latest technology such as java training. Webtrackker is not only training institute but also it also provide best IT solution to his client. Webtrackker provide training by experienced and working in the industry on same technology.Webtrackker Technology C-67 Sector-63 Noida 8802820025

Java Training institute in indirapuram


Java training institute in Noida


Java training institute in Ghaziabad


java training institute in Vaishali


Java Training institute in Vasundhara


Java Training institute in Delhi South Ex

Sujit kUmar said...

nice post for sharing Java article. its really helpful for me. keep shring on updated tutorials????????????????

Ancy merina said...

I like your post, really interesting facts and information
Top web development services in bangalore
ECommerce Website developers in bangalore
Outsource magento ecommerce services india

Richard Swayar said...

Australia Best Tutor is one of the best Online Assignment Help providers at an affordable price. Here All Learners or Students are getting best quality assignment help with reference and styles formatting.

Visit us for more Information

Australia Best Tutor
Sydney, NSW, Australia
Call @ +61-730-407-305
Live Chat @ https://www.australiabesttutor.com




Our Services

Online assignment help Australia
my assignment help Australia
assignment help
help with assignment
Online instant assignment help
Online Assignment help Services

Manasa mittal said...

This is really great informative blog. Keep sharing. Full Stack Training in Hyderabad

Manasa mittal said...

This is really great informative blog. Keep sharing. Full Stack Training in Hyderabad

Riya karakoti said...

Really a good post, thanks for sharing .keep it up.

Best Web Design Training Institutes in Noida

Best Hadoop Training Institutes In Noida

Best Digital Marketing Training Institute in Noida

Sap Training Institute in Noida

Best Java Training Institute in Noida

SAP SD Training Institute in Noida

Best Auto CAD Training Institute In Noida

AutoCAD training in Noida said...

Each department of CAD have specific programmes which, while completed could provide you with a recognisable qualification that could assist you get a job in anything design enterprise which you would really like.

AutoCAD training in Noida

AutoCAD training institute in Noida


Best AutoCAD training institute in Noida

Naveen k said...

Thanks for sharing this blog. This very important and informative blog Learned a lot of new things from your post! Good creation and HATS OFF to the creativity of your mind.
Very interesting and useful blog!
best wired Mouse under 500

Naveen k said...

Very nice post here thanks for it.I always like and such super content of these post. Excellent and very cool idea and great content of different kinds of the valuable information's.
laser barcode scanner
bosch simultaneous interpretation system

amarraj paindit said...

rpa training institute in noida
sas training institute in noida
hadoop training institute in noida
blokchain traninig institute noida


nancy said...

Nice blog with excellent information. Thank you, keep sharing.

Nancy said...

Your blog is very useful for me, Thanks for your sharing.


MSBI Training in Hyderabad


Avoid select min/max with Oracle

I hate select max clauses with Oracle. My company used to write subqueries which such expressions. It's slow and unreadable. Conditions ...