Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Default java version



Dan Grassi wrote:

When I create a new Java Tool the build.xml file specifies source="1.3" target="1.2". Two questions:

1) How do I change this to 1.5 so that simple example programs will compile without having to edit the build.xml each time.

Edit the Xcode templates. For a default install of Xcode 3, they're here:
/Developer/Library/Xcode/Project Templates/ Java/


Be warned: at the next Xcode update, your changes may be overwritten, so keep track of them somewhere else, so you can reapply them.

Also see here:
  <http://briksoftware.com/blog/?p=66>

And google:
  xcode 3 project templates


2) Why does this default to the non-current version of Java?

My guess: expectations of backward compatibility. There are still a lot of deployments, especially server-side, that aren't even running 1.4 yet.


If the build defaults to the current version, you get people asking why the compiled jars won't run, throwing a class-file version error. If the build defaults to an older version of Java, you get people asking why source that uses a 1.4 or 1.5 feature won't compile (no such method or class).

I don't know which one Apple gets more questions about, but it's probably easier to fix the latter than the former. This is simply because the jar compiled for a newer version won't fail until it runs on the older JRE, which may be far distant in time or space. When that problem occurs, it may be much harder to correct than the problem of source that won't compile.

One way or the other, it still boils down to misplaced expectations. With an overt 'source' and 'target' in build.xml, at least you can SEE what to expect. If it just silently used "the current version", whatever that is, it's harder to guess what to expect.

  -- GG

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.