[MacPorts] #14306: jython won't build because it wants Java 1.1
#14306: jython won't build because it wants Java 1.1 ---------------------------------------------+------------------------------ Reporter: pydave@gmail.com | Owner: macports-tickets@lists.macosforge.org Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.6.0 Keywords: java jython build error version | ---------------------------------------------+------------------------------ I tried to install Jython and it fails because it wants Java 1.1, but I use Java 1.5 Jython has only the universal variant, is there a way for me to tell port to build with Java 1.5? {{{ $ which java /usr/bin/java $ which javac /usr/bin/javac $ java -version java version "1.5.0_13" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-241) Java HotSpot(TM) Client VM (build 1.5.0_13-121, mixed mode, sharing) $ javac -version javac 1.5.0_13 ... }}} {{{ $ sudo port install jython ... ---> Building jython Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_jython/work/jython-2.1" && ant dist || ant jar " returned error 1 Command output: init: [echo] --- Build environment for jython --- [echo] --- Flags (Note: If the {property name} is displayed, [echo] --- then the component is not present) [echo] --- Optional Libraries --- [echo] java2 coll = true [echo] servlet = ${servlet.present} [echo] readline = ${readline.present} [echo] oracle = ${oracle.present} [echo] informix = ${informix.present} [echo] mysql = ${mysql.present} [echo] postgresql = ${postgresql.present} [echo] jndi = true [echo] jdbc = true [echo] jdbc3.0 = true prepare: parser: compile: [javac] Compiling 302 source files to /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_jython/work/jython-2.1/build [javac] javac: target release 1.1 conflicts with default source release 1.5 BUILD FAILED /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_jython/work/jython-2.1/build.xml:138: Compile failed; see the compiler error output for details. }}} I initially tried this in MacPorts 1.520, but then ran selfupdate to 1.600 and had the same result. I have: iBook G4 1.33 GHz - OSX 10.4.11 -- Ticket URL: <http://trac.macosforge.org/projects/macports/ticket/14306> MacPorts </projects/macports> Ports system for Mac OS
#14306: jython won't build because it wants Java 1.1 -------------------------------+-------------------------------------------- Reporter: pydave@gmail.com | Owner: macports-tickets@lists.macosforge.org Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.6.0 Resolution: | Keywords: java jython build error version -------------------------------+-------------------------------------------- Comment (by pydave@gmail.com): Managed to get Jython running. There are some problems with the packages initial set up (the jython script is wrong). Otherwise you just have to change the jdk to one you actually have. (Although, installing 1.1 might have worked. Regardless, the lowest version I have is 1.3, so nuts to that.) What I did: {{{ # install jython to get the build.xml file (this command will fail) sudo port install jython # Modify build.xml to use 1.4 instead of 1.1 (there's only one instance) sudo vim /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_jython/work/jython-2.1/build.xml +/1.1 # change current jdk # I used script from here: http://www.macosxhints.com/article.php?story=20060121171126988 # The following code should work, but is UNTESTED! cd /System/Library/Frameworks/JavaVM.framework/Versions/ sudo ln -fhsv 1.4 CurrentJDK cd - # install again (this command should succeed) sudo port install jython }}} '''But''', Jython can't cache its packages. {{{ $ jython *sys-package-mgr*: can't create package cache dir, '/opt/local/share/java/cachedir/packages' Jython 2.2a0 on java1.4.2_16 (JIT: null)
from java import * Traceback (innermost last): File "<console>", line 1, in ? ImportError: no module named java }}}
So you have to change the cache dir: {{{ # create a cache dir mkdir -p /tmp/jython/cachedir # tell jython where to go and to accept parameters (so we can run scripts like "jython app.py") # replace this line: CLASSPATH=/opt/local/share/java/jython.jar java org.python.util.jython # with this one: CLASSPATH=/opt/local/share/java/jython.jar java -Dpython.cachedir=/tmp/jython/cachedir org.python.util.jython $* sudo vim `which jython` }}} Now you should be able to run jython programs like this: {{{ #! /usr/bin/env jython from java.lang import Integer print Integer(5).intValue() }}} So: Can the jython script (/opt/local/bin/jython) be updated? Can the build.xml file be set to use java 1.4? Can port be set to build with a specific version of java (instead of the user changing their symlink)? Thanks, -David Replying to [ticket:14306 pydave@gmail.com]:
I tried to install Jython and it fails because it wants Java 1.1, but I use Java 1.5
Jython has only the universal variant, is there a way for me to tell port to build with Java 1.5?
{{{ $ which java /usr/bin/java
$ which javac /usr/bin/javac
$ java -version java version "1.5.0_13" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-241) Java HotSpot(TM) Client VM (build 1.5.0_13-121, mixed mode, sharing)
$ javac -version javac 1.5.0_13 ... }}}
{{{ $ sudo port install jython ... ---> Building jython Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_jython/work/jython-2.1" && ant dist || ant jar " returned error 1 Command output: init: [echo] --- Build environment for jython --- [echo] --- Flags (Note: If the {property name} is displayed, [echo] --- then the component is not present)
[echo] --- Optional Libraries --- [echo] java2 coll = true [echo] servlet = ${servlet.present} [echo] readline = ${readline.present} [echo] oracle = ${oracle.present} [echo] informix = ${informix.present} [echo] mysql = ${mysql.present} [echo] postgresql = ${postgresql.present} [echo] jndi = true [echo] jdbc = true [echo] jdbc3.0 = true
prepare:
parser:
compile: [javac] Compiling 302 source files to /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_jython/work/jython-2.1/build [javac] javac: target release 1.1 conflicts with default source release 1.5
BUILD FAILED
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_jython/work/jython-2.1/build.xml:138: Compile failed; see the compiler error output for details.
}}}
I initially tried this in MacPorts 1.520, but then ran selfupdate to 1.600 and had the same result.
I have: iBook G4 1.33 GHz - OSX 10.4.11
-- Ticket URL: <http://trac.macosforge.org/projects/macports/ticket/14306#comment:1> MacPorts </projects/macports> Ports system for Mac OS
#14306: jython won't build because it wants Java 1.1 -------------------------------+-------------------------------------------- Reporter: pydave@gmail.com | Owner: macports-tickets@lists.macosforge.org Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.6.0 Resolution: | Keywords: java jython build error version -------------------------------+-------------------------------------------- Comment (by jmpp@macports.org): Rendering for this ticket is completely messed up, poster of comment !#2 (if I'm reading the ticket correctly) should read our ticketing guidelines over at guide.macports.org. I'll try to find a trac plugin that'll let me edit comments to correct the rendering, but in the mean time we're going to have to live with how it looks (Trac doesn't allow editing comments out of the box, as it does the original description). -jmpp -- Ticket URL: <http://trac.macosforge.org/projects/macports/ticket/14306#comment:2> MacPorts </projects/macports> Ports system for Mac OS
participants (1)
-
MacPorts