Confusion about writing JDK 1.5 code with IDEA 4.0

I noticed that the documentation on www.intellij.com mentions that IDEA 4.0
works out of the box with the JDK 1.5 beta. This was news to me, so I
decided to try it out. The results were slightly confusing...

The claim about JDK 1.5 support seems to be correct: I was able to use
generic types when I had my project JDK set to the 1.5 beta, but the same
code was (rightly) flagged as an error when the JDK was set to 1.4.2.

All of the UI references to generics are what confuse matters. They only
seem to be relevant to the old JSR-14 compiler. What was actually required
to get 1.5 code compiling with generics is the "-source 1.5" (and,
optionally, the "-target 1.5") switch.

Two suggestions:

1. Change the wording of the "Set up generics" and "Use generics-enabled
compiler" options to make it clear that they're only relevant to the JSR-14
compiler release and not to JDK 1.5.

2. Have the IDE automatically supply the "-source 1.5" option if generics
are being used with JDK 1.5. (On a related note, it'd be nice to do
something similar for code which uses assert statements on a 1.4 or greater
JDK).

Cheers,
Vil
--
Vilya Harvey
vilya.harvey@digitalsteps.com / digital steps /
(W) +44 (0)1483 469 480
(M) +44 (0)7816 678 457 http://www.digitalsteps.com/

4 comments

The impression you got about IntelliJ supporting the old JSR-14 compiler is true ^^ Well, you can compile using the 1.5 beta, but there are a few tricks, as you already discovered: you need to add "-source 1.5" to extra commandline options and you should NOT check the "use generics enabled compiler". Also, of all the new 1.5 features only generics are supported.

I'm disappointed to see 1.5 support as a key feature in the .com site. JetBrains guys preached that 1.5 is beta, and thus non-priority for them, and that we should wait for a post-Aurora EAP to have full 1.5 support. Now, 4.0 is out and the jetbrainers used the occasional generics support as a selling point.]]>

0

Vilya Harvey wrote:

I noticed that the documentation on www.intellij.com mentions that IDEA
4.0 works out of the box with the JDK 1.5 beta. This was news to me, so I
decided to try it out. The results were slightly confusing...

The claim about JDK 1.5 support seems to be correct: I was able to use
generic types when I had my project JDK set to the 1.5 beta, but the same
code was (rightly) flagged as an error when the JDK was set to 1.4.2.

All of the UI references to generics are what confuse matters. They only
seem to be relevant to the old JSR-14 compiler. What was actually required
to get 1.5 code compiling with generics is the "-source 1.5" (and,
optionally, the "-target 1.5") switch.

Two suggestions:

1. Change the wording of the "Set up generics" and "Use generics-enabled
compiler" options to make it clear that they're only relevant to the
JSR-14 compiler release and not to JDK 1.5.

2. Have the IDE automatically supply the "-source 1.5" option if generics
are being used with JDK 1.5. (On a related note, it'd be nice to do
something similar for code which uses assert statements on a 1.4 or
greater JDK).

Cheers,
Vil


Vilya,
you are dead right here. We will definitely fix the docs.

Friendly,
Dmitry

--
Dmitry Lomov
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0

Marcus Brito wrote:

The impression you got about IntelliJ supporting the old JSR-14 compiler
is true ^^ Well, you can compile using the 1.5 beta, but there are a few
tricks, as you already discovered: you need to add "-source 1.5" to extra
commandline options and you should NOT check the "use generics enabled
compiler". Also, of all the new 1.5 features only generics are supported.

<rant>I'm disappointed to see 1.5 support as a key feature in the .com
site. JetBrains guys preached that 1.5 is beta, and thus non-priority for
them, and that we should wait for a post-Aurora EAP to have full 1.5
support. Now, 4.0 is out and the jetbrainers used the occasional generics
support as a selling point.</rant>


I fail to see any actual point in this rant. There are no false statements
in what we said (BTW, we never said that 1.5 is non-priority).
I do not see anything wrong in using some - any - feature that we have as
as selling point.

As to "occasional" support: come on, 1.5 is in it's beta only for about 2
weeks.

Friendly,
Dmitry
--
Dmitry Lomov
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0

I must remeber to NOT write anything before my first mug of coffee in the morning or else it will be as pointless as the above rant, although I never intended to say that JetBrains is using false statements or anything like that.

I was just saying that I expected a more heartfelt commitment to supporting the 1.5 features if they were to use this as a selling point. But then, Lomov is completly right: 1.5 beta is out for just two weeks -- and moreover, now that Aurora is finally released I'm sure that full 1.5 support is in the feature list for a future maintenance release.

As I said: no writing before coffee... no writing before coffe... no writing before coffe...

0

Please sign in to leave a comment.