Recently in java Category

Will C++ get Closures before Java does?

| 1 Comment

I just read that closures are being added to C++ [PDF link].

A note to Sun: you know your language is falling embarrassingly behind if the C++ standards committee can move more nimbly than you can!

(For those who aren't already sick of reading about closures in Java, Neal Gafter is developing a prototype Java compiler that supports closures, and he even has a JSR proposal drafted and ready to go.)

New Java 7 Column on java.net

The first article of my new column on Java 7 is now up on java.net.

In the article I discuss the jdk7 and OpenJDK projects at java.net, mention some projects that are being developed openly and might become part of Java 7, and speculate that, because of schedule constraints, Java 7 might include a lot less than we were told to expect 10 months ago.

Future installments of the column will, I hope, go into more depth with specific APIs and will actually include code examples.

Desolation Row Revisited

Jan Lewis has written and recorded a great version of Desolation Row well suited to current events. You can hear and watch at http://www.youtube.com/watch?v=MQNBJpapIpQ.

Jan says he's a Java programmer, which allows me to make the weak case that this post is appropriate on this blog. New blog editorial policy: I'll consider linking to war protest songs written, recorded, or even just submitted by Java and JavaScript programmers and their ilk! :-)

If you're not a Bob Dylan fan, you may not be able to fully appreciate Jan's song, but it is still good. See my last post from December 2006 for the lyrics to the first verse of the original

Major Java News from Sun Due Monday

I'm told that Sun will have a major announcement about Java on Monday November 13th.

Details will be (but are not yet) at this URL: http://www.sun.com/opensource/java

Surmise what you will from the URL path...

Groovy Spec. Lead Change

| 2 Comments

Remember Groovy, the JVM-based scripting language that the Java world was abuzz about? I gather that it has bogged down in the JSR process, and all the buzz seems to have faded away. I don't know if this means anything, but the following email just came in from the JCP:

To: JCP-INTEREST(at)java.sun.com
From: Liz Kiener
Subject: JSR 241 - Spec Lead Change - The Groovy Programming Language
------
The Spec Lead of JSR 241 has changed from James Strachan to
Guillaume Laforge.

I don't know James or Guillaume, and I don't even know Groovy, for that matter. But wouldn't it be nice if this change got us a standardized version of Groovy sooner?

Detailed list of Java 6 changes

| 1 Comment

Sun has published a list of Java 6 changes to existing APIs. I don't think that any of these changes are particularly new, but the list itself appears to be new. Seeing all the changes collected in one place was useful. Highlights for me included:

java.util.Arrays.copyOf()     // Easier than System.arraycopy
java.io.File.getUsableSpace() // Free space on filesystem?
java.awt.Desktop              // Launch web browser, etc.
java.awt.SystemTray           // Put an icon in the tray
java.awt.font.TextAttribute.KERNING_ON  // Fancy text layout

Note that this list does not include brand new APIs, like the Scripting API and Compiler API that are in Java 6. For a list of those, see JSR 270.

java.io.Console

| 1 Comment

Build 57 of Java 6 includes a new class java.io.Console.

Javadocs are at the link above. And you can also leran more at Alan Bateman's blog .

Highlights:

  • Obtain the Console object with System.console(). It returns null if there is no console.
  • a readPassword() method for reading input that is not echoed on the console
  • a readLine() method for reading input from the user. Much simpler than wrapping a BufferedReader around an InputStreamReader around System.in
  • Also supports printf() and format() methods just like System.out does.

Shrinking Java in a Nutshell

| 14 Comments

Matt Croydon writes at his blog you know your programming language is complicated when Java in a Nutshell has 1284 pages and weighs 3.2 pounds.

I know! And I worry about this. And with Java 6.0 in the works, it is only going to get bigger...

Unless some clever reader can think of a way to shrink it!

Comments are open...

Example: using JavaScript in Java

| 2 Comments | 1 TrackBack

Java 6.0 ("Mustang") includes a JavaScript interpreter and a javax.script package for interacting with it. The code below is an example of how it works...

J2SE is Dead. Long Live Java SE!

I got email today from the JCP. JSR-270 (the umbrella JSR for Java 6) has changed its name:

The Spec Lead of the following specification

   JSR-000270 J2SE 6.0 ("Mustang") Release Contents

has updated the name of the JSR to be

   JSR-000270 Java SE 6 ("Mustang") Release Contents

The 2 is finally gone! J2SE is now "Java SE"!

Books

Comprehensive coverage of Ruby 1.8 and 1.9

"The New Most Important Ruby Book"
Peter Cooper,
rubyinside.com

Completely updated for Ajax and Web 2.0

"A must-have reference"
Brendan Eich,
creator of JavaScript

The classic Java quick-reference