I need to be able to call a certain process with a certain java binary. Call that process "foo". However, foo also invokes several other processes via java, but foo is a black box to me. When foo invokes those processes, it just runs "java bar", "java bat", etc. How do I tell foo and any processes called by foo, to use /full/path/to/java only? Essentially I want to use "update-alternatives" for a single shell session and/or single process tree.
OS is Centos7, shell is bash.
Setting the system java is out of the question, as other processes on the system need a different java binary.