Skip to content

Instantly share code, notes, and snippets.

@takai
Created July 2, 2012 03:07
Show Gist options
  • Save takai/3030759 to your computer and use it in GitHub Desktop.
Save takai/3030759 to your computer and use it in GitHub Desktop.

Create lib-boot dir and move following libs to lib-boot dir:

lib-boot/EC2CltJavaClient-1.0.jar
lib-boot/EC2ConversionLib-1.0.jar
lib-boot/EC2WsdlJavaClient-1.0.jar
lib-boot/commons-codec-1.3.jar
lib-boot/commons-httpclient-3.1.jar
lib-boot/commons-logging-adapters-1.1.1.jar
lib-boot/commons-logging-api-1.1.1.jar
lib-boot/jdom.jar
lib-boot/wss4j-1.5.3.jar
lib-boot/xalan.jar
lib-boot/xfire-all-1.2.6.jar
lib-boot/xfire-jsr181-api-1.0-M1.jar
lib-boot/xml-apis.jar
lib-boot/xmlsec.jar
--- bin/ec2-cmd.orig 2012-01-20 06:39:12.000000000 +0900
+++ bin/ec2-cmd 2012-07-02 12:03:32.000000000 +0900
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
-# Copyright 2006-2009 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the
-# Amazon Software License (the "License"). You may not use this file except in compliance with the License. A copy of the
-# License is located at http://aws.amazon.com/asl or in the "license" file accompanying this file. This file is distributed on an "AS
-# IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
+# Copyright 2006-2009 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the
+# Amazon Software License (the "License"). You may not use this file except in compliance with the License. A copy of the
+# License is located at http://aws.amazon.com/asl or in the "license" file accompanying this file. This file is distributed on an "AS
+# IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
# This script "concentrates" all of our Java invocations into a single location
@@ -13,17 +13,19 @@
__ZIP_PREFIX__EC2_HOME="${EC2_HOME:-EC2_HOME is not set}"
__RPM_PREFIX__EC2_HOME=/usr/local/aes/cmdline
LIBDIR="${EC2_HOME}/lib"
+BOOT_LIBDIR="${EC2_HOME}/lib-boot"
# Check our Java env
JAVA_HOME=${JAVA_HOME:?JAVA_HOME is not set}
# If a classpath exists preserve it
+BOOT_CP="${BOOT_CLASSPATH}"
CP="${CLASSPATH}"
# Check for cygwin bash so we use the correct path separator
case "`uname`" in
CYGWIN*) cygwin=true;;
-esac
+esac
# ---- Start of Cygwin test ----
@@ -33,7 +35,7 @@
if [ "${cygwin}" == "true" ] ; then
cygprop="-Dec2.cygwin=true"
- # Make sure that when using Cygwin we use Unix
+ # Make sure that when using Cygwin we use Unix
# Semantics for EC2_HOME
if [ -n "${EC2_HOME}" ]
then
@@ -46,12 +48,20 @@
fi
# ---- End of Cygwin Tests ----
+ for jar in "${BOOT_LIBDIR}"/*.jar ; do
+ cygjar=$(cygpath -w -a "${jar}")
+ CP="${BOOT_CP};${cygjar}"
+ done
for jar in "${LIBDIR}"/*.jar ; do
cygjar=$(cygpath -w -a "${jar}")
CP="${CP};${cygjar}"
done
-else
+else
+ for jar in "${BOOT_LIBDIR}"/*.jar ; do
+ BOOT_CP="${BOOT_CP}:${jar}"
+ done
+
for jar in "${LIBDIR}"/*.jar ; do
CP="${CP}:${jar}"
done
@@ -59,4 +69,4 @@
CMD=$1
shift
-"${JAVA_HOME}/bin/java" ${EC2_JVM_ARGS} ${cygprop} -classpath "${CP}" "com.amazon.aes.webservices.client.cmd.${CMD}" $EC2_DEFAULT_ARGS "$@"
+"${JAVA_HOME}/bin/java" ${EC2_JVM_ARGS} ${cygprop} -client -Xbootclasspath/a:"${BOOT_CP}" -classpath "${CP}" "com.amazon.aes.webservices.client.cmd.${CMD}" $EC2_DEFAULT_ARGS "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment