yikuang / wave-protocol

Automatically exported from code.google.com/p/wave-protocol
0 stars 0 forks source link

Build error - whack wrong version? #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. cd wave-protocol
2. ant
3.

What is the expected output? What do you see instead?

It is expected to build without errors.

What version of the product are you using? On what operating system?
Mac OS X 10.5.7

Please provide any additional information below.

Here is the error message -

compile:
    [javac] Compiling 157 source files to /Users/XXX/Desktop/wave-protocol/build/core
    [javac] /Users/XXX/Desktop/wave-
protocol/src/org/waveprotocol/wave/examples/fedone/FlagBinder.java:36: cannot 
access 
org.xmpp.packet.Message
    [javac] bad class file: /Users/XXX/Desktop/wave-
protocol/third_party/runtime/whack/xmpp.jar(org/xmpp/packet/Message.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.xmpp.packet.Message;
    [javac]                        ^
    [javac] 1 error

Original issue reported on code.google.com by hitesh.p...@gmail.com on 21 Jul 2009 at 11:55

GoogleCodeExporter commented 9 years ago
This is fixed by making sure Mac uses the right Java 6 version. Thanks.

Original comment by hitesh.p...@gmail.com on 22 Jul 2009 at 12:59

GoogleCodeExporter commented 9 years ago
Yes. See the Installation documentation - you need to use Java 6. I'll ask for 
the
docs to mention this error. 

Original comment by anthonybaxter@gmail.com on 22 Jul 2009 at 5:33

GoogleCodeExporter commented 9 years ago
There are a few 

  target="1.5"

attributes in the ant build targets in build.xml. I don't know much about ant - 
should 
these be changed if we require Java 6?

Original comment by tobias.t...@gmail.com on 26 Jul 2009 at 4:23

GoogleCodeExporter commented 9 years ago
I tried to change all "1.5" instances to "1.6" in build.xml. This time when I 
build,
I receive an error on line 68, which is where the second "1.6" exists. Any 
suggestions?

Original comment by bwood...@gmail.com on 29 Jul 2009 at 6:30

GoogleCodeExporter commented 9 years ago
What does 'javac -version' report? Did you follow the instructions in the 
Install docs?

Original comment by anthonybaxter@gmail.com on 29 Jul 2009 at 7:33

GoogleCodeExporter commented 9 years ago
OK, I see one of my problems. I went to Applications/Utilites/Java Preferences 
to
change to 6. Unfortunately, now I'm getting this:

javac: invalid target release: 1.6

I'll try a few more things and see what happens.

Original comment by bwood...@gmail.com on 29 Jul 2009 at 10:53

GoogleCodeExporter commented 9 years ago
A little more digging ...

I changed all "1.5" instances to "1.6" in build.xml.

When I run "javac -version" I get the following:

javac 1.6.0_13

When I run "ant dist -verbose" I see this at the beginning: 

Apache Ant version 1.7.0 compiled on May 21 2009
Buildfile: build.xml
Detected Java version: 1.5 in:
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home
Detected OS: Mac OS X
parsing buildfile /Users/ben/wave-protocol/build.xml with URI =
file:/Users/ben/wave-protocol/build.xml
Project base dir set to: /Users/ben/wave-protocol
[antlib:org.apache.tools.ant] Could not load definitions from resource
org/apache/tools/ant/antlib.xml. It could not be found.
 [property] Loading /Users/ben/wave-protocol/build.properties

Any ideas why javac would report 6 and Detected Java version as 5?

Original comment by bwood...@gmail.com on 29 Jul 2009 at 11:12

GoogleCodeExporter commented 9 years ago
That utility doesn't set the version used by ant, as far as I can tell. Please 
try the environment variables that are 
mentioned in the install doc.

Original comment by anthonybaxter@gmail.com on 29 Jul 2009 at 11:16

GoogleCodeExporter commented 9 years ago
That worked.

I figured out now what I did wrong. I initially set the environment variables, 
then
realized I had to download the newest version of Java. I must have wiped the
environment variables by mistake.

Thanks for your assistance! 

Original comment by bwood...@gmail.com on 30 Jul 2009 at 3:32

GoogleCodeExporter commented 9 years ago
For those that come after, I ran into this same problem on Debian and solved it 
the 
same way.

Original comment by bobzi...@gmail.com on 16 Oct 2009 at 12:19

GoogleCodeExporter commented 9 years ago

Original comment by ano...@google.com on 22 Dec 2010 at 4:38