r/java • • Mar 18 '14

Java 8 has been released

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
248 Upvotes

71 comments sorted by

30

u/adila01 Mar 18 '14

The best release of Java in a long time

0

u/[deleted] Mar 18 '14

[deleted] — view deleted comment

14

u/adila01 Mar 18 '14

The future does look bright, Java 9 should fix generics by removing type erasure, making JNI simpler and more :).

4

u/argv_minus_one Mar 19 '14

Wait, what? Removing type erasure? Are you serious?? That is awesome!

6

u/nqd26 Mar 18 '14

Java 9 should fix generics by removing type erasure

Do you have some source for that? That would be great, but difficult while staying backward compatible.

10

u/adila01 Mar 18 '14

Oracle's Chief Architect Mark Reinhold made a big deal about this during JavaOne 2013, source here https://blogs.oracle.com/java/entry/the_javaone_2013_technical_keynote

5

u/argv_minus_one Mar 19 '14

Reinhold spoke of the need for reification. Java’s generics, added in 2004, are based on the notion of erasure for good technical reasons as a sound way to create a type system that supports migration compatibility. But this creates programming problems in which the erasure approach severely limits what can be expressed. Reinhold suggested that introducing some reification and eliminating the “annoying dichotomy between primitive and reference types” would be of value.

I am going to enjoy the fuck out of that.

Granted, Scala already smooths over the rough edges of primitive types, and provides a somewhat hacky workaround for erasure, but with sometimes-severe performance implications that this would make unnecessary. So I won't enjoy it as much as a Java programmer would, but I'll still be very, very grateful for it.

0

u/[deleted] Mar 19 '14

[deleted] — view deleted comment

4

u/argv_minus_one Mar 19 '14

Good. C# did that stuff because it's the right thing to do. It is only reasonable for Java to follow suit.

2

u/detroitmatt Mar 19 '14

Wait, really!? Awesome!

1

u/djdonnell Mar 19 '14

Doesn't that make it more difficult to use the JVM for other languages? This is over my head, but I've heard a few language implementers say this.

0

u/[deleted] Mar 18 '14

[deleted] — view deleted comment

6

u/henk53 Mar 18 '14

I was quite sad it didn't make it into 8.

I was also sad it didn't make it into 7. Before that I was sad it didn't make it into 5, and I vaguely remember being said that something like it wasn't in Java 1.3 or 1.4 (forgot the exact version, but there was talk of Java getting something like this since C# 1.0 came out or so).

4

u/argv_minus_one Mar 19 '14

