Skip to content

Instantly share code, notes, and snippets.

@tmandry
Created April 22, 2013 04:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmandry/5432452 to your computer and use it in GitHub Desktop.
Save tmandry/5432452 to your computer and use it in GitHub Desktop.
Getting the octave-forge java package (v1.2.9) to install on OS X Lion. See below for instructions and more information.
--- /tmp/java/src/configure 2012-07-25 11:34:49.000000000 -0500
+++ configure 2013-04-21 22:56:40.000000000 -0500
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.65.
#
@@ -3252,9 +3252,10 @@
java_version=`$JAVA -version 2>&1 | sed -n -e 's/^java version[^0-9"]*"\([^"]*\)"/\1/p'`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $java_version" >&5
$as_echo "$java_version" >&6; }
- java_major=`echo -n $java_version | sed -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\..*$/\1/'`
- java_minor=`echo -n $java_version | sed -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\..*$/\2/'`
- if test $java_major -ge 1 -a $java_minor -ge 5; then
+ java_major=`echo $java_version | sed -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\..*$/\1/'`
+ java_minor=`echo $java_version | sed -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\..*$/\2/'`
+ echo -n major "$java_major" minor "$java_minor"
+ if test "$java_major" -ge 1 -a "$java_minor" -ge 5; then
case "$canonical_host_type" in
*-msdosmsvc*)
HAVE_JAVA=yes
@@ -3271,11 +3272,11 @@
LFLAGS="$LFLAGS -framework JavaVM"
JAVA_TEMP="/System/Library/Frameworks/JavaVM.framework"
JAVA_HOME="${JAVA_TEMP}/Home"
- JAVA_ARCH="${JAVA_TEMP}/Libraries/libjvm_compat.dylib"
+ JAVA_ARCH="${JAVA_TEMP}/Libraries/libjvm.dylib"
# According to:
# http://developer.apple.com/unix/crossplatform.html
# you need to explicitely set the include path
- JAVA_INCS="-I${JAVA_HOME}/include"
+ export JAVA_INCS="-I${JAVA_TEMP}/Headers/"
HAVE_JAVA=yes
# This is the Debian default path
elif test -d "/usr/lib/jvm/default-java"; then
@@ -3311,7 +3312,7 @@
JAVA_INCS="-I${JAVA_HOME}/include -I${JAVA_HOME}/include/win32"
;;
*)
- JAVA_INCS="-I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux"
+ #JAVA_INCS="-I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux"
;;
esac
fi
@tmandry
Copy link
Author

tmandry commented Apr 22, 2013

  1. Download and extract the archive (available at http://octave.sourceforge.net/java/)
  2. Remove the pre_install.m file
  3. Apply this patch to src/configure
  4. Recreate the archive (tar -czf java.tar.gz java/)
  5. In octave, type pkg install -verbose path/to/archive

Do not set JAVA_HOME.

To the maintainers:
This is a hack, but it fixes it for me on OSX Lion. Clearly the installation was not tested on OSX for this version.
Changing to /bin/bash is necessary because for some reason echo does not see '-n' as a flag and instead prints it when /bin/sh is used.
Other changes are just changes to paths that may have changed in newer versions of OSX. Then the last line is disabling some code that assumes either windows or linux as a platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment