just use JDK 1.6 instead. That will be fine.

I ran into a similar issue recently. Since I'm still using 1.5 for some projects, it's my "base" version. But I have a number of projects (like Nutch) that now require 1.6, often due to dependencies on recent Hadoop builds.

So I have a trivial "j16" script that I can use to set JAVA_HOME correctly before running ant or other command line tools that will need Java 1.6:

==================================================================
#!/usr/bin/env bash
#
# Execute the passed command using Java 1.6

JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/

$*
==================================================================

Put this in your $PATH somewhere, make sure the execute bits are set on it, and then you can do:

j16 ant

-- Ken


2009/4/20 Filipe Antunes <[email protected]>

 I Can't build Nutch with Ant.
 My ant version is 1.7.1 and i'm on a Mac OS X 10.4 PowerPC
 My java version is 1.5.0.

 I can't figure out why i'm having the error "class file has wrong version
 50.0, should be 49.0" ????

 This is the result from ANT:

 Buildfile: build.xml

 init:
   [mkdir] Created dir: /usr/local/nutch-1.0/build
   [mkdir] Created dir: /usr/local/nutch-1.0/build/classes
   [mkdir] Created dir: /usr/local/nutch-1.0/build/test
   [mkdir] Created dir: /usr/local/nutch-1.0/build/test/classes
   [mkdir] Created dir: /usr/local/nutch-1.0/build/hadoop
   [unjar] Expanding: /usr/local/nutch-1.0/lib/hadoop-0.19.1-core.jar into
 /usr/local/nutch-1.0/build/hadoop
   [untar] Expanding: /usr/local/nutch-1.0/build/hadoop/bin.tgz into
 /usr/local/nutch-1.0/bin
   [mkdir] Created dir: /usr/local/nutch-1.0/build/webapps
   [unjar] Expanding: /usr/local/nutch-1.0/lib/hadoop-0.19.1-core.jar into
 /usr/local/nutch-1.0/build

 compile-core:
   [javac] Compiling 232 source files to /usr/local/nutch-1.0/build/classes
   [javac]

/usr/local/nutch-1.0/src/java/org/apache/nutch/analysis/AnalyzerFactory.java:29:
 cannot access org.apache.hadoop.conf.Configuration
   [javac] bad class file:

/usr/local/nutch-1.0/lib/hadoop-0.19.1-core.jar(org/apache/hadoop/conf/Configuration.class)
   [javac] class file has wrong version 50.0, should be 49.0
   [javac] Please remove or make sure it appears in the correct subdirectory
 of the classpath.
   [javac] import org.apache.hadoop.conf.Configuration;
   [javac]                               ^
   [javac] 1 error

 BUILD FAILED
 /usr/local/nutch-1.0/build.xml:107: Compile failed; see the compiler error
 output for details.




--
Ken Krugler
+1 530-210-6378

Reply via email to