Do you guys have any tips on being able to switch between java versions,
namely 1.6 to 1.7?
I remember seeing a nice bash script that did this, it actually listed
all
the javaverions installed and let you choose which one to be active.
Do you guys have any tips on being able to switch between java versions,
namely 1.6 to 1.7?
I remember seeing a nice bash script that did this, it actually listed
all
the javaverions installed and let you choose which one to be active.
if you’re on OS X there’s java_home:
JAVA_HOME=$(/usr/libexec/java_home -v 1.6)
run /usr/libexec/java_home -V
and it lists all installed versions.
besides filtering on version (with -v as above) you can filter 32 bit
vs.
64 bit and you can even use it to execute a specific version of java:
/usr/libexec/java_home -v 1.6 --exec java -version
T#
Also for OS X is “pickjdk”, a bit richer than java_home:
This is what I use, and I think it’s the one the OP was looking for
(presents a menu, etc).
Hah…yeah perhaps it could be Ruby, but I don’t know if Ruby can
manipulate calling shell’s env
Anyway, there it is!
… but I don’t know if Ruby can manipulate calling shell’s env
Oh year, there’s that.
On Thu, Jun 27, 2013 at 4:23 PM, Charles Oliver N.
Charlie -
What weird language is that in, and how come it’s not Ruby?
I respect the ability to write nontrivial shell scripts, but boy, that
code
is ugly!
In any case, thank you, Nick, for writing it.
On Thu, Jun 27, 2013 at 3:33 PM, Charles Oliver N.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs