Hi Leonard,

Leonardo Guilherme wrote:

> Hello.
> 
> I'm using OpenJDK JVM regularly on my machine instead of Oracle's one,
> primarily because of the infinality patches and because I prefer open
> source software.
> 
> There are some applications, though, that do not play ball with it
> (namely, SenchaCmd) and I have to keep switching back and forth between
> installed java-vms just to run it.
> 
> I know nothing about Java or its environment, is there a way to specify
> the java-vm just for this application instead of doing "eselect java-vm
> set user 1; sencha *stuff*; eselect java-vm set user 3" everytime?
> 
> Is there a set of environment variables that can do this? Shall I wrap the
> command in a shell script? Ideas?

Either the application uses already a script to start and you can modify 
JAVA_HOME there or you may wrap it in a shell script. Simply set JAVA_HOME 
using Gentoo's java-config command:

========= %< ==========
#! /bin/bash
JAVA_HOME=`java-config --select-vm=oracle-jdk-bin-1.8 -o` command
========= %< ==========

The option -o prints the JRE home, see the --help option to see 
alternatives.

The selection name is the name used in eselect, so you may update the 
package without touching the script.

Cheers,
Jörg



Reply via email to