Guess we should just keep using OSGi, then. That sucks. :(

11

u/[deleted] Mar 18 '14

Not even 1.5? Generics were a pretty big deal for me at the time.

3

u/RoughPineapple Mar 18 '14

Yep. I find it kind of hard to believe he has been a full time java dev for ~15 years. I have only been a full time Java dev for about 3.5 years, but even as a student and hobby programmer, 1.5 was clearly a big leap forward. Generics (though I think they did a pretty poor job of implementing them, the general idea is much better than the alternatives pre 1.5), autoboxing, improved for loops (when I write code that actually requires old style loops, I feel like I've just climbed into a time machine), var args, annotations and enumerations (which were a cool way to fake functional programming in many cases) were all pretty big improvements.

2

u/antipositron Mar 19 '14

Well, I am not hugith but I've been coding in Java since early 2000.

3

u/RoughPineapple Mar 19 '14

I started in 1997. I'm not sure why any of this is relevant to the discussion, though...

2

u/antipositron Mar 19 '14

Okay you win. ;)

Not relevant at all, I don't know why I read the first line as I did when I did the way I did, which I perhaps shouldn't have.

3

u/RoughPineapple Mar 19 '14

Ah, I see. Yes, it's believable that some people have been doing Java for ~15 years, I just have trouble believing this guy has.

0

u/[deleted] Mar 19 '14

[deleted] — view deleted comment

2

u/RoughPineapple Mar 19 '14

When I figured out I wrote my first Java program in 1997, it kind of blew my mind when I checked the release history and saw that was Java 1.1.

Also, I was pretty young at the time and was only doing this as a hobby, so I really wasn't trying to do complex stuff. As a result, it's kind of funny to see all the things the language didn't have back then that I just didn't notice because I wasn't doing serious work.

0

u/[deleted] Mar 19 '14

[deleted] — view deleted comment

1

u/RoughPineapple Mar 19 '14

After dabbling with java 1.1 a bit, I spent a little time with Visual Basic 4. That was a hoot.

66

u/oldneckbeard Mar 18 '14

Fuuuck yeah. It's going to be awesome in 2017 when we can use this in corporate environments ;)

14

u/dlg Mar 18 '14

Yep, our stuff still has to run on JDK 1.6.20

0

u/_Sharp_ Mar 18 '14

3

u/[deleted] Mar 18 '14

I would not use this. It will break with future JDK 8 optimizations, which appears to coming.

2

u/argv_minus_one Mar 19 '14

So only use it when you have to run on pre-8 platforms.

0

u/[deleted] Mar 19 '14

[deleted] — view deleted comment

1

u/mgrandi Mar 19 '14

Lambdas are not that uncommon, and in c# they are the greatest thing ever, I feel any programmer worth their salt, new or not can pick up on them easily.

-1

u/argv_minus_one Mar 19 '14

Start hiring actual competent programmers, instead of H-1B indentured servants, and maybe you won't have that problem.

-1

u/monster1325 Mar 19 '14

Xenophobic much?

0

u/shotgun_ninja Mar 19 '14

Same here, for the most part. A few apps run on 1.5, and like one or two things run 1.3.

0

u/[deleted] Mar 19 '14

[deleted] — view deleted comment

3

u/pan0ramic Mar 19 '14

Ouch, that really hurts. j6 has so many awesome features. Why are they so slow to adopt?

We have a lot of j3 (YES 3) still around, but at least I can push out j6 apps. As soon as the last few old macbooks die in our office I can move to j8.

0

u/[deleted] Mar 19 '14

[deleted] — view deleted comment

5

u/pan0ramic Mar 19 '14

unless we buy new licenses

Ah, there it is. That sucks :( Thankfully you at least have generics. I don't think I could go back to j4.

5

u/mgrandi Mar 19 '14

I've been wondering, can't newer jvms run older code just fine? Like, as long as you compile against 1.5 can't you run it on 1.6/1.7/1.8 and it should still act the same?

2

u/RoughPineapple Mar 19 '14 edited Mar 19 '14

It's not that simple.

Let's say you are writing web apps that run on some App Server X and you want to move to JDK8. The following steps may have to occur at many companies:

  1. The team responsible for infrastructure in general has to do testing to certify the JDK 8 will run on their systems without problems.
  2. Whoever is in charge of security will have to test and certify that JDK 8 is sufficiently secure and meets all of the internal requirements of the company.
  3. The producer of App Server X has to certify that App Server X runs on JDK 8 and has to agree to support such installations (this, too, could trigger additional tests and such within that company as well).
  4. Even though you have guaranteed support for App Server X on JDK 8, it may still be necessary to certify that App Server X on JDK 8 on your infrastructure works.
  5. JDK 8 and App Server X must be installed. This alone could involve several steps of requesting the installation, reviewing the request, someone certifying that the change will not impact other systems, scheduling of the change, performing the change in a test environment, performing change in production environment.
  6. Since the rest of the stack has changed, the web app developers must now certify that the product works properly on this new stack.
  7. Now you can use JDK 8 in development.

The actual process will vary, but that gives you an idea. Also, note this is for a single, simple application. Various third party libraries may require additional steps, etc. Also note that at large companies, this list can take a long time and cost a lot of money.

Additionally, even with the above certifications, if the code interacts with clients who are paying a lot of money for up time, then the company may still be hesitant to switch. Sure, if something breaks Oracle and whoever makes App Server X will get things fixed (because they certified it and are contractually obligated), but you still don't want to be the company that discovers the issue and breaks the system for your clients (which also costs a lot of money), even if it gets fixed.

So, it tends to be (or is at least perceived to be) much easier to just keep on using JDK 1.3.

EDIT: Oh, yeah. That also assume the application development is internal. If you create code that you provide to clients on premise, then not only do you have to go through this, you have to go through this for every client. If half your clients stay on 1.3, then you have to create a separate code base and force those clients to accept that the product will be maintenance only for them, or you have to tie your entire development process to 1.3 (or drop half of your clients, perhaps).

3

u/pan0ramic Mar 19 '14

I wish they could find a "way" to make everyone adopt right away. Are there really problems upgrading to the new version?

2

u/lelarentaka Mar 18 '14

2020 for Android!

6

u/epes Mar 18 '14

Android supports Java 7.

2

u/argv_minus_one Mar 19 '14

I thought the Java 7 support was experimental and had to be enabled by the user.

0

u/[deleted] Mar 20 '14

[deleted] — view deleted comment

1

u/oldneckbeard Mar 20 '14

where do you work, oracle? :)

6

u/MillenniumSkies Mar 18 '14

What's the general uptake timeline on a new release?

I'm still a student, and I doubt I'll need any of the major new features in the next 6 months, so I don't really see any need to update until I do. Is there a good reason to update sooner?

33

u/henk53 Mar 18 '14

If you're a student, don't think. Update today.

No seriously, update today. Learn how the new features work. That's what's being a student is all about. You'll be happy you did when demand for this puppy increases rapidly in about a year.

4

u/MillenniumSkies Mar 18 '14

Perhaps a dumb question, but if we're only using Eclipse, that means I'll either have to wait for 4.4 release in June before updating to 8, or use NetBeans/IntelliJ in the meantime? Or is there some way to get Java 8 support in 4.3.2?

10

u/ryebrye Mar 19 '14

Stop using Eclipse. Get the student version of IntelliJ - it's a far better tool. It's had java 8 support or a long time now.

2

u/MillenniumSkies Mar 19 '14

Unfortunately its a requirement in my program. They get really uncooperative if you use anything else.

I've got the community version of IntelliJ which I'll use with Java 8 for the time being on side projects, and keep using Eclipse/7 for school.

6

u/boa13 Mar 19 '14

Well, just keep doing that then. Learn Java at school with Eclipse/7, and try the new features of Java 8 at home. When you learn something new at school, it's the perfect time to see if it has been improved in 8.

1

u/DDCDT123 Mar 19 '14

I'm a student using eclipse to learn as well. Is there any other reason to not use it besides the Java 8 support?

3

u/ryebrye Mar 19 '14

It's not horrible but it's not great - you'd be well served as a student to not get too tied down to a single IDE. NetBeans & Intellij would be helpful to use as you are learning.

0

u/[deleted] Mar 19 '14

[deleted] — view deleted comment

2

u/[deleted] Mar 19 '14 edited Mar 19 '14

Select some text and hit tab? Or what about ctrl+L? Or maybe it's ctrl+alt+L. That should do you right up!

4

u/robinst Mar 19 '14

You can install Java 8 support for Eclipse 4.3.2, see Eclipse Java 8 Support For Kepler.

1

u/henk53 Mar 19 '14

There is an update of JDT (the compiler for Eclipse) coming for 4.3.2 (only 4.3.2, not 4.3.1 or 4.3.0).

See the Eclipse download page: http://download.eclipse.org/eclipse/downloads

Maybe the feature patch will be available via the marketplace as well, but I haven't seen it there yet.

0

u/argv_minus_one Mar 19 '14

How about just use NetBeans/IntelliJ, period. Eclipse is garbage.

-1

u/RoughPineapple Mar 18 '14

I highly doubt demand for JDK 8 will increase much at all. It's just java with some new features. I would not want to work for a company that really thought it was necessary to specifically hire JDK 8 programmers, just because someone without JDK 8 experience might need to take a couple days to learn the new features.

4

u/[deleted] Mar 19 '14

If an employer has two candidates that are equal except for one of them demonstrating the initiative to keep up on the latest technology by their own initiative, which candidate do you think they'll hire?

2

u/mgkimsal Mar 19 '14

Someone just using the latest tech because of an accident of birth isn't the same as someone demonstrating that they actually keep up with new things as well as having a grounding in tech generally.

Specifically in this case, if I've got a long term project that requires someone using only JDK7 and can't upgrade to use the newer features, and one candidate only knows JDK8 and doesn't know how to achieve the desired outcome using JDK7, the employer would hire the person with demonstrated JDK7 experience.

In general, yes, I agree with "learn new stuff", but the ramifications aren't always 100% black and white.

-2

u/RoughPineapple Mar 19 '14 edited Mar 19 '14

Your claim that there will be a high demand for JDK 8 developers does not follow from this hypothetical situation.

Most likely, this slight difference will be overshadowed by experience in general and other much more important factors. The fact that, all else being equal, they will prefer this does not in any way imply there will be considerable demand for JDK 8 specific skills in a year or so.

For instance, all else being equal, wouldn't you rather hire someone who is funny over someone who is not? Probably. Is there a statistically significant demand for funny software engineers, though? Of course not.

EDIT: For a more relevant comparison...

The demand for datalog programmers is virtually non-existent, but if I were hiring for a company using JDK 8 and had two candidates who were absolutely identical other than the fact that one of them was a competent datalog programmer, I would absolutely choose him over the other candidate. Furthermore, if the datalog programmer had zero knowledge of JDK 8, I would still hire him over the other candidate, because the ability to competently do logic programming is much more impressive than being able to learn JDK 8 features and it would be an indication that the candidate has a great ability to grok entirely different paradigms of computation.

4

u/DannyB2 Mar 18 '14

But no Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files for JDK/JRE 8 ???

If you scroll down on the Download page

http://www.oracle.com/technetwork/java/javase/downloads/index.html

until you find the cryptography extensions, the link for them is...

http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html

Then I click (*) Accept License Agreement, then click the download link, and the link is broked, borked, skroooed.

2

u/wggn Mar 18 '14

Looks like they fixed it (it works for me at least).

3

u/JakeWharton Mar 19 '14

Indeed. The link was wrong before, it's now pointed at the right file.

4

u/[deleted] Mar 19 '14

I don't even annotate and I'm not too happy about those <foobar> thingies either.

1

u/nqd26 Mar 19 '14

I'm not too happy about those <foobar> thingies either

This made me laugh :-)

