16 ms·
Java 7 is now available
- johnnyo 15y agoI'm glad to see it's finally available. I'm especially happy to see some of the language syntax that makes your standard try/catch/finally blocks a little cleaner and less error prone.
- _mayo 15y agoDoes anyone have a link to the changelog?
- SlyShy 15y agoHere: http://openjdk.java.net/projects/jdk7/features/ http://openjdk.java.net/projects/jdk7/features/
- EgeBamyasi 15y agoThat image confuses me.. Edid: You change the link didnt you? Im talking about the image from here: http://blogs.oracle.com/theplanetarium/entry/summarizing_java_language_changes_for http://blogs.oracle.com/theplanetarium/entry/summarizing_jav...
- dstywho 15y agoclosures yet?
- bromagosa 15y ago«JSR TBD: Project Lambda Lambda expressions (informally, "closures") and defender methods for the Java programming language» Welcome to the sixties, Java! Sorry, I couldn't help it >:D
- clobber 15y agoExcellent. Looking forward to the memory enhancements that should help make Minecraft servers less of a hog :)
- Emore 15y agoAnyone know why an OS X release is not on the list?
- famousactress 15y agoApple has always handled the Java releases for Mac.. they usually come later.. often much later.
- JonnieCache 15y agoApple manage their own java builds, and they usually lag way behind the sun/oracle releases. With java "deprecated" in lion, who knows how long it will take this time.
- bad_user 15y agoNot anymore.
- reverend_gonzo 15y agoIt's not just Apple anymore. Apple and Oracle will be working together to create an OpenJDK for Macs. http://www.macstories.net/news/apple-and-oracle-announce-openjdk-for-os-x-java-developers-rejoice/ http://www.macstories.net/news/apple-and-oracle-announce-ope...
- jcromartie 15y agoApple maintain their own release of the JVM for OS X.
- X-Istence 15y agoNo, this has changed. With the start of Lion Apple is no longer the gatekeeper and as was previously reported they are working with Oracle to create new releases of OpenJDK which is why people like myself are wondering where the release is since Apple was stepping away from being the gatekeeper.
- 15y ago
- j_col 15y agoYou can now finally use a string in a switch statement, hurray (it's the little things that make me happy)! http://download.oracle.com/javase/7/docs/technotes/guides/language/strings-switch.html http://download.oracle.com/javase/7/docs/technotes/guides/la...
- st3fan 15y agoIntelliJ IDEA strongly suggests to turn those Strings into constants. And then to turn those constants into an Enum. Oh wait, we could also switch() on Enum values! I'm sure this is useful in some cases though :-)
- dxbydt 15y agoGod, I seriously hope string-switching doesn't catch on. In a prev job, I saw this block of code - ------- public int getDaysInMonth( String month ) { if( month.equalsIgnoreCase("january")) return 31; else if( month.equalsIgnoreCase("february")) return 28; else if( month.equalsIgnoreCase("march")) return 31; else if( month.equalsIgnoreCase("april")) return 30; ... } ------- My eyes bled. I said folks, just map the month to an int M in range [1..12] and simply write 1 line of code return 30+((M+Math.floor(M/8))%2; ( except for 2, which is 28 or 29 depending on a leap year) I was overruled. "We are programmers, not mathematicians" was the response!!! Now they'll happily use this string-switch to do --------- switch( month.toLowerCase() ) { case "january" return 31; case "february" return 28; case "march" return 31; case "april" return 30; ... default : return -1; } ------- which is an even nastier abomination :(
- famousactress 15y agoMeh. The world turns. I spent a decade developing primarily in Java, and the last few years were really disappointing. The community splintered, the language and platform really lost any ability to maintain momentum. I might have been stoked about Java 7 three years ago (when it should have come out).
- bethling 15y agoI don't know if I agree. The Java language has floundered (I've been stuck coding in it for the last couple of years), but I think the platform/JVM has started becoming used more and more often for new + exciting language options. The new release should make implementing dynamic languages on top of the JVM easiser, and could open the doors for a lot of interesting options.
- davedx 15y agoI don't think I would say it's floundered. I came back to Java last year after 10 years of C++, and was really pleasantly surprised: Programming in Java now is a nice experience. I would say it has matured, not floundered.
- bethling 15y agoI think it depends on the time frame you look at. I started in Java back w/ some of the pre 1.0 releases. Between then and now, it's come a really long way. Maybe I'm biased due to other new(er) languages becoming mainstream. But it feels like Java (as a language) has fallen behind as other Languages adopt new features that cater to different/modern techniques. Java won't ever be cutting edge (and given the types of applications that are built with it, some stability/maturity makes a lot of sense), but look at the advances that C# has made since 1.5/1.6 has been out. It wasn't like C++ pre C+11 -it didn't take a decade or soto catch up with the rest of the programming world, but you can see the its size slowing its advancement down. I want to like programming in Java again (I'm not saying it's bad, or it's a mistake) - for a long time it was my go-to language for when I play with ideas. But for now it's just a way to pay the bills while I try to figure out what I want to do/make/build.
- nextparadigms 15y agoDoes it come with more patents? Serious question. I'm thinking Oracle tried to put a lot more locks on this version of Java, to make it theirs, and not so open source anymore.
- wmf 15y agoWasn't the feature freeze before Oracle bought Sun?
- zmmmmm 15y agoAh, but patents, wonderful things that they are, protect implementations more than they protect features. It's very easy to implement the same feature in different ways, ones that are patent protected if you know how. Having said that, GPL in theory ensures users and even people making derivatives of Java are protected from patent action by Oracle.
- zszugyi 15y agoToo little, too late.
- rubyorchard 15y agoToo little to show for 5 years.
- cfontes 15y agoyeah but Sun was sold, and other stuff happened. I think it's already great that there is a release with some syntax features that are useful and other nice to have things too. I think Java 8 will come fast there are plenty of new langs now they can't miss the point otherwise companies will continue to migrate to faster evolving languages with faster developing times.
- nknight 15y ago"The company went through massive changes" might work as an _explanation_, and perhaps absolve particular individuals of responsibility, but it doesn't change the reality. Programming doesn't just wait for Sun/Oracle/Java or any other company/language to get its act together any more than any other industry holds steady until one of the participants wakes up.
- bad_user 15y agootherwise companies will continue to migrate to faster evolving languages That still use the patent-encumbered JVM.
- felipemnoa 15y ago>>faster evolving languages with faster developing times. Could you provide citations of any studies done please. i.e. How development times differ for small projects and large projects. For small projects I could see other languages being faster, what about large project or really large projects?
- cfontes 15y agoI cannot, and I think no one can. There is simply not enough data about it, this could easly become a Masters thesis and I would love to read it. This is just my feeling about Java comparing to some of the new and not so new languages that are evolving in months while java takes years. I am a Java programmer that likes to experience with other langs so don't get me wrong java is an awesome tool and I love working with it, but I think there are other very good tools emerging and getting more and more reliable.
- nkassis 15y agoSo for languages like Clojure,Scala does this offer any new feature for them?
- bensummers 15y agoFor dynamic JVM languages, the new invokedynamic bytecode is a huge performance boost.
- Mitt 15y agoProbably not. See what Rich Hickey said about this: http://clojure-log.n01se.net/date/2008-09-03.html#09:13a http://clojure-log.n01se.net/date/2008-09-03.html#09:13a
- runevault 15y agoFor clojure no, but jRuby and several similar languages are getting a huge boost.
- PyErr_SetString 15y agoHave you seen any actual numbers on this? I've googled around a bit and can't seem to find any.
- runevault 15y agoJRuby developer Charles Nutter claims that Java JDK7 gives a performance boost to JRuby, saying "On bench_threaded_reverse, Java 7 is 20% faster than Java 6, and JRuby plus invokedynamic is 20% faster than that".[1] From http://en.wikipedia.org/wiki/JRuby http://en.wikipedia.org/wiki/JRuby with the [1] being https://twitter.com/#!/headius/status/78282122997149696 https://twitter.com/#!/headius/status/78282122997149696
- kingkilr 15y agoI'm a little disappointed that people are still talking about tagged ints. There are so many better ways to avoid the overheap of integers being a refrence type (namely type specializing everything under the sun, particularly your JIT'd code and data structures).
- kennystone 15y agoGood for Oracle. There are (reasonable) concerns about their ownership of Java, but at least it's moving forward again.
- czDev 15y agooh man, can't wait to use closures in my Java code
- cpeterso 15y agoUnfortunately, you'll have to wait (until Java 8).
- dmitrykoval 15y agoHave anyone done any performance comparison with the openjdk yet? GC related tests would be of high interest :)
- kragen 15y agoLooks like this version is not open source. Is there an open-source version of Java 7? Edit: Yes! http://openjdk.java.net/ http://openjdk.java.net/ has an announcement at http://mail.openjdk.java.net/pipermail/announce/2011-July/000106.html http://mail.openjdk.java.net/pipermail/announce/2011-July/00.... So why would anybody "accept the Oracle Binary Code License Agreement for Java SE"?
- spullara 15y agoIt is called openjdk: http://openjdk.java.net/ http://openjdk.java.net/
- metra 15y agoThe OpenJDK may have more bugs. Check out [http://stackoverflow.com/questions/1977238/why-should-i-use-the-sun-jdk-over-the-openjdk-or-vice-versa http://stackoverflow.com/questions/1977238/why-should-i-use-...].
- gmartres 15y agoFUD. They're pretty much the same code base. Also "Moving to OpenJDK as the official Java SE 7 Reference Implementation": http://blogs.oracle.com/henrik/entry/moving_to_openjdk_as_the http://blogs.oracle.com/henrik/entry/moving_to_openjdk_as_th...
- elehack 15y agoIn my experience, OpenJDK has fewer bugs - at least the ones I care about. Like Swing making bad assumptions about the WM, including that only a small fixed number of window managers are tiling (OpenJDK works on XMonad, Java 6u21 does not).
- y0ghur7_xxx 15y ago> So why would anybody "accept the Oracle Binary Code License Agreement for Java SE"? Anybody who wants Oracle commercial support: http://www.oracle.com/technetwork/java/javase/community/opensourcejdk-jsp-136417.html http://www.oracle.com/technetwork/java/javase/community/open... Oracle's Commercial Distribution of the JDK People who want the benefits of commercial support and predictability can choose to use Oracle's commercial distribution of the Java SE JDK or JRE. Oracle's commercial JDK releases will be built from the open-source code, for the most part. Since there's some encumbered code in the JDK, Oracle will continue to use that code in commercial releases until it is replaced by fully-functional open-source alternatives. To learn more about development and deployment support options, visit the Java Support site.
- spullara 15y agoInvokeDynamic is a pretty awesome new feature in JDK7 and will likely be tranformative for dyanmic languages on the JVM. For my mustache.java templating solution it increased performance on an integration benchmark by 25%. http://groups.google.com/group/mustachejava/browse_thread/thread/24b6c59d2ea55f04 http://groups.google.com/group/mustachejava/browse_thread/th...
- jzoidberg 15y agoAwesome IO stuff - finally we have great cross platform file handling.
- rkalla 15y agoThere is a good amount of stuff to get excited about in this release. - Try-with-resources-Catch-Block [0] - Fork/Join libraries from Doug Lea (author of Executor framework) [1] - Inferred/Simpler generics in declarations (should have been in Java 5) - NIO2, brand new/robust filesystem APIs [2] - NIO2, treat ZIP/JAR files like directories of files for R/W [3] - SDP support [4] - String-in-switch (NOTE: check on performance implications of this for tight loops) NOTE: Read through "COMPILATION" section here for details [6] - Elliptic curve cryptography (when normal curves just don't cut it) - Underscores in numbers (e.g. int million = 1_000_000;) - XRender pipeline on Linux (Swing/Java2D rendering get a big boost) - New sound synthesizer (replaces a proprietary lib that wasn't OS) - XML stack finally got updated across the board. - InvokeDynamic (already talked about numerous times below) - Other Swing stuff I'm not all that pumped about. I think the most exciting items are: 1. Try-with-resources 2. NIO2 filesystem API 3. InvokeDynamic Features that got pushed to 8 (next year) that will be really exciting: - Modular programming (super packages? think OSGi-lite) - Syntactic Sugar: Collection literals List<String> people = {"Frank", "Mary", "Satan"}; - Closures - Modularization of the JDK (JDK gets broken into core modules) And one that I can't get confirmation on if it's in 7 or got pushed, index-access for List and Maps [5]: - List<String> people = {"Frank", "Mary", "Satan"}; System.out.println("Hello " + people[0]); I understand that a lot of people don't find Java sexy any more, that is understandable, it has become a platform for what seems like a lot of next-series of languages. That being said, I've been working with Java since 1998 and still love it. I know people get a big kick out of writing code with no exception handlers and no curly braces, and programming is a creative/artistic process so you have to do what feels good... but none of that stuff ever bothered me. I like being a pedantic programmer. [0] http://www.javacodegeeks.com/2011/07/java-7-try-with-resources-explained.html http://www.javacodegeeks.com/2011/07/java-7-try-with-resourc... [1] http://artisans-serverintellect-com.si-eioswww6.com/default.asp?W9 http://artisans-serverintellect-com.si-eioswww6.com/default.... [2] http://openjdk.java.net/projects/jdk7/features/#f250 http://openjdk.java.net/projects/jdk7/features/#f250 [3] http://openjdk.java.net/projects/jdk7/features/#fa537814 http://openjdk.java.net/projects/jdk7/features/#fa537814 [4] http://openjdk.java.net/projects/jdk7/features/#f639 http://openjdk.java.net/projects/jdk7/features/#f639 [5] http://mail.openjdk.java.net/pipermail/coin-dev/2009-March/001108.html http://mail.openjdk.java.net/pipermail/coin-dev/2009-March/0... [6] http://mail.openjdk.java.net/pipermail/coin-dev/2009-February/000001.html http://mail.openjdk.java.net/pipermail/coin-dev/2009-Februar...
- fleitz 15y agoAwesome, so java finally has closures & lambdas?
- macmac 15y agoWatch out for the Commercial Features as defined in table 1.1 of this document http://www.oracle.com/technetwork/java/javase/documentation/java-se-product-editions-397069.pdf http://www.oracle.com/technetwork/java/javase/documentation/... Commercial Features appears to be jRockit technology.
- coverband 15y agoDid they always have this clause in the Java license, or is it new to Oracle's release? "These Supplemental License Terms add to or modify the terms of the Binary Code License Agreement.... A. COMMERCIAL FEATURES. You may not use the Commercial Features for running Programs, Java applets or applications in your internal business operations or for any commercial or production purpose, or for any purpose other than as set forth in Sections B, C, D and E of these Supplemental Terms. If You want to use the Commercial Features for any purpose other than as permitted in this Agreement, You must obtain a separate license from Oracle." Sections mentioned are: B. SOFTWARE INTERNAL USE FOR DEVELOPMENT LICENSE GRANT. ... Oracle grants you a non-exclusive, non-transferable, limited license without fees to reproduce internally and use internally the Software complete and unmodified for the purpose of designing, developing, and testing your Programs. C. LICENSE TO DISTRIBUTE SOFTWARE. ... Oracle grants you a non-exclusive, non-transferable, limited license without fees to reproduce and distribute the Software, provided that (i) you distribute the Software complete and unmodified and only bundled as part of, and for the sole purpose of running, your Programs, (ii) the Programs add significant and primary functionality to the Software, (iii) you do not distribute additional software intended to replace any component(s) of the Software, (iv) you do not remove or alter any proprietary legends or notices contained in the Software, (v) you only distribute the Software subject to a license agreement that: (a) is a complete, unmodified reproduction of this Agreement; or (b) protects Oracle's interests consistent with the terms contained in this Agreement and that includes the notice ... D. LICENSE TO DISTRIBUTE REDISTRIBUTABLES. ... Oracle grants you a non-exclusive, non-transferable, limited license without fees to reproduce and distribute those files specifically identified as redistributable in the README File ("Redistributables") ... E. DISTRIBUTION BY PUBLISHERS. This section pertains to your distribution of the JavaTM SE Development Kit Software with your printed book or magazine .... Maybe I'm reading too much into it, because of the Android lawsuit?
- SoftwareMaven 15y agoWithout the definitions (especially of "Commercial Features", this doesn't really mean much. I'm sure restrictions and rules on distribution have always existed, since we ran into issues with redistributing tools.jar back in 1999/2000.
- 15y ago
- gmosx 15y agoA great release (professionally handled by Oracle), but still I am waiting for Java 8 (esp. closures + modules)
- gnoupi 15y agoPity though that Swing didn't get much love in this release. But I guess that's the course of things.
- suprgeek 15y agoMaking sure that the people excited about Java 7 wait until this gets patched http://news.ycombinator.com/item?id=2820204 http://news.ycombinator.com/item?id=2820204
- msx 15y agohttp://mail-archives.apache.org/mod_mbox/lucene-java-user/201107.mbox/%3C001601cc4d6b$37618880$a6249980$@apache.org%3E http://mail-archives.apache.org/mod_mbox/lucene-java-user/20... that worried me little bit. what do you think ?
- sgt 15y agoHaving created several "enterprise" systems in Java, I'm now looking into Mono, because there are some aspects of Java that I'm simply tired of having to deal with again and again. So far it looks very interesting and it works really well on Linux and OS X. Anyone here got experience with using Mono (and possibly Fluent NHibernate, WCF, ASP.NET MVC, etc) in the "enterprise" environment?