Saturday, April 25, 2009

Determine Java Runtime Environment Version

A few days ago I was asked for a quick and easy way to determine what java runtime environment version was installed via the Unix command line. The requester was trying to determine possible compatibility issues for some recently purchased applications.  

Bear in mind that you may have multiple JRE environments installed on your box so consider the PATH value -- meaning you might have to specify an absolute path. e.g. /usr/some_java_version/bin/java

Here is the Unix one-liner syntax using default path

% java -version
java version "1.x.x_xx)
...

By the way, it is the same syntax for Windows.

C:\Users\mysysad> java -version
java version "1.x.0_xx"
Java(TM) SE Runtime Environment (build 1.x.0_xx-xxx)
Java HotSpot(TM) Client VM (build xx.3-bxx, mixed mode, sharing)

Friday, April 17, 2009

Access a Tape Drive Device From a non-global Zone

A couple days ago, I had a friend who wanted to know how to access a tape device from his Solaris 10 non-global zone.

Here is an example on how to add a device to an existing non-global zone. By the way, the commands below are ran from the global zone, and you will have to reboot the non-global zone.

# zoneadm list
mysysad-global

# zonecfg -z sysad
zonecfg:sysad> add device
zonecfg:sysad:device> set match=/dev/rmt/0n
zonecfg:sysad:device> end
zonecfg:sysad> verify
zonecfg:sysad> commit
zonecfg:sysad> exit

# zoneadm -z sysad reboot

After the reboot, you should be able to access the tape drive from the non-global zone.