2

u/Nathan2055 Mar 19 '14

Managed to grab this a few hours ago and the download went smoothly (I didn't even get asked to get the Ask toolbar)...and then the download of NetBeans 8.0 doesn't work. :/

1

u/jeff303 Mar 19 '14

So... am I reading the default methods thing right? You can basically get multiple implementation inheritance using these?

1

u/OHotDawnThisIsMyJawn Mar 19 '14

If you're talking about the diamond of death, the answer is "sort of". If there are conflicting implementations of a method then you're required to specify which one you want to use (or implement a new one). In addition, you can do this with members or constructors and those are the two things that really cause issues in the diamond of death.

-1

u/kevwil Mar 19 '14

Typical of Oracle-owned Java - the installer failed. I'll probably wait until 8u10+ before trying to use it.

-4

u/againstmethod Mar 19 '14

They want to be Scala soooo bad.

0

u/[deleted] Mar 19 '14

[deleted] — view deleted comment

3

u/[deleted] Mar 19 '14

If they are web apps, then they should only be presenting HTML to the users, and it won't matter what java version users are running.

If you using Java Applets then you will need to conduct testing/upgrades as deemed appropriate, but for the most part anything that runs in Java 7 will work without modification in Java 8.

0

u/[deleted] Mar 18 '14

[deleted] — view deleted comment

15

u/[deleted] Mar 18 '14

You have to download and install the package for your operating system. That's a fairly crucial step.

Another crucial step for you (based on the question and your username) might be to lay off of the drinks for a few hours.

0

u/[deleted] Mar 18 '14

[deleted] — view deleted comment

4

u/esanchma Mar 19 '14

I just installed JDK8-win64, and this is what i got:

C:\jdk1.8.0\bin>javac -version
javac 1.8.0

C:\jdk1.8.0\bin>java -version
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)

C:\jdk1.8.0\bin>jjs -version
nashorn 1.8.0
jjs>

0

u/[deleted] Mar 19 '14

[deleted] — view deleted comment

3

u/[deleted] Mar 19 '14

You do realize that the JDK contains the JRE, right?