Friday Java Quiz: What Does -source 1.4 Really Mean?
Today's quiz has to do with the -source and -target command line switches of the javac command. We are all familiar with these switches.
But do we really know how they work?
Suppose I have just built a new Debian 4.0 box, and installed Sun Java 5 on it. There are no other versions of Java installed on the box. Without actually invoking the compiler, answer the following question.
Will the following Foo.java:
public class Foo {
public static void main(String[] args) {
StringBuilder sb = new StringBuilder();
sb.append("Hello, world.\n");
System.out.println(sb.toString());
}
}
compile successfully with the following command line:
javac -source 1.4 Foo.java
?
What about the following command line:
javac -source 1.4 -target 1.4 Foo.java
?
Explain why.
[Update] I should have mentioned that this is a two part question. And here is the second part. Answer the same questions for this class:
public class Bar {
public static void main(String[] args) {
System.out.printf("Hello, world.");
}
}
Flash Player 9 for 64-Bit Debian 4.0: Here's The Link
It took 37 days since I installed 64-bit Debian 4.0 on my amd64 machine, but I've finally gotten Flash Player 9 to work in my browser.
There are several reasons for the 37 days delay. The biggest reason is that the procedure I followed, which is the "I'm Feeling Lucky" page for the Google search for "nspluginwrapper etch", is not the obvious search target for anyone who want to get YouTube going on an amd64 Debian 4.0 installation.
Most of my time is spent on the transition from searching for "Flash 9 Debian 4.0 amd64" to searching for "nspluginwrapper etch". It went something like this:
- I want Flash
- But Flash doesn't work for 64-bit browsers
- I can install a 32-bit browser, but that's going to be painful
- Wait a minute, there is this thing called nspluginwrapper that will allow me to use the 32-bit Flash player with 64-bit browsers
- But feta search nspluginwrapper turned up nothing
- I'm going to build nspluginwrapper myself
- The ./configure script complains about GLIB 2.0 not being available. Surely it's available, how else could I have run a GNOME desktop?
- Oh, I need 32-bit GLIB 2.0. How do I get it?
- It should be in ia32-libs-gtk. But I can't find it. I can find ia32-libs, but not ia32-libs-gtk
- I hope I don't have to rebuild the 32-bit Gtk+.
- Someone must have done it. Let me search for "ia32-libs-gtk etch" (I know Debian people likes to use names like Sarge or Etch or Sid to describe the OS version)
- Bingo! There it is—ia32-libs-gtk and nspluginwrapper. All packaged up for Debian 4.0 amd64, ready to be installed.
The whole point of this post is to show you the detours I've taken to get a functioning Flash Player 9 on Debian 4.0 (Etch) amd64 so that you can go directly to the destination.
Link to this blog, or better yet, link to http://www.dipconsultants.com/debian/, if you find it useful.
And Oh, Thank you, Markybob.
My Firefox, Uh, Iceweasal, Still Does This
In Does Your Firefox Do This?, (posted 576 days ago), I showed how the Firefox browser that came with the Linux distribution I was using at the time, Fedora Core 3 (or 4), won't print page headers or footers.
Well, since then, on every version of Linux installation that I did, I've had to manually adjust the settings. I just adjusted the settings for the Iceweasel browser in my new Debian 4.0 installation.
I'm annoyed enough by this that I want to file a bug report with whoever is in control of those four little numbers. The problem is, I don't know who they are. Can anybody help?
Sun Launches Free Software JavaFX Compiler Project
Sun launched the promised JavaFX Script compiler project on Java.net today:
openjfx-compiler project on Java.net: The OpenJFX Compiler project is an OpenJFX incubator project. It will focus on creating a JavaFX compiler to translate JavaFX scripts into JVM class files (bytecode). This compiler will leverage and extend the JDK's javac compiler capabilities and, hence, will benefit from all of the engineering efforts that have already been put into javac.
Currently, the compiler is still in the early stages of its design and there is no compiler available yet. The source code from the project's Subversion repository can be built into a tool, which can compile simple, non-GUI JavaFX Script applications. But a full-language compiler is yet to be designed and developed.
We are opening this project so that the OpenJFX community members can participate in its design. We welcome participation by allowing the OpenJFX community members to browse the source code, review and address issues, contribute to the Wiki, and join the discussion aliases. Together we can define and develop a first-class compiler and runtime for the JavaFX Script language.
Meanwhile, a new tar ball release of JavaFX Script is available:
openjfx project on Java.net: The following list provides information on what's included in the July 2007 release:
- Announcement of the new OpenJFX Compiler Incubator Project - (more info)
- Casual - a demo of an InstantMessaging (IM) client written in JavaFX Script is available
- SVG to JavaFX Translator - converts an SVG document into a single JavaFX class
- JavaFXPad-like functionality is now integrated in the JavaFX plugin for NetBeans 6.0 Preview releases (Milestone 9 and beyond). The feature is enabled by clicking the Preview button in the Editor window's toolbar. This functionality allows you to preview a JavaFX application's UI without actually executing the application.
- Updated JavaFX plugins for NetBeans 5.5 and NetBeans 6.0 (M9 and beyond) releases.
Version Stagnation
Do you use vi? How do you quit your session?
:wqor
ZZ?
Do you use bash? How do you redirect both stdout and stderr to a file?
command > file 2>&1or
command &> file?
Do you ware sweaters or T-shirts? How do you take them off?
Reaching behind your shoulder to grab the back of the collar and pull it over your head
orCrossing your arms in front of you to grab the bottom hem and pull it inside-out and up
?If you answered yes to the above questions but are aware of only one of the alternatives, you suffer from what I call "version stagnation".
Version stagnation happens when, as you pursue a piece of knowledge or a technique, you get to a place you feel pretty comfortable with what you have learned, and simply stopped learning any further for the lack of meaningful returns from such efforts.
In a chat with Brian and Brian on Monday, I mentioned that my Ant skill seems to have frozen at the Ant 1.4 level. Ant 1.4 was the last version of Ant in use when I did a lot of Ant build file development. I did read the release notes for later versions of Ant and am familiar with the new features they introduced. I just haven't used those features extensively.
A lot of Python programmers (me included) are not aware of the so-called new style classes. Sure we've heard of the name, and maybe even read an article or two. But the novelty soon worn off, and we revert back to using whatever we are most familiar with.
The reason for this entry is this Tim Bray post, which references this piece "On PHP". They are talking about the apparent PHP 4 vs. PHP 5 war and the looming Ruby 1 vs. Ruby 2 war. However the concept applies to a broader family of things.
I have written about this 1074 days ago. See this post. I thought it was a good thing then. I still see it as a good thing now.
Quote Of The Day
(It's Tuesday. You need something to get your spirit up.)
Yes, the build is broken. You will have to work without the build for a while.
JavaFX Script At The JUG Tonight
I will be talking about JavaFX Script at the St. Louis Java Users Group tonight.
There will be one IntelliJ IDEA 6 license to be given away to an audience member at the meeting.
Come!
[Update] The presentation material is posted to both St. Louis JUG website and my articles page.
OpenDDS 1.0 Released
OpenDDS.org:1.0 Released
We are pleased to announce the release of OpenDDS version 1.0!
- This product has been renamed to OpenDDS from "TAO DDS"
- The default participant setting for Built-In-Topics (BITs) is now "on"
- Simplified .mpc and .mpb files
- Supported built-in sequences (the CORBA::*Seq sequences)
- The DDS entities (e.g. DomainParticipant, FooDataReader) have changed from remote IDL types to local IDL types and the data sequence and info sequence types have changed from normal IDL sequences to types with extra functionality required to support zero-copy reads. This change requires changes to DDS user code.
- Made the sub/pub repo id generated by DCPSInfoRepo to be unique per DCPSInfoRepo instance instead of being unique per domain. This allows multiple domains in the same process (connecting to the same DCPSInfoRepo instance) to share the same transport.
See the Release Notes for details.
OpenDDS is an open-source C++ implementation of the Object Management Group's specification "Data Distribution Service for Real-time Systems". OpenDDS is built on the ACE (ADAPTIVE Communication Environment) abstraction layer to provide platform portability. OpenDDS also leverages capabilities of TAO (The ACE Orb), such as its IDL compiler and as the basis of the OpenDDS DCPS Information Repository (DCPSInfoRepo).
Congratulations to the OCI OpenDDS team (Adam, Jonathan, Steve, and others) for pushing the 1.0 release out.
AJaX This!
With all the AJaX hype in the last two and half years, two of the most obvious candidates for AJaXification in regular websites remain unmodernized. One is the "Printer Friendly Version" link. The other is the "Increase Font Size" link:
There are only six months left in the three-year hype cycle for AJaX. So please, fix all the "Printer Friendly Version" links on all the websites so that they don't cause a total refresh of the web page.