Use specific jvm installation when call java application from php code -


i have 2 installations of jdk on account , not have root access change default 1 "usr/bin/java" specific 1 /home/username/jdk/bin/java"

i tried following in php code:

 $java_home = "/home/username/jdk";  $path = "$java_home/bin:".getenv('path');  putenv("java_home=$java_home"); 

but when execute following below above mentioned lines:

which java 

i got /usr/bin/java

any idea please how make works? java application want run php code not work on default one.

thanks

if feasible, qualify java command, e.g. /home/username/jdk/bin/java, when running java program.

this way can use multiple different jvm's in different places of php code.

note: know using qualified access works on windows, if java_home points different installation. i'm assuming same true linux.


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -