Accessor method visible under Windows, Linux, but not OS X

Trying to build against javax.vecmath using the 1.5.2 jar file (found on Java.net http://java3d.java.net/binary-builds.html, for example).

Try to make a call on, say Point3d;

public class Foo {
  public static void main(String[] args) {
    Point3d t = new Point3d(1.0, 1.0, 1.0);
    System.out.println(t.getX());
  }
}

In 64 bit Windows and Linux (I've only tried Ubuntu 10.04, 64 bit), this compiles and runs.

In OS X (10.6.7) it will not compile:

...: cannot find symbol
  symbol  : method getX()
    location: class javax.vecmath.Point3d
    System.out.println (t.getX());

This is using the exact same physical vecmath.jar

If instead I use the source directly, it compiles on OS X, but does not run

Exception in thread "main" java.lang.NoSuchMethodError: javax.vecmath.Point3d.getX()D

If I compile the sources myself on OS X to a jar file, and then use the jar in the example above, again, unable to compile.

Now, the fields being accessed are in javax.vecmath.Tuple3d, which is an abstract class with public fields for x, y and z. So on OS X this will work (actually, it seems to work everywhere).

public class Foo {
  public static void main(String[] args) {
    Point3d t = new Point3d(1.0, 1.0, 1.0);
    System.out.println(t.x);
  }
}

The thing is, I'm working on a code base that depends on vecmath.jar, and in which the maintainers are on Windows and wish to keep using the accessor methods, but I'm on OS X.

I'm looking to both:

(1) understand what is going on (2) figure out how to make these sources portable while depending on the vecmath.jar file.

7
задан Josef Pfleger 27 May 2011 в 16:13
поделиться