 So I'd like to know a little bit about you. So please raise your hands. Who's Java developer? Isn't it? Anyone else? Who's not? There's a marker. Everyone of Java developers work is Java, right? Crazy. Thank you. How many of you already drive Java 9? Okay, that's good. I want to focus on common Java developer, so I will not go too much details, but I want to mention things that I think are important for everyday Java level. So two more questions for you. What was Java 8 about? Main feature. So you're in the London. Yeah. These things are possible because of London. And what was the key feature of Java 9? Jigsaw. Modularization. Okay. That's great. There are many models. There are new tools. New APIs, some language changes. Some internal changes. Also some variables and deprecations. And many more. So current state of Java 9 is in random phase, which means that it's feature-complete. Just some, my priority bugs are approved. And it should be available 27th of July. It was actually postponed, I think, two times, but it should be really delayed. And I have another really fresh information that actually new forests for JDK 10 was created just yesterday. So I don't have to do it because it's really fresh. Okay. I would like to start with version scheme that was changed because this is example from Java 8. It's numbers of versions, 74, 77, 91, 92, 101. It doesn't make much sense. And it's more wrong. It's the long version. Because, as you can see, it's 1.8.0 and it holds just one information. It's Java 8. Actually, the 101 holds two information. It's security update and Maya update. And it's just wrong. So Java 9 has no Y 1.9.0. Because after 20 years there probably will never be version 2. So it's just nonsense. And it doesn't have two information, two things, in one number. So new scheme is major dot, Maya dot, security, and in long version it's plus real. And we also got this nice object. Actually, in Java doc, MC, which is version object and you can get major, minor, security. You can compile two versions. You can even parse a version to get instance of this object. And you can get this object from runtime class for your runtime. Okay, so example is first version will be 9. Then like 1, it's first security, second security update, then minor update. And you can always see what's really in there. Another like minor update in Java 9 is HTML in Java. And especially, you know how it's hard to find something in Java. It's basically impossible. And we got nice little input here. And I can set, for example, this. And I did this. Go down this. And I can jump right into the class. So it's like one implement, but I think it's nice. Internet changes, change. Java 9 got default garbage collector called G1. And G1 is available since Java 7. And by the time it got several improvements and development, so it became default garbage collector in Java 9. And what's important for Java developer is that it's oriented to minimal causes. So you might expect faster latency. But the little lower throughput. And the high throughput is what was previous garbage collector oriented. So it was a parallel collector that was before the garbage collector in previous versions. Annotation deprecated some improvements. So it has now two elements which says since when the API was updated, it's simple string. And for removal means if it will be removed in the next major version of Java. So if compiler shouts to you that you are using some deprecated method, you now know if it's going to be removed. I've got a little demo for you to show new tool, new tool, JDPerScan. So, G1 online. It's a little tool that tells you which classes have something deprecated. If I do simple list, I can see all deprecations in Java 9. If I do list for removal, I can see all API that's going to be removed in Java 10. So I'm going to use this. Another thing, we got JShell, our repo for Java. And why we want something like this? I think there are several reasons. If you want to show Java to someone who doesn't know it, you may want to use repo because if you start to write in class and there are many buzzwords and you say or the person who is teaching asks you, what's a public class? And she'll say, it doesn't matter now. I won't just bring the whole world. And there are many buzzwords like that. You can start the repo and show how Java looks or you can learn yourself. You can do some micro testing to explore possibilities of some API. So you can try it. And JShell will also API. So you can use JShell from your application. And I think it's a way where new tools may become reality for IDs and so on. This is how API looks. It's just a simple example. So I have eval function and I create integer A, integer B, and in integer C, I add them together. And then I just print out all variables. Output is probably expected. And just like that, you might expect some tools for your ID that is this API. Okay. I've got a demo. So let's start JShell. And this is how it's looked. So I may want to create variable A, but it's not working because, of course, I need integer A. As you may notice, I'm not using semicolon. It's just not needed, but required for the first time in Java. So let's create B. And I have variable B. I can, of course, change the volume. Now I don't have to use int because it's already declared. And if I do A plus B, it's A. Makes sense. Now I can use some commands for JShell, which start with slash. And if I enter slash B, it prints out all my variables. So you can see there's some doler for, which is if I don't specify how to save the result, it's just create some doler and some number. I can create methods here. So for example, this one. So now I have my method. And I can add A and B. I can change, for example, this method by another command, which is edit. And I can edit that. And this beautiful IDE. And, for example, this thing. Like it jumps out from 90s straight into your face. So I edit, edit, and try to just modify it. So now if I call it IDE, it stands because I edit it to get another do. Could you actually take the terminal and make it a bit smaller so that it's not clipped? Uh-huh. Sorry. Thank you. Okay, I can create classes, for example. Let's edit this again. So, for example, I can create methods in this class that just prints my code. I can create an instance of my class. And I can see it's some doler, doler, file. And I can go now. And it's this one as well. Okay. You may be noticed that auto-compete works here. So if I press stop, I can see all my thoughts. Some other commands that you are turning to JShell, as I with slash, for example, writes all methods. I can use all types. So I create a class A in types. I can use list. And let's call snippet sky entered. I can use history. These commands I entered. So you can do this. I can save everything that I need to file, for example, from XT. And now if I exit from JShell, I can see the file is here. And content of file is really simple. Just commands I entered. And I can, again, load this file if you see it. List is empty. And I open the file. You can see that everything was processed. What's interesting is all our inputs. Now every part of this I can use by default. Or I can use the type input that I have. Or add some jar in class class, for example. Reset for something state. And now I'm clean. So this was a really quick demo for JShell. So we have some images of JShell now. We have some language changes in Java 9. Everything is under project coin. Which is a project that, like if developers of Java want to introduce some minor change of language, that's under project coin. So it's now safe, works. And annotation, you can use it on private instance. It was not possible, and it didn't make sense. So it's possible now. You can use effectively final variables and try different sources. I can show you in next slide, I think. You can use diamond with animals class, which wasn't possible, but why not? You can't use underscore as identifier, because it's a new keyword. Just equal. The last change is you can use private methods in interfaces. In Java 8 there was introduced default methods. So just to support them so you can hide the implementation. This is how it looks like in Java 8. You have to create new variable, and it's called automatically for you. In Java 9 you don't have to create new variable. You can use just like this, or even like this. And it's possible. So in my update, same as in diamond, in Java 8 you have to define in this example stream here, in Java 9 you don't have to. Okay. New APIs. There's a lot more, but I choose this as well. So I show you in slides or even demos all of them. Process API, list map, setfactory methods. There are some new methods in stream and some new methods in optional. So this is... I find it all stuck on the floor, so I don't think it's the best solution. But if you want to do HTTP get request, that's what you find. And so for so simple things, quite complicated. You have to create some connection, and especially this line is... you have input stream reader, buffer reader, and now we have to do a loop, just some join result, and it's quite complicated for such a simple task. So in Java 9 you have a new API. It looks like this, and it's much simpler. I just create an HTTP client, and I create my request, which is nothing more than just URL, is the request, and I'm good. And then I call send on my client and I'm in the request, request team, and I'm telling that I want to send the response on the screen and just call buddy, and I'm so... Okay, it's not good. You changed the background to white, or the theme, or whatever. I can't. I'm sure it's possible, but I don't know how. Pre-Francis and Fondi, I guess. Pre-Francis and Fondi, I would say. Sorry. That was cute. We're not... where is the solarized light? This is light. Very good. So, as you can see, there's nothing more than a Muslim slide, but here is HTTP address for my presentation, and I have some storage here, and I just send the request to my presentation, and I write five lines of the response. So, as you can see, it written 301, so there are specifics for that. And what I'm saying here is just to reply and that I want full redirects always. So, it returns something. And if I want to asynchronous request, I can do it just as easy, and not call send here, but call send async, and now I get future. And just call it red and body, and five or tiny. If you look at the times, in the first example, the 400 milliseconds it was to send the request, and now it was the 200 milliseconds after I send the request, so it was really simple. So, just a simple example of this API. Unfortunately, it's in Incubator, and that's also new thing in Java 9, that if developers of JDK are not sure if the API is ready to production, they put it in Incubator, and you just don't know if it will be promoted to official API or if it will be completely changed or removed. So, unfortunately, I don't recommend to use this API, but it's okay. Quite nice. Any idea if it's going to support HTTP2 because you're already in the headline and you didn't speak about it, as far as I remember? Yes, you can probably read it somewhere here. Yeah, I'll say it right there. It implements HTTP2 and web sockets. It's it. Yeah, so I guess it should, but I meant it. Another new API is Roses API, so you can control processes in your operating system. This is how you get all running processes in Java 8, of the Java. You have to execute a command and then somehow, somehow parse it. So, it's not very good. It's also from Stack Overflow, so I think there are better solutions. It's platform-specific, moreover. It works on the line of the list. Yeah. So, now we've got something like this. We've got the process handle and we get all processes just like that, and we get stream of all processes and we can do what we want with them. So, another demo one. Here I get all processes. I filter the ones that contains top. I kill them. So, I start top and for example, I stop. It invites that it's killing some of the processes and as you can see, we have also some info about them like command line, and so on. The processes are really good. I have another demo, but I don't want to do it now because it kills all processes but not Java. I surely didn't try that, so maybe I'll end up with presentation. You'll see. I think this is really nice because I think the list sets or collections of some variables was really fine and you have to special libraries for that and in general you don't want to do that. So, we've got some nice filtering methods. I think it's pretty clear. Just here, in the map, it's key, value, another key, second key, second value, third key, third value, and it's basically the same like this. We have some new methods in Spring, so another demo here in JShell. If you look at the first method, it takes some seed and some predicate and some unary operator and it looks a lot like for loop really closely. So, you might see it better now because first value, I got 0. Now I say I want to, if i is less than 10, just i plus 1. It's basically a for loop in Spring. Another two methods are Can you by any chance make it bolder and change the background because the symbols now are not very much visible. Okay. Bolder method. Another method is take while. So, you can now say that you want to take the elements while it's less than 5. And the similar method is drop while with the same but from other side. Optional get I think 3 new methods but this one is I'm really excited about because now I can do if and else and the same line basically. And it looks just like this. So, it's really simple and I think it's really useful. Very So, now let's move to the modules. The biggest feature of Java 9. So, it's developed under project Jigsaw which was started I think in 2009. It was still when Java 7 was still under development. So, it's really old project. I think it should be a project just to modules should be in Java 8 but it was postponed to Java 9 and it's biggest reason for the postpones of Java 9. Big project and big thing in Java. So, what are goals of modules and project Jigsaw and these are strong encapsulation reliable configuration scalability and minus scalability down and it does these things in two layers same JDK is modulated by the system and same system is provided for your application what you can use it's actually used in JDK. Fight talk mentioned strong encapsulation I think the Jigsaw fix this table because if you look at it if you take private it's in class default package protected subclass but public is world this step is huge and you basically don't want to do that. So, I think that Jigsaw fix the table and it will look like this yes, it will if you write public it's no longer visible to world but just to the module and you have to explicitly explore your package to be visible to the world. I put it in quotation marks because it's not it's not a modifier keyword so it's just okay, so there should be no more class partner and that's what I meant if I said reliable configuration and how will you go through some of this with module partner but we'll see module partner is basically it replace class paths and problems with class paths are everything is out there you can put any jr file and everything is public everything is available and you have almost no control what's really loaded and what you are using so on module paths you can have each module just once and visible is just what that module explores and you have to specifically read the module to use it and you have control both compile time and run time so you can't basically you you have to just once both compile and run time so with this module it's defined by new file module for the Java and you can read other modules you can export your own packages and this is quite important because I want you to remember that you export packages and you read all modules and if you read other modules you read every packages that other modules export and you can use and provide services so last demo a module application here which use Java 9 modules and to keep it simple now I just assume I have some random generator and I generate 10,000 random numbers and it returns to this and I print how that this is big and where I get this random generator it's from another module which is here and it's really simple just returns random numbers and use module info for the application app and as you can see I require the random generator and random generator exports that package so I have some simple build script that first compile then package and run compile is nothing unexpected I think just Java C and I specify out there and here I can see for the first time the module pass especially a more precise module source path and I define so literally and then I just find all Java files it's mighty quite complicated but it's not I just loop through folders and create JAR files and I create JAR file with main pass so it's nothing more and for run I get this one it's nothing more than now I just modify module pass and then directly where all JAR files are and I specify that I want to run module app and this class so hopefully it will run yes it writes then it also if I modify for example module info for app and I move this line I got error in compile time and it says that that my module does not read it and same happening if I edit module info in running generator and I don't export my package so it's exactly very similar error but the class is not visible so I have some I have ensured that everything is on vice and already in compile time so I want to show you very interesting thing which I'm really excited about and it's new tool called J-Link the script to write run J-Link is new tool and in a minute or two I will show what it does and you will get specify module pass and now we will folder your Java with modules of JDK and J-Link directory and I edit my module up so I specify launcher to be again named f and module f and my pass and I specify up to there you can see that here this is my directory or exact directory it's this link directory and you can see that there's been called new tool legally it looks not like JDK and if I enter to my directory there's app which is Java in Java 9 it writes 10,000 so what J-Link does is that it pack everything that application needs and it creates runtime for you for your application so there's nothing more all dependencies need it and you can take this folder pack it and deploy is the app actually a binary file it's not, it's a script that run Java with some parameters and and if I run Java with modules you can see that there are Java base which is a module which you get implicitly in every case and there's my app module and new generator and some others and if you see it has 44 max so it's not smallest it's not like if you build it in C but I think it's about 70 have something about 70 max so I think this is really nice it goes with IoT you can take this deploy and run so that's all I got can you go two slides back one more okay we have somewhere else anyway you wrote that you can have the same module depending on module in version 1 and other modules depending on the same module but in version 2 you know how it resolves yeah but unfortunately versions are not solved so you can't have two versions of same module so you have to choose so it is not a runtime thing it's not based on class loaders it's a compile time thing if I understand it it's not you can for example compile with one module and at the runtime put another OSGI works the way that you put class loaders and each module is loaded by by a class loader and that's the way how they manage to shield the modules is it the same way on the other sorry yeah it isn't really it isn't if you look on some presentations it's usual questions how it solves the difference I just want to say that it's work for Maven it's not for Java it's not for presentation all the models that might happen so you don't want that okay thank you