29 ms·
Java 12
- java-man 8y agoI wish they did not decouple JavaFX...
- vlaaad 8y agoWhy is that? Decoupling benefits JavaFX so it can have release cycles on their own pace.
- java-man 8y agoDecoupling might have benefitted JavaFX, but it did not benefit me who develops professional desktop applications for a living, and it did not benefit my users. If they wanted to decouple, they first should have created a cross-platform jpackager-like tool that generates native executables for major platforms. I remember JavaFX was launched with great fanfare as a modern replacement, which it certainly might have been - a modern, efficient platform. I am afraid it will slowly decay and dissolve into oblivion to be replaced by gigabyte-size electron apps.
- freeone3000 8y agoThis tool is called jlink. https://docs.oracle.com/javase/9/tools/jlink.htm https://docs.oracle.com/javase/9/tools/jlink.htm
- java-man 8y agodoes it create a native executable?
- freeone3000 8y agoIt builds a directory of files which contains a .bat to launch the bundle.
- java-man 8y agoso it DOES NOT build a native app (jpackager does, but it's a mess: present in 8, removed in 9, coming back in 12 without cross-platform targeting). The major point of JavaFX is cross platform development. Please offer a cross-platform jpackager, and we'll be happy.
- samus 8y agoYeah, that kinda makes it impossible to become a successor to Swing. But the situation actually got more sane because JavaFX can be included now as a Maven dependency, like any other framework.
- james_s_tayler 8y agoWhy do people still use Maven when Gradle exists? I'll never know.
- pjmlp 8y agoBecause Maven doesn't require a background daemon eating 2GB of memory to be fast and IDEs can actually provide code completion and documentation while typing. Android is the only reason to have to put up with Gradle.
- james_s_tayler 8y agoFair enough. It doesn't sell me on switching back to Maven. Ram is cheap enough. With 32GB Gradle can have a couple if it wants.
- pjmlp 8y agoMost dev laptops are still running with 8GB. 2GB for a cache that isn't required by alternatives for the same result just feels bad. And don't get me started into turning build scripts into full blown applications impossible to decipher what is going on without some kind of debugging process.
- ptx 8y agoGradle 5 lets you write the build scripts in Kotlin, which is supposed to address the code completion issue. (And the continuous build mode is a nice feature!) But, yes, is does use a lot of memory.
- pjmlp 8y ago
- connorlwilkes 8y agoThe new switch feature looks nice, the way it previously used to work was so unwieldy.
- azhenley 8y agoIn case someone is curious what it looks like with the new -> form: switch (day) { case MONDAY, FRIDAY, SUNDAY -> System.out.println(6); case TUESDAY -> System.out.println(7); case THURSDAY, SATURDAY -> System.out.println(8); case WEDNESDAY -> System.out.println(9); }
- jason0597 8y agoReminds me of Kotlin's "when" statement
- _old_dude_ 8y agoor using the switch as an expression System.out.println(switch(day) { case MONDAY, FRIDAY, SUNDAY -> 6; case TUESDAY -> 7; case THURSDAY, SATURDAY -> 8; case WEDNESDAY -> 9; });
- melling 8y agoThat's much nicer. Anything else added to Java recently to reduce the boilerplate? I haven't used Java much in 5-6 years. Glad they are iterating faster.
- andystanton 8y agoLocal type inference[1] means you can write: var foo = new Map<String, String>(); The static initialisation methods on collections[2] let you write var foo = List.of(1, 2, 3); It's still clunkier than many newer languages but it is improving. 1. https://developer.oracle.com/java/jdk-10-local-variable-type-inference https://developer.oracle.com/java/jdk-10-local-variable-type... 2. https://docs.oracle.com/javase/9/docs/api/java/util/List.html#of-- https://docs.oracle.com/javase/9/docs/api/java/util/List.htm...
- crooked-v 8y agoStill nothing to handle checked exceptions in streams properly... sigh.
- paulddraper 8y agoI share the conclusion of the other statically typed JVM languages (Scala, Kotlin): checked exceptions are bad.
- vbezhenar 8y agoIf they are officially bad, remove them from the language. It's a backwards-compatible change. Currently we are in a weird situation, when standard library does not work well with each other. It's like making iPhone without USB-C cable and Macbook without USB-A port.
- dragonwriter 8y ago> It's like making iPhone without USB-C cable and Macbook without USB-B port. Was there ever a MacBook with USB-B?
- azhenley 8y agoThe most interesting new feature I think is the Shenandoah GC. The summary from [1]: "Add a new garbage collection (GC) algorithm named Shenandoah which reduces GC pause times by doing evacuation work concurrently with the running Java threads. Pause times with Shenandoah are independent of heap size, meaning you will have the same consistent pause times whether your heap is 200 MB or 200 GB." The original algorithm was published in 2016 [2]. It consists of 4 phases: initial marking, concurrent marking, final marking, and concurrent compaction. [1] http://openjdk.java.net/jeps/189 http://openjdk.java.net/jeps/189 [2] https://dl.acm.org/citation.cfm?id=2972210 https://dl.acm.org/citation.cfm?id=2972210
- _bxg1 8y agoGC pauses have been one of the major barriers to using garbage collected (read: higher-level) languages for game development. This could open up the JVM for games, which could have some exciting implications.
- dahfizz 8y agoThere are a lot of applications where predictable performance is just as important, if not moreso, as good performance.
- stefan_ 8y agoTheir lower end target is 10 ms. In a game, 16 ms is your entire time budget.
- arianvanp 8y agoIn VR your budget is 11 ms and you can't miss it or the entire frame is thrown away and you introduce a frame of latency to compensate. So for VR these kind of effects of GC are even worse.
- chipperyman573 8y agoAlso, while most games are fine with losing a frame or two every few minutes, in VR dropping frames will cause motion sickness really fast. FPS is, from what I've observed, the most important part of a VR game. If you're dropping frames or stuttering, the experience will suffer greatly When I was developing a VR game, my team noticed that some ultra-sensitive people started to get sick when we would drop around five frames (the vive displays 90, so this is only a ~5% drop). There was more to it (dropping a few frames every few minutes was usually fine, but consistently dropping frames every second or two is an issue).
- darksaints 8y agoAnybody know how the graal project ties in with all of this? Is oracle effectively developing 3 different JVMs (OpenJDK, Oracle JDK, GraalVM)? Or is there some sort of convergence plan? From what I understand, graal has made a lot of headway with language interop, as well as a handful of specific memory optimizations and native compilation, but overall is lagging in pure throughput/latency performance behind hotspot. It would be really cool if we could get the best of both worlds.
- jason0597 8y agoWell the relationship between OpenJDK and Oracle JDK is that OpenJDK is the FOSS base and Oracle JDK is the proprietary structure built on top, kinda like Chromium and Chrome As for GraalVM, I don't think it's meant to be mixed in with those 2 at all. From their website (https://www.graalvm.org/ https://www.graalvm.org/), it sounds to me as if it's a completely different project that shares none of the goals the other 2 JDKs have: > GraalVM is a universal virtual machine for running applications written in JavaScript, Python, Ruby, R, JVM-based languages like Java, Scala, Kotlin, Clojure, and LLVM-based languages such as C and C++. > GraalVM removes the isolation between programming languages and enables interoperability in a shared runtime. It can run either standalone or in the context of OpenJDK, Node.js, Oracle Database, or MySQL.
- spricket 8y agoNotably, Graal has been used extensively by TruffleRuby for a while now. It's not oficially ready for prime time but definitely promising.
- chrisseaton 8y ago> overall is lagging in pure throughput/latency performance behind hotspot Twitter use Graal in production - I think it's about 13% faster for them on their real workloads. If you send a Tweet it's going through Graal.
- aardvark179 8y agoGraal is a JIT for Hotspot (and other things), you can already use it be turning on experimental features and enabling JVMCICompiler. Graalvm is that packaged up with the Truffle framework (and languages written for that), and SubstrateVM which allows programs to be ahead of time compiled and linked as executables with a minimal VM.
- geophile 8y agoAre they ever going to release value types?
- MrBuddyCasino 8y agoYeah that was supposed to be in 12 wasn't it? Everyone is waiting for that, it will obsolete Lombok.
- debug-desperado 8y agoData classes will reduce the need for Lombok/immutables. Less so for value types.
- aardvark179 8y agoNo feature is meant to be in a release. A feature will be done when it’s done, though features may be split so that some functionality can land earlier.
- aardvark179 8y agoAdding values is a huge task because they are a big change at the VM, language, and library level. You can read about some of the latest plans in draft form at https://mail.openjdk.java.net/pipermail/valhalla-spec-experts/2019-March/000897.html https://mail.openjdk.java.net/pipermail/valhalla-spec-expert.... Rest assured progress is being made.
- ocdtrekkie 8y agoMeanwhile, most enterprise apps still seem to only work with JRE 8. And those which I know of have elected to replace Java rather than upgrade.
- pbz 8y agoWhat are they replacing it with?
- ocdtrekkie 8y agoI see a lot of business apps that use Java on the client side with the JRE. From my observation, they're tending to move towards HTML5 clients, rather than updating to more modern Java versions. The fact that the January 2019 security update, 8u201, is the last version of Java 8 commercial entities can use for free, has pushed this a bit, it seems.
- regecks 8y ago> The fact that the January 2019 security update, 8u201, is the last version of Java 8 commercial entities can use for free, has pushed this a bit, it seems. Isn't OpenJDK providing updates for Java 8 through to September 2023? 8u202 is published ... https://adoptopenjdk.net/support.html https://adoptopenjdk.net/support.html
- snaky 8y agoI wonder how many of that web-based client solutions (outside of SV) will be built on Oracle APEX.
- timClicks 8y agoWhat stacks are being picked by enterprise for these sorts of projects? C#?
- lucb1e 8y ago8? I see more 7 or even 6. Until recently I actually thought 8 was the latest until I needed to develop a small project and discovered we were at 11. Actually, looking at the version history, I guess it's not weird that I thought 8 was pretty recent, as until 1.5 years ago (Sept '17) it was actually the latest and it is still supported until 2020 (unlike 9 and 10). v6 2006 2007 2008 2009 2010 v7 2011 2012 2013 v8 2014 2015 2016 v9 2017 v10 2018 v11 2018 again v12 2019
- ilovecaching 8y agoI understand why Java has to keep on chugging along, but I feel bad for the people that have to be a part of it. It's like watching people keep coal trains going while people are moving to cars. Why? Besides being owned by Oracle, which is enough of a reason to never use Java ever again, it's also lost the niches that brought it into existence. Java no longer runs everywhere. Java on the web is dead, and you can now write ubiquitous apps in basically every language. There's no reason to deal with the JVM and it's domain knowledge when you can write a nimble Go app for your backend and a Javascript app that will run on mobile, web, or desktop. A VM language? You mean v8 sandboxing and web workers; WASM which lets me write C, C++, and Rust all of which can talk to Javascript APIs. All of my services are stateless and ephemeral. Crashing is expected, and I can use host monitoring tools instead of introspecting the JDK. On the cloud it gets even worse for Java. Why use a meaty framework like Spring when I want to just spin up a bunch of micro services, or have an API gateway kickoff a bunch of lambda jobs. Java also took OO in so many terrible directions. OO defined by it's creator looks nothing like the enterprise OO that big business sold to commoditize programming, which now only exists as a ball and chain on legacy systems. One day Java will be like Cobol. There's probably a lot of money for Java developers for many more decades, but god I do not envy anyone that has to do it.
- ellard 8y agoSerious question: Isn't Java still one of the default languages if you are choosing a "safe" language to build and maintain a large piece of software? Considering how long it's been around and how many libraries exist for it now, i've generally viewed it as a language that's: - fast enough for most things without a lot of pitfalls/gotchas - easy enough to read for most developers - easy enough for most developers to pick up if they've never used it, even if they aren't exactly enthused by the idea of doing so - supported enough that you'll never be the only person who is debugging something - widely used enough to never be alone when you are trying to use it in unsupported ways - has commercial support from multiple companies Basically all the things that a lot of "enterprise" companies love. Edit: formatting
- wongarsu 8y ago
- vbuwivbiu 8y agopresumably there's still primitives and boxing ?
- hyperpallium 8y agoSwitch expressions prepare the way for pattern matching (https://openjdk.java.net/jeps/305 https://openjdk.java.net/jeps/305), instead of `instanceof` checks and casts. But (in my naive opinion) double dispatch seems a more elegant and java-ry solution, i.e. polymorphism on argument classes, so different methods are invoked for different object runtime classes (instead of using the compiletime type of the variable). The switching could be optimised, as ordinary polymorphism is in the JVM. Sure, you'd wreck legacy code if you just introduced it, but there's surely a backcompatible way to do it that isn't too awkward. BONUS: goodbye visitor pattern!
- aardvark179 8y agoThat kind of multiple dispatch would be far more disruptive at several levels, and still wouldn’t really get you where you want to go without a lot more compiler and JIT magic. Sure, you could match on types, but you wouldn’t be able to extend that to destructuring patterns, or regsxps as patterns on strings, or so many other ways patterns may be extended in future releases.
- hyperpallium 8y agoMy comment's a little out of place. I'm not against pattern matching, but for double dispatch; we can have both. Their initial motivating examples was bare instanceof, but I now see they extend it. How would destructuring fit this model ?!
- aardvark179 8y agoBrian Goetz has writes quite a bit about ongoing projects. The latest article he has done about pattern matching is I think http://cr.openjdk.java.net/~briangoetz/amber/pattern-match.html http://cr.openjdk.java.net/~briangoetz/amber/pattern-match.h.... There is a load of stuff in there about destructuring patterns from about half way down.
- hyperpallium 8y ago
- MarkMc 8y agoI'm so glad I was taught Java at Macquarie University back in 1998. For the past 20 years I've had a career built on a solid API that doesn't change every 2 years like some flavour-of-the-month Javascript framework. Even on the client where Java has lost to Javascript, I'm finding it more enjoyable to add features to my 15-year-old SWT app [0] rather than dealing with the multiple layers of abstractions that is Javascript+CSS+DOM (+ maybe Electron). Personally I think it's a shame Sun dropped the ball with client Java - if they had chosen SWT over Swing and provided a minimal JVM then maybe Java Web Start would have beaten Javascript web apps. It's also a shame Sun sold Java to Oracle - Google would have been a better steward, and probably would have been willing to pay more for the Java parts of Sun. I'm now trying Dart to develop a few Flutter apps. It's no doubt a better language, but not that much better - I think Flutter would have been more successful if it was built on Java. [0] https://www.solaraccounts.co.uk https://www.solaraccounts.co.uk
- Justsignedup 8y agojust had this conversation with a co-worker today. java is a stable api but it also doesn't evolve. The tradeoff is you get a program guaranteed to work no matter the upgrade vs being able to build better toolage. React changes every year or 2. It is exhausting. But you get way better patterns and some things that drastically improve productivity.
- sixstringtheory 8y agoJava gives you a flexible object oriented language and an incredible set of libraries. It's got an archiver for artifact and dependency management. It now has lambdas and has FRP style stream programming. I'd say it's kept up pretty well with modern fashion, while it's been doing other things far longer than newer, more popular languages. Take Swift, now my daily driver (which I love so much compared to ObjC, which I moved to after Java)... an example of something Java had way before Swift is "Protocol Oriented Programming". Also, Swing's GridBagLayout predates iOS' AutoLayout and CSS (edit: don't know where I was going with CSS haha...). Everything old is new again, and I'm sure Java reinvented a few wheels of it's own. Also keep in mind that React is a library, not a language. If you want to compare things, compare Javascript to Java, or the Java stdlibs to React. Maybe that's what you meant when you said Java. IMO, Java and its libraries are nicer to work with solely due to its static nature and OO design. It is worlds apart from a scripting language when you need to refactor, or even just understand, legacy code. And if you can't even run tests on that legacy code anymore, like a React project over a year or two old? What are the better patterns and productivity boosts you get from React vs. a Java ecosystem?
- hestefisk 8y agoI’m missing the TL;DR on what language features may be introduced. Any ideas?
- stygiansonic 8y agoCheck out the OpenJDK page: http://openjdk.java.net/projects/jdk/12/ http://openjdk.java.net/projects/jdk/12/
- stygiansonic 8y agoIncluded is JEP 230, a Microbenchmark Suite. It's based off of JMH. Nice to see this included! http://openjdk.java.net/jeps/230 http://openjdk.java.net/jeps/230 http://openjdk.java.net/projects/jdk/12/ http://openjdk.java.net/projects/jdk/12/
- imhelpingu 8y agoI wonder if they might condescend to utilize the JVM so I don't have to compile JMC myself for another 5 months, or maybe at least they'll remove their circular links that infuriatingly obscure the fact JMC binaries don't currently exist. For the past 5 months.
- wink 8y agoI wonder if they'll fix the performance again. I'm mostly peripheral to clojure-land and 8 still seems to be the best choice.
- otisg 8y agoGreat to see Java 12 (and the shorter release cycles) but how quickly do people actually move to newer Java? Here's a poll with some results: https://twitter.com/otisg/status/1108093046397247488 https://twitter.com/otisg/status/1108093046397247488 (still open, please vote so there is more data)
- Chris_Chambers 8y agoHow does Oracle enforce their license if you only use Java server-side and never tell anyone? Does Java phone home now and snitch when you use it?