Installing Java 7 JDK on CentOS 7

Openjdk packages on CentOS 7 come in a JRE and a JDK (as you’d expect). If you install java-1.7.0-openjdk you get just the JRE:

$ sudo yum install java-1.7.0-openjdk

$ java -version

java version "1.7.0_151"

OpenJDK Runtime Environment (rhel-2.6.11.1.el7_4-x86_64 u151-b00)

OpenJDK 64-Bit Server VM (build 24.151-b00, mixed mode)

Starting up WLS 10.3.6:

wlserver_10.3]$ cd server/

$ cd bin

$ . ./setWLSEnv.sh

The JDK wasn’t found in directory /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.151-2.6.11.1.el7_4.x86_64.

Please edit the startWebLogic.sh script so that the JAVA_HOME

variable points to the location of your JDK.

$ cd /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.151-2.6.11.1.el7_4.x86_64

$ ls

ASSEMBLY_EXCEPTION  jre  jre-abrt  LICENSE  THIRD_PARTY_README

Only a JRE there, no JDK.

From here, install the devel package too:

sudo yum install java-1.7.0-openjdk-devel

Now we look good:

$ . ./setWLSEnv.sh

CLASSPATH=/home/kev/Oracle/Middleware/patch_wls1036/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/kev/Oracle/Middleware/patch_ocp371/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.151-2.6.11.1.el7_4.x86_64/lib/tools.jar:/home/kev/Oracle/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/home/kev/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar:/home/kev/Oracle/Middleware/modules/features/weblogic.server.modules_10.3.6.0.jar:/home/kev/Oracle/Middleware/wlserver_10.3/server/lib/webservices.jar:/home/kev/Oracle/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/home/kev/Oracle/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:

PATH=/home/kev/Oracle/Middleware/wlserver_10.3/server/bin:/home/kev/Oracle/Middleware/modules/org.apache.ant_1.7.1/bin:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.151-2.6.11.1.el7_4.x86_64/jre/bin:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.151-2.6.11.1.el7_4.x86_64/bin:/home/kev/Oracle/Middleware/wlserver_10.3/server/bin:/home/kev/Oracle/Middleware/modules/org.apache.ant_1.7.1/bin:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.151-2.6.11.1.el7_4.x86_64/jre/bin:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.151-2.6.11.1.el7_4.x86_64/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/kev/.local/bin:/home/kev/bin

Your environment has been set.

Good to go!

Detecting attached monitors on MacOS

If you boot MacOS with a KVM attached and a second monitor is not actually attached at boot time, on my 2008 Mac Pro at least, the second monitor is not automatically detected (it works fine if the KVM is already switched to the Mac at boot).

To force MacOS to detect additional monitors, hold the Option key in System Preferences / Displays, and then click on the ‘Detect Monitors’ button that appears.

See article here.

Cloning an existing VM on VMware ESXi using command line vmkfstools

Apparently vCenter Server provides the ability to clone VMs via the Client, but not if you’re just using ESXi and managing your host directly with the web client. It is possible however to clone a VM’s disk using the vmkfstools commanline utility as described in this post.

Here’s a summary of the steps:

Enable SSH from the ESXi web console: Host / Manage / Services

In my case I wanted to create a copy of an existing CentOS7 VM. SSH into your ESXi host, then:

vmkfstools -i CentOS7-1/CentOS7-1_0.vmdk CentOS7-2/CentOS7-2.vmdk -d thin

Next, create a new VM as normal, but on the Customize Settings dialog, press the X on the right to delete the disk created by the new VM wizard:

Next, press ‘Add new disk’, select ‘Existing hard disk’, then point to the copy of the VM disk that you created with the vmkfstools command:

Credit to this post for the tip to configure using an existing disk.