Forgot your password?
typodupeerror
Java Programming

Java 8 Officially Released 302

Posted by Soulskill
from the gluten-free,-no-trans-fats dept.
darthcamaro writes "Oracle today officially released Java 8, nearly two years after Java 7, and after much delay. The new release includes a number of critical new features, including Lambda expressions and the new Nashorn JavaScript engine. Java 8, however, is still missing at least one critical piece that Java developers have been asking for, for years. 'It's a pity that some of the features like Jigsaw were dropped as modularity, runtime dependencies and interoperability are still a huge problem in Java,' James Donelan, vice president of engineering at MuleSoft said. 'In fact this is the one area where I still think Java has a long way to go.'"
This discussion has been archived. No new comments can be posted.

Java 8 Officially Released

Comments Filter:
  • by Anonymous Coward on Tuesday March 18, 2014 @06:40PM (#46520137)

    Probably the most important question in the mind of the general public.

    • by iced_773 (857608)
      The answer is probably no. Java isn't terribly inefficient itself, it's the people who write things for it. Minecraft mods in particular tend to be fairly heavy on memory leaks.
      • Java isn't terribly inefficient itself, it's the people who write things for it.

        Yes and no, you can write fast efficient code in java but you have to fight the language to do so. In particular java lacks both user defined value types and parameter pass by reference. The obiovus way round this is to just create objects on the heap willy nilly thereby creating a load of extra work for the GC. There are more efficient methods (using paralell arrays, passing in an object purely so the next level down of functions can use it as parameter passing space) but they all make your code uglier and

        • by mark-t (151149) <markt@lynx.b c . ca> on Tuesday March 18, 2014 @11:03PM (#46521569) Journal

          Your mistake is in thinking that constructing classes in Java with new would put them on the heap.

          It does not. It puts them into a special cache that is very similar to a stack, and which gets destroyed when the function exists. Objects that require more persistence than the scope they are allocated in migrate to another storage space automatically when the scope or function ends. This check isn't quite as free as just incrementing a stack pointer, but it is still extremely efficient... taking far less time than it would to manipulate values on a global heap.

        • by zarlino (985890)

          You're wrong, Java always passes parameters by reference.

          • by Pieroxy (222434)

            Not primitive types, not it doesn't. Objects, yes. Hence the need to create objects when all you want it to pass an int as a reference.

            • by Laz10 (708792)

              And how much space would you imagine passing a reference to an int would save, compared to just passing the value of the int?

  • by Stormy Dragon (800799) on Tuesday March 18, 2014 @06:41PM (#46520145) Homepage

    Crap, I already have a hard enough time getting non-programmers to understand that Java and JavaScript aren't the same thing.

  • by nurb432 (527695) on Tuesday March 18, 2014 @06:45PM (#46520173) Homepage Journal

    Just what we need, yet another version to fight with and worry about..

    • by ebonum (830686)

      But Java now has "critical new features, including Lambda expressions". Java really didn't work without Lambda expressions. Now I can FINALLY get a Java "hello world" to compile and run! Yippee.

      (ok, so Lambda expressions are cool, but are they critical?)

      • by fsterman (519061)

        ok, so Lambda expressions are cool, but are they critical?

        Yes.

        They allow you to distribute a job without doing all of threads and callbacks by yourself. Even if you ignore the electron wall Moore's law is hitting, "cloud" computing is all about doing many small computations simultaneously.

        • The ExecutorService from Java 5 does that. Lambda expressions are a fancy way to write anonymous inner classes.

  • Yaaaaaaay! :D :D :D
    More coding shinies!

    • Re:Fanboy Glee (Score:5, Insightful)

      by vux984 (928602) on Tuesday March 18, 2014 @06:48PM (#46520195)

      And another round of everyone getting ask.com toolbars.

      Boooo.

      • Re:Fanboy Glee (Score:5, Insightful)

        by allcoolnameswheretak (1102727) on Tuesday March 18, 2014 @06:52PM (#46520223)

        Yeah, that actually sucks some serious monkey balls right there. It doesn't make any sense at all for Oracle to do such a thing with something as important as the Java platform.

        There has been a petition [change.org] to remove this "feature" for some time now, but despite the millions of Java developers, it never took off.

      • You know, like telemarketing, they wouldn't keep pushing that crap if people weren't still falling for it.

        I see people's home computers covered with that Ask toll (yep) bar all the time.

        Regulars here are familiar with Dunning-Kruger, but there exists a polar opposite condition thus far unnamed: when you're a winner at the cerebrally capable sweepstakes, you infer intelligence by others that may not exist. What should we call it?

      • by Dster76 (877693)
        I wonder why Oracle's own page describing the Ask.com toolbar doesn't describe a single benefit -- that is, unless the end user already thinks that "[searching] the Web using the Ask.com search engine directly from the browser" is a benefit.

        https://www.java.com/en/downlo... [java.com]
  • Modularity (Score:4, Interesting)

    by should_be_linear (779431) on Tuesday March 18, 2014 @06:53PM (#46520235)
    Person that says "runtime dependencies and interoperability are still a huge problem in Java" clearly never used C/C++ on multiple platforms.
    • by cbhacking (979169)

      C/C++ across multiple runtimes on *one* platform are relatively easy, though. Not so with Java. Trying to find a common version of Java that works on any three given enterprise apps can be a real pain in the ass, and I can guarantee you it's not going to be recent or up to date on security patches.

    • Re:Modularity (Score:4, Interesting)

      by VortexCortex (1117377) <VortexCortex@NOs ... t-retrograde.com> on Tuesday March 18, 2014 @09:21PM (#46521163) Homepage

      Meh, I wrote my own replacement for freeglut3 in a weekend. It's not hard to have a platform abstraction layer, and many already exist (I just needed my own lightweight one for my games). Since I started out with cross platform toolchain, I have no issue writing code that runs on multiple platforms.

      This is how I port my code written on Linux into Windows, Mac, or BSD: git pull && make

      Not that is is exactly the same as when I use Java, except I get a native application without Java's huge runtime dependencies. Look, Java is now essentially the proprietary option for when you don't want to give away source code. If you have the source code, then the program is cross platform. And if I don't want to distribute sources? Providing binaries for every current modern chipset including ARM and MIPS takes me about 30 minutes total to build with my cross compilers. Yeah, users still have to pick which binary to install, but it's actually less of a headache due to browser user agent string detection -- Less of a PITA than bundling a JRE or displaying, "You don't have (the right version of) Java, download and install Java from [here] before you download and this program."

      Oh, the kitchen sink isn't a big deal? Yeah right, that's why Oracle is now relaxing on the requirements for "compliant" JVMs so they can drop a bunch of shit no one needs and still call themselves Java. Also, with native code you get a smaller attack surface. You see, the cost of cross platform capabilities is just deferred to elsewhere with Java.

      Don't get me wrong, I like Java and still use it. It's the right tool for some jobs. However, saying that cross platform C/C++ is more of a headache than Java is ridiculous. They're all "write once, debug everywhere" options. Enterprise software is even falling out of love with Java given that hardware supports native virtualization now.

      • by peppepz (1311345)

        Meh, I wrote my own replacement for freeglut3 in a weekend. It's not hard to have a platform abstraction layer, and many already exist (I just needed my own lightweight one for my games). Since I started out with cross platform toolchain, I have no issue writing code that runs on multiple platforms.

        Writing your code is only part of the problem. Things become funny when you have to use code that has already been written by other people. For example, you're using a shared library which exports a symbol whic

        • For example, you're using a shared library which exports a symbol which clashes with another library used by another library that is dynamically loaded by another library that you use. Without you knowing.

          That's not really a problem on modern systems.....at least OSX mach-o format allows it to know which symbol goes with which library.....even if they export the same symbols.

          Of course, if you want to call a function that has the same name in both libraries, then you're in trouble, but that's a problem in Java, too.

      • This is how I port my code written on Linux into Windows, Mac, or BSD: git pull && make

        Do you use Cygwin to do that?

    • It's not nearly as bad as the situation with C(++), but the way Java's classloader refuses to allow jars-in-jars is still pretty stupid. We should be able to create an executable jarfile with a virtual /libs directory that contains all the thirdparty jarfiles our own app needs.

      It's 2014. Nobody *cares* how much space the compiled bytecode takes anymore, because it's insignificant compared to the amount of RAM needed at runtime for the various heaps. And when there's an exception to that rule, it's usually w

  • Lambdas could be interesting for some GUI coding I have to do in the near future. I look forward to exploring them, but had no interest in playing with the betas.

    • by Laxori666 (748529)
      Yes, finally Java added features that other languages have had for years and years.
    • Lambdas in Java is a massive development. For most developers, it'll absolutely slash the amount of boilerplate they need to crank out.

      They're also an incredibly powerful and expressive construct in their own right.

      • by timeOday (582209)
        I don't agree with 'massive.'  It will be more terse, compared to anonymous overrides which are currently used for that.

        Basically the second line of code below is junk that could be removed, right?

        button.addActionListener(new ActionListener() {
           public void actionPerformed(ActionEvent e) {
                       System.err.println("Button pressed");
                    }});

  • by Anrego (830717) * on Tuesday March 18, 2014 @07:03PM (#46520305)

    It seems like a good idea and all, but I wouldn't consider this a critical must have feature.

    My (on the spot off the top of my head) wishlist:
    - swing that doesn't suck (seriously, how has this not yet been fixed)
    - file choosers that don't suck (yes I already said swing, but file choosers just stand out as being particularly bad
    - some standard command line argument processing
    - unsigned types
    - multiple inheritance (yes I know, old argument, but I want it damnit!)

    • by gtall (79522)

      Swing that doesn't suck? There's no way Oracle understands even as much as Sun about GUIs, and that's scraping the bottom of the barrel.

      • For the vast majority of 9-to-5 developers, there's no way to make Swing not suck.

        Because it simply takes a very high clue level to build good GUIs, period. Swing is nothing special; you can write shit GUIs using AngularJS, Vaadin, SWT _or_ Swing.

    • by pjt33 (739471)

      Java 8 sort-of has unsigned types [oracle.com].

      • by Anrego (830717) *

        Hmm, I haven't noticed that.

        Definitely a step in the right direction, and certainly useful to anyone who has to deal with networking :)

      • by cbhacking (979169)

        ... ugh. As they say, it beats casting to larger types all the time, especially with the performance hit of the Big* types, but it's still not as good as just giving us some damn uints.

    • Swing has been replaced with JavaFX, which is a very modern and rather slick UI framework. It's got a very nice skin, can be styled with CSS, is rendered via OpenGL or Direct3D with all the attendant features that provides, has a full blown animation and effects framework, a good visual designer (no longer left up to IDE makers), uses native file choosers, and can reliably hit 60 frames per second. Also the API is very clean and so far I found it a joy to work with.

      The downside? Of course, Java 8 is huge an

      • by hibiki_r (649814)

        JavaFX is still rather component poor, just like Swing was. It's ultimately Swing's biggest problem IMO: To do anything even mildly interesting, you have to build your own components, or do major extensions on the base ones. How much pain have people inflicted on themselves extending JTable? And no mention of the layout manager mess, only solved by third parties, back when Swing was already considered semi-dead: I'd trade every single layout option built into JavaFX for MigLayout.

        • by JoGiles (701171)
          What do you find missing from JavaFX - I'm one of the engineers on the JavaFX team and am curious about what exactly you need?
  • ...and still no properties. Seriously? getBlah()? setBlah()? I'm so glad I switched to Scala for newer development and that I even convicned my company to let us do more Scala development. The devs who are using Scala like it better and seem generally happier.

    Java 8 == Absolutely none of the features we wanted and a lot of stuff I could care less about.

    • by Ksevio (865461)
      It's nice to see they've added lamda expressions, but the lack of properties is a serious oversight in Java that should have been added years ago. It's not even a hard concept to add and it fits in just find the OOP model.
      • Re:No properties (Score:4, Interesting)

        by cbhacking (979169) <<moc.oohay> <ta> ... isiurc_tuo_neeb>> on Tuesday March 18, 2014 @07:46PM (#46520635) Homepage Journal

        Meh. Explicit getters and setters are annoyingly boilerplate-y but properties aren't much better. They let you save a few characters on the API-use side, but not enough that I find them that important. They do cut down on the massive list of "getFoo, getBar, getBaz, setFoo, setBaz" functions which are divided in your IDE by a bunch of other APIs (oh look, no at-a glance way to tell that Bar is read-only) but that's one of the few good things I have to say about them. They're also annoyingly magic-ish; functions that *look* like simple public members but can have all kinds of side effects and such (yeah, they *shouldn't*, but we already have language semantics for "this operation will invoke a function call" as opposed to "this operation will simply access a member variable" and properties overload the latter to tack on the former.

  • Does it still come bundled with Crapware? Why can't Oracle just put a bullet into whoever signed the deal with Ask.com, and start behaving like a big software company again?
  • Too little, too late (Score:3, Interesting)

    by shaven_llama (612399) on Tuesday March 18, 2014 @08:14PM (#46520797)
    Programmers that really cared about things like lambda expressions have already moved on to Scala and/or Clojure (and of course, it's not as if lambda expression support is the only thing those languages have going for them over Java). I work on a mixed Java/Scala codebase, and we just finished upgrading from JDK6 to 7. I don't see us tackling an upgrade to JDK8 anytime soon (probably won't be until JDK7 stops getting security patches).
    • Programmers that really cared about things like lambda expressions have already moved on to Scala and/or Clojure

      Apparently not many people care about them, then.

  • Now is the perfect time to build out a test server, fire up your applications, and start looking for all of the regressions. File the bug reports early and make sure that all of them are fixed before you even attempt to deploy this to your servers. Lately Oracle has been one of the worst offenders for regressions to the point that it seems like they threaten death to developers who test anything other than the new features.
  • by Miamicanes (730264) on Tuesday March 18, 2014 @09:30PM (#46521199)

    The biggest problem with Java is the fact that it makes dealing with 32-vs-64-bit and user-vs-admin in shell and script environments needlessly painful under Windows.

    I mean, seriously. Why, in 2014, do we STILL have bullshit like:

    java -jar foo.jar arg1 arg2 arg3

    (silent crash), or
    [*very public crash*], or
    "This application requires a 64-bit JVM"

    then, have to screw around figuring out what the path is THIS WEEK to the right java.exe, because every goddamn semi-daily update changes the installation path, so you end up having to do something like:

    {swear violently and with frustrated rage}
    dir "c:\program files\java"
    (see what the installation dir is this week)
    "c:\program files\java\jdk1.7.0.69\bin\java.exe" foo.jar arg1 arg2 arg3

    I mean, would it really kill them to give us an installer that installs BOTH the 32 and 64-bit JDKs, then creates a bunch of symlinks to a file named java.exe that -- when launched -- looks at the jarfile, determines whether it needs a 32- or 64-bit JVM, finds the latest 32- or 64-bit JVM as appropriate, and launches it -- passing the path to itself and the rest of the args as args?

    This is an endless source of pain to me. Java is my main language & I end up using it for almost everything, and its awful handling of commandline launches has driven me crazy for years. When I write some tool I use a lot, I'll go to the trouble of setting it up to build with JSmooth so it can wrap the whole thing in a .exe file... but that's a royal pain in itself, and I'm dreading the day when I have to figure out how to use it to wrap a 64-bit Java app (I'm not even sure it can).

    Java also needs to seriously improve the way it deals with UAC... like maybe install a privileged Java background service (that's normally asleep and idle) so we can launch apps as regular users under Windows 7, and programatically auto-elevate via UAC by having Java delegate sensitive tasks to that background service when necessary under Windows 7 or later. Or at least, create something like WindowsUACException that's a subclass of IOException (so Windows-aware apps can catch it explicitly and deal with it gracefully, without breaking Windows-unaware apps that are oblivious to UAC) that gets thrown when something fails due to UAC, instead of throwing some misleading Exception that makes it look like the filesystem is missing.

    Regardless, Java's handling of Windows commandline launches of executable Jarfiles *sucks* under Java 7, and we can only hope they've had mercy on us and made it less dysfunctional under Java 8.

    • by msobkow (48369)

      It's simple. If you have a 32 bit OS, install the 32 bit version of Java. If you have a 64 bit OS, install the 64 bit version of Java.

      I have never since Java 1.0 seen a Java program that required the 32 bit or the 64 bit version. That's the runtime, and has nothing to do with how the JVM byte code itself is structured. I don't even know how you could make a Java executable depend on the version of JVM short of using the bindings for calling binary libraries -- in which case you're dealing with crapwa

      • by evilsofa (947078)
        But java.com states that it's about whether you're using a 32 or 64 bit browser, not OS:

        http://www.java.com/en/downloa... [java.com]

        Isn't the 32-bit version of Internet Explorer still the default on Windows 8? Isn't Firefox (the one you normally get anyway) and Chrome still also 32 bit?
      • I only wish it were that simple. On my computer at work, I have at least one Java app that literally dies on launch unless you have BOTH 32-bit AND 64-bit Java installed. It exhibits this behavior on everybody's computer, and not just mine. Nobody, including its author, really knows why.

        That oddball app notwithstanding, installing only a 64-bit JRE on a computer running 64-bit Windows 7 is NOT the universal solution. Google finally fixed it, but for the longest time, you literally couldn't do Android softwa

  • I think by now everyone knows Java was responsible for the vast majority of drive by infections on the web. Lately they've made Adobe look secure by comparison. By adding development features instead of fixing their security of even just their stupid updated that stalls out permanently all the time, they've shot themselves in the foot. Half my customers at my computer repair shop absolutely refuse to use or install java under any circumstances. Lots of companies are banning all java-based software for s

What this country needs is a good five cent microcomputer.

Working...