[MacPorts] #47036: jython installation hardcodes JAVA_HOME such that jython will fail if a user upgrades the Java installation

MacPorts noreply at macports.org
Wed Mar 4 18:07:07 PST 2015


#47036: jython installation hardcodes JAVA_HOME such that jython will fail if a
user upgrades the Java installation
---------------------+--------------------------------
 Reporter:  mtb19@…  |      Owner:  macports-tickets@…
     Type:  defect   |     Status:  new
 Priority:  Normal   |  Milestone:
Component:  ports    |    Version:  2.3.3
 Keywords:           |       Port:  jython
---------------------+--------------------------------
 = To reproduce =

 * install an older version of Java (e.g., jdk1.7.0_67)
 * install jython
 * upgrade Java (e.g., to jdk1.7.0_75)
 * remove the older Java version
 * run `jython`
 * run `JAVA_HOME="$( /usr/libexec/java_home -v 1.7 )" jython`

 = Expected =

 Both `jython` and `JAVA_HOME="$( /usr/libexec/java_home -v 1.7 )" jython`
 should work.

 = Actual =

 Both fail, complaining that (e.g.)
 `/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/bin/java`
 doesn't exist.

 = Additional Detail =

 An inspection of `cat $( which jython )` reveals:

 {{{
 ...
 # This file was generated by the Jython installer
 # Created on ...

 JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/jre"
 ...
 }}}

 These lines are not present in the
 [https://svn.code.sf.net/p/jython/svn/tags/Release_2_5_2/jython/src/shell/jython
 original source file]. Setting `JAVA_HOME` in this manner:

 * a) may not be correct for very long; and
 * b) permanently overrides any external setting

 This leaves the user with hand-editing `$( which jython )` or reinstalling
 jython after every Java upgrade to get it to work, neither of which is
 ideal.

-- 
Ticket URL: <https://trac.macports.org/ticket/47036>
MacPorts <https://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list