Editor's Note: With this installment, we kick off a new column,
"The Open Road," by Java in a Nutshell author David Flanagan.
Our mission for this column is to provide visibility into the
open source development of the next version of Java, which is happening
here on java.net. In this article, David looks at the state of the
OpenJDK and JDK 7 projects, proposed language changes that may appear
in Java 7, and prominent APIs that are being developed for possible
inclusion in Java 7. Each future installment will provide an update on what's currently happening in the latest builds from the project,
along with a deep dive into a new feature or API that's tracking for
inclusion in Java 7 (David discusses some of these in this first
installment). We hope you'll enjoy this early exposure to the next
version of Java, and that you'll be encouraged to download, build,
and/or run the various Java 7-related projects hosted on java.net.
This is the first in a series of articles about Java 7 and the
OpenJDK project here at java.net. This introductory article is a
broad and link-heavy overview of Java 7 and the open projects developing code for Java 7. As those projects release code that
we can try out, future articles will dive into that code!
The JDK 7 Project
The JDK7 project on
java.net is the first place to look for Java 7 updates. This
project releases binary snapshots of Java 7 every two weeks. If you want to try out a new feature of Java 7, downloading a binary is the easiest way to get yourself up
and running. (Note that the JDK7 project is not the same thing as
the OpenJDK; more on that below.)
Each new binary snapshot includes a list of bugs fixed and
features added. It is still early in the Java 7 development cycle,
and so far, the change lists for these early builds have been
pretty dull. They have included updates to Javadoc comments, fixes
for obscure regressions, and incomprehensible tweaks to the hotspot VM,
but very little in the way of new APIs to try out.
As I write this, the current snapshot is "build 16." The most
notable changes in
b16, in my opinion, are additions to the
java.util.Currency class. That class now has a static
getAvailableCurrencies() method, and instances have
getDisplayName() and getNumericCode()
methods to complement getSymbol() and
getCurrencyCode(). You can read about these new
methods in the
Javadoc. A new version of the API docs is generated for each
snapshot release. You can always find the current version at
download.java.net/jdk7/docs/api
.
The JDK7 project also releases source code snapshots, under
the Java Research License (or JRL). The JRL is intended for use
by universities and researchers and is not a true open source
license. If you're interested in these sources, you'll probably
want to read the build
instructions. This source is also available (read-only)
through Subversion, but you'll need to have the jdk.researcher
role added to your java.net ID.
Incidentally, the ongoing development of updates for Java 6 is
handled with equal transparency at jdk6.dev.java.net. Java
6u2 has recently been released, so watch this space for development
of update 3.
The OpenJDK Project
The OpenJDK project is a
completely different entity from the JDK7 project. Given that they both release source-code snapshots of Java 7, however, it can be hard to tell them apart. Here, in a nutshell, are the differences between the two projects:
The JDK7 project is Sun's open (as in transparent) Java
development process, controlled by Sun, with most development done
by Sun's internal engineering team.
The OpenJDK project is the Java community's open (as in free
software) source development project to create a completely
free/open source implementation of the JDK. The OpenJDK is
controlled by a governance board. Sun's
engineers participate in the OpenJDK project, but contributions
from outside developers are actively solicited.
Sun has already released all of their own Java code under the
GPLv2 license. There remain, however, a few pieces of the JDK that
Sun licensed from other commercial vendors. Thus, the primary
initial purpose of the OpenJDK project is to develop open source
alternatives to that encumbered code, so that a completely
open source version of Java can be released. This is a great place
to get involved if you like low-level coding: there are projects
set up to work on an audio engine, a framebuffer toolkit, a font
scaler, and a graphics rasterizer.
OpenJDK is an umbrella for many subgroups and the subprojects
they run. The current list of groups and projects is in a column
running down the left-hand side of the OpenJDK home page. As you can tell
from the preliminary list of projects above, the 2D Graphics group is
currently the most active one.
We can expect more OpenJDK projects as development of Java 7
gains momentum. Currently, the only Java 7 project is the Modules project,
which aims to create open source implementations of JSR 277 and JSR 294.
OpenJDK source code is available as source code snapshots
that follow the same build numbering scheme and release schedule as
the JDK7 project. You can also browse or
download the source with Subversion. In addition to downloading
sources, you'll also have to download a complete (but
non-functional) binary snapshot (linked from the same page as the
sources), from which encumbered code can be copied in binary form.
Before you start downloading, bear in mind that official instructions
for building the OpenJDK have not yet been published. (If you are a
NetBeans user, however, you may be able to use your IDE to
build the OpenJDK.)
Java 7 Release Schedule
Open sourcing Java and creating the OpenJDK infrastructure has
apparently taken quite a bit of work for Sun, and this brings us to
the bad news. Sun typically aims to release new versions of Java at
18-month intervals. Java 6 was released in fall 2006. The original
Java 7 schedule, therefore, called for a release in spring 2008.
Given that the current builds available from the JDK7 project have integrated no
major new features, we obviously aren't even close to a beta
release. Danny
Coward, who will be the spec lead for the Java 7 JSR, now says
that they're aiming for a release in January 2009, about 16
months from now.
Java 7 Features
Back in the fall of 2006 there was a lot of talk about what
features might be included in Java 7. Coward listed some
possibilities in September, and
detailed some of them (PDF) in November 2006.
With these semi-official feature lists as a starting point, Alex
Miller has been tracking
development and discussion of possible Java 7 features at his
Pure Danger Tech blog. Alex's Java 7 site is probably the best and most
current Java 7 resource out there.
The truth is, however, that we really don't know what will be in
Java 7. The speculation from last fall is still just speculation,
and given the amount of schedule slippage since that time, there
are likely to be changes, possibly significant changes, to Danny's
original lists. What we're waiting for is his submission of
the Java 7 platform JSR. When published, this JSR should reveal the
features that Sun is targeting for Java 7. He says that we
should expect a JSR to be released "over the next couple of
months." He admits, however, that he's been saying that for some
time now.
Language Changes for Java 7?
A September
2006 post suggested that Sun would propose "a small set" of
changes to the Java language. Candidates then under consideration
were:
Language-level XML support
Closures
Block constructs
Strings in switch statements
Language support for BigDecimal
Java property support
Lightweight method references
Extensions to the annotation mechanisms
The possibility of languages changes aroused a lot of interest.
Variousclosureproposals were
floated and discussed at length, with the discussions culminating
in a face-to-face meeting of the principals at JavaOne '07. Adding
support for property access without getter and setter methods was
also much debated. Recently, however, discussion of new language
features has quieted down. Faced with the reality of the schedule
slippage, Neal Gafter
(former javac maintainer, and one of the primary advocates
for Java closures) predicts that Java 7 will either be delayed
until late 2009 or that language changes will be deferred until
Java 8.
As a further reality check on adding features to a mature
language, read Alex
Buckley's blog. Alex is the new maintainer for the Java
Language Specification, and as such, he will be intimately involved
with any language changes. Although he hasn't written much,
everything Alex has posted on his blog is interesting.
Projects of Interest
Until we see a formal Java 7 JSR, and until we start seeing more
significant code being checked into the JDK7 and OpenJDK projects,
we'll have to content ourselves with projects that are being
developed independently. The following projects have code available
to download and try out now:
The Measures and
Units project (JSR 275) is developing a library for working with quantities and the units with which they
are measured. This library uses Java generics to allow static type
checking of unit compatibility. This JSR has just completed its
early draft review, and a new implementation, incorporating changes
based on that review, should be released soon. While this JSR did
not appear on last fall's list of candidates for inclusion in Java
7, the spec lead hopes this small library makes it into core
Java.
The Date/Time API
(JSR 310) aims to
comprehensively solve the date and time representation problems
that have plagued the Java platform. Work on this JSR is very
transparent (there is a wiki and an open mailing list) and discussion
and development are active and ongoing. Preliminary (but unstable)
code is available to try out. The developers hope to have their
work included in Java 7.
Doug Lea is working
on a Java 7
update to the JSR 166 java.util.concurrent
utilities. His fork/join package is a concurrency framework for
cleanly dividing tasks up for efficient concurrent execution on the
multicore CPUs of the future. An implementation
is available as is an academic paper (PDF) about the framework.
As mentioned earlier in the article, the OpenJDK Modules project is
an implementation of JSR 277 and JSR 294, both of which
are expected to be part of Java 7. A partial implementation is
available at the main OpenJDK download page. At this point, it is a source-only release and you must build
the JDK from scratch to try it out. I'll write about this project
when there is a binary snapshot to try.
I hope to cover some or all of these projects in future
installments of this column. Your suggestions for projects to cover
are welcome in the comments below.
David Flanagan is the author of a number of O'Reilly books, including
Java in a Nutshell, Java Examples in a Nutshell, Java Foundation Classes in a
Nutshell, JavaScript: The
Definitive Guide, and JavaScript Pocket Reference.
What did you think of this first installment, and what would you like David to cover next time?
Showing messages 1 through 31 of 31.
good article
2008-04-21 23:28:10 wiliam6
[Reply | View]
Pass4Sure is your source for the Comptia A+ exam. With our IBM Certification Exam Resources, you can be rest assured that you will Pass your MBS Exam on Your First Try. Our Exams are written and formatted by Top senior IT Professionals working http://www.pass4sure.com/Microsoft-Business-Solutions.htmlin today's prospering companies and data centers. All of our practice exams including the MBS exam guarantee you success on your First Try.
You will find the great selection of silver Pendants at Tiffany Jewelry Store. All our silver tiffany pendants are stamped with a fineness mark of "925" or "Sterling" or "Ster" to indicate silver purity. Moreover, the tiffany pendant are crafted with the quality of being beautiful and delicate in appearance, and they are inspected for a fineness mark to ensure quality.
Our main manufacture include: Inflatable Bouncers, Inflatable Castle, Inflatable Games, and much, much more! Our products are a great affordable choice and are designed for all age groups. Many of the kid's pools will double as ball pits and are fine for indoor play during winter or stormy days. Our Inflatable Toys are a wonderful alternative to those hard bleachers at the little league games and provide an elevated vantage when watching the kids at the beach. The scuba accessories and pool floats are just the thing for little swimmers and big ones alike. Explore the pages of our site for your gift giving ideas!
In my opinion, a few cosmetic changes to java.util.Currency are not enough. And after meeting with a lot of fellow JCP members at QCon I am not the only one sharing it.
Similar to JSR-310's approach towards Date and Calendar there should be a true type and value support for a real Monetary Unit. Not just a few cosmetic changes to the already cosmetic Currency class.
The fact that this class and its native OS support are often faulty became obvious, when I just created a Spring based showcase for JSR-275 and an experimental, but fairly succesful Money and Stock Market example based on it.
While the JSP tags using Currency badly failed and ended up showing only "?" or similar placeholders on many systems (such as Mac) the JSR-275 based one worked fine in all cases.
String literal in groovy is a big advantage compare to Java. So one of my big wish is Java can add support of groovy style of string expression:
1. Multi-Line Strings :
Instead of : abc + \ndef + \nghi, we can simply put:
Abcdefghi
2. Shortcut to embedded variable in String
Such as Hello $name instead of Hello + name.
I believe these changes wont affect much in deep of the language, just the change of the source code parser. But this has great benefit for producing cleaner code.
what i think on Java 7
2007-11-22 19:05:53 fachim
[Reply | View]
Supporting dynamic language such as Groovy, BeanScript and Jython is good, server side programming become litle bit interesting and live!
Including Java Persistance API into Java SE is perfect! Simplify desktop development from complicated vendor dependent SQL.
Hey you give me such a happiness, I can put String in switch statement, that's cool. I dont like C/C++ style switch that Java adopted so far.
Simplification of JavaBeans properties, setter and getter is fantastic, its really helpful for server side and put it in JSP. Cleaner and simple code. But how about including XML in language is not a goodd idea, language would not as simple anymore.
Last, I dont understand regarding Fork/Join framework but I knew Java best in virtualization, programmer just take a concern on their application development, dont bother about hardware and its complicated architecture. But why we include those complicated hardware architecture into high level programming practise?
Is there any chance we'll get === operator?
before: LHS === RHS
after: (LHS == null) ?false:LHS.equals(RHS)
If only one operand is a primitive, then the primitive should get autoboxed. If both operands are primitives, then the operator should act like ==.
Language-level XML support
2007-08-29 01:18:02 scnnrc
[Reply | View]
The only feature that i dislike is the Language-level XML support ,it taints the language with something that it is external to it. What if in 5 years we won"t be using XML anymore?
Language-level XML support
2007-12-25 21:59:44 jianwu_chen
[Reply | View]
I agree on this point. XML is not something worth to be integrated into a language. Its not well designed in the beginning from software design point of view. Except big companies support it, I don't think many developers like it after intensively using it. Now a lot of companies have realize the issues with XML (XSLT especially) and move away from XML hell after waste large amount of money. In my opinion, XML will become legacy technology in the near future. People will only use it because the old system needs it. Hope it won't pollute a pure, neat language like java.
Actually we can learn some ideas from groovy builder. Which supports generic tree like hierachy structure build in the language level. But don't need to be specific for XML. XML should just be one use case of this generic builder mechanism.
Honestly, it's refreshing to see it all in a nutshell, instead of deciphering a JSR. Thanks for the great overview. I spent 3 hours trying to figure out what was in java 7 as opposed to what's proposed. In the end it took 10 minutes to read your post, and I feel up to date...
Yeah, this is very important and now Java supports dynamic arguments to the function so all the other exceptions can be passed as array except the "Exception".
New features .. yes and no.
2007-08-15 23:51:12 melbeltagy
[Reply | View]
or me, I am not sure if adding new major language changes to Java is a pretty good idea or not. But a general idea is that I totally agree with one of the replies who specifically said:"The reason of success for Java was that it was a simple language that can easily be kept in mind, but was powerful enough to get most jobs done.".
Any way, this is what I think in details:
Language-level XML support : why adding new features that would tide the language to something else other than Java (like we did with Java and Expression Language (EL)). IMHO, I think the way Java community did with the Scripting project (JSR 223) is a much better way of using other things than Java inside Java. It makes it very easy to use, and still have a very high way of abstraction and isolation of dependencies between Java and others, even if it was XML. The reason why I am saying this is because to add XML support you will need to add support for a lot of XML-related technologies. We do have some of them already in the JDK XML packages and classes implementations. But why add them to the Java syntax.
Closures : I am not sure what closures are. But when I read about it, the first impression I had is that its syntax is complicated.
Block constructs : don't know.
Strings in switch statements : Yes. I think it is a very useful feature.
Language support for BigDecimal : I am not sure what is the feature in this.
Java property support : I have read a long article discussing this feature right here. And to tell you the truth, my final conclusion is that IT WILL depend actually on how they propose it. I find it very useful, but it really needs to be easy to use.
Lightweight method references: Not sure what is the meaning of this.
Extensions to the annotation mechanisms: Yes (if it means annotations inheritance).
Well, one thing I like though and I really hope it would make it to Java 7, the Measures and Units project (JSR 275). I think it is a good thing to have in Java and I think it is something that should have been there along time ago.
New features .. yes and no.
2007-08-15 23:46:40 melbeltagy
[Reply | View]
... sorry, i did not know that (li) tag would look like a new comment... :(
iow an invitation to spaghetti code... Nested methods?
Well, they're of course a natural result of "closures" which are really nested anonymous methods and function pointers so if you add one you end up opening the floodgates to add the other as well.
And people're thinking "closures" are a good idea because they make inner classes (which they think are ugly) superfluous (in their mind)...
Please ... the language changes in Java5 already showed how bad later introduced language features can be - please don't do the same for Java-7.
Son't destroy the language just because of the we-too effect.
Wait 10 years and watch what will happen to C#/VB.NET with tons of high-level features only a few developers need.
Its the same as with C++, just on another level.
I don't agree. The language should evolve as long as we take control of the evolution so it will continues improve but still keep it simple. Otherwise, the language will soon be outdated.
For Java5 features, we have already got a lot of benefits from it in our real life projects. The code in Java5 is much cleaner compare to old version.
Generics and autoboxing are nice, though the implementation might have been better in places. Annotations I've never much cared for and again could have been better thought out (I especially miss inheritance of applied annotations to derived classes). Enums are good.
Let's just call it Java Me2! in "celebration" of adding everything but the kitchen sink that any currently hyped language has without any consideration whatsoever of the consequences or usefulness.
+1
You will ruin Java when every pet feature is going to be included in the language.
Instead give better support for Groovy. It has many cool features and should be the dynamic companion of Java.
But do not supercharge the Java language. The reason of success for Java was that it was a simple language that can easily be kept in mind, but was powerful enough to get most jobs done. The code was almost self documenting. Now look at the famous:
Enum< E extends Enum<E>> {...}
Because of code like this many developers left C++
I couldn't agree more. The only thing I would suggest is possibly extending annotations. It's a way of generically extending the usefulness of the language without polluting it. I would perhaps agree with people that want better introspection on typed collections but I'd argue that that could be done as an annotation too rather than deep in the bowels of the language.
What about reified generics?
2007-08-09 08:35:51 crayzfishr
[Reply | View]
What about reified generics?
2007-08-10 09:37:46 davidflanagan
[Reply | View]
I don't have any inside knowledge about this. Reified generics are certainly a feature that gets talked about outside of Sun. Maybe not as much as closures, but certainly people are thinking about it. But a look at the calendar and the intended release date of Java 7 should make you skeptical whether such a significant language change could be developed in time.
What about reified generics?
2007-08-09 23:45:39 jwenting
[Reply | View]
let's just leave well enough alone and don't change something that works just because someone doesn't consider it theoretically beautiful.
Let's not twiddle with the backwards compatibility of the classfile format. This "proposal" would destroy the capability of running any classfiles compiled to earlier language standards against a JVM implementing it. While not as bad as the flood of senseless new "features" being put forward that will no doubt make it for the sole reason that they look nice to marketing flunkies, it's not the way to go.
What about reified generics?
2007-08-11 10:04:14 artti
[Reply | View]
> This "proposal" would destroy the capability of running
> any classfiles compiled to earlier language standards
> against a JVM implementing it.
I'm not a JVM expert myself, but I find it really hard to believe that there isn't a way to make this change so that older class files could be run with the new JVM also.
Could you elaborate, why would this particular change cripple the new JVM as you mentioned?
What about reified generics?
2007-08-12 23:06:44 jwenting
[Reply | View]
The old classes wouldn't have the information, so the new JVM wouldn't know what class they were. You'd end up with untyped objects floating around, and suddenly having methods called on them that are part of some specific object without having any cast performed beforehand.
What about reified generics?
2007-08-13 10:03:54 artti
[Reply | View]
I thought that the main problem is in generic types that are defined "runtime":
new ArrayList<String>()
Hope that renders correctly. Classes that implement generic classes do have generic types already available runtime:
It just should be much easier to get to those types.
Runtime generic types compiled with older JDKs should be treated as Objects just like they are currently; nothing changes.
You might end up with an old code that seems to have plain classes with Object generic types, but thats what you have currently anyway?
What about reified generics?
2007-08-13 21:56:50 jwenting
[Reply | View]
problem is that those old classes would now all bristle with ClassCastExceptions if it's suddenly assumed that the actual type information is correctly supplied at runtime but they're instead hard cast to Object. That doesn't currently happen as the actual type is determined at compilation and used instead.
What about reified generics?
2007-08-28 14:36:07 cowwoc
[Reply | View]
Sorry jwenting, I don't see it. Can you please supply some sample code that would result in a ClassCastException if we introduced Reified Generics?