-
Notifications
You must be signed in to change notification settings - Fork 94
Experimenting with jdk8
If you are on any variant of Debian linux (Mint / Ubuntu etc), there is the convenience of being able to set alternative java using update-alternatives:-
su -c "update-alternatives --config java"
or
sudo update-alternatives --config java
Output
There are 3 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 auto mode
1 /opt/jdk1.7.0_51/bin/java 100 manual mode
* 2 /opt/jdk1.8.0/bin/java 100 manual mode
3 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 manual mode
Press enter to keep the current choice[*], or type selection number:
Simple but crude, ensure you have a user bin folder (and that it is on your PATH) create a bash script as follows,
#!/usr/bin/env bash
export JAVA_HOME="/opt/jdk1.8.0"
${JAVA_HOME}/bin/java $@
and make it executable chmod +x bin/java
some nice person will edit this? Setting JAVA_HOME
might do it.
some nice person with a rollneck sweater will edit this? Setting JAVA_HOME
might do it.
How do I check which version of the JVM JRuby is running on?
jruby -rjava -e "puts java.lang.System.get_property('java.version')"
prints out 1.8.0
with above setup.
How do I optimise performance (make use of jvm flags)
-
Edit your
.bashrc
(for global configuration, NB: jruby-complete may also pick up this configuration up, especially if you kick-off ruby-processing with an installed jruby)-XX:+TieredCompilation
on its own seems to work best. -
Edit
data/jruby_args.txt
in your local folder