So the main idea of this section is to show you some useful information that will help you migrating
projects to java 9 or some of your earlier versions projects created in early versions of the JDK
and along the way we should say some common errors that you might come across while migrating projects.
And also if you're actually creating new projects with Java 9.
So what we need to do is have a project file and download zip file from a project the music
project that we used earlier in this course and you can grab that from the resources section of this video.
What's the first thing I'm going to go to the folder where I've got my downloaded music file. Alright, so
we can see here we've got this music start.
And basically what I've done is I've just unzipped the file,
so you just unzip it, go into the folder structure you want to make sure you can see zip
And as I say that tells me that it's in the right area.
Alright, so let's now go to different import, IntelliJ
Whenever never get to that folder and is kind of you can see I had to folder where the zip file was
and I unzipped it into that folder.
So I'm going into that folder that has actually got the libs and SSA folders so you can see those
you've selected the right folder and open we get this option on the screen.
You want to click on Create project from existing sources.
The next project name you can leave that all as default.
The project name and location and format.
Next, the source files it'll give you the location to the path with basically the files from src folder.
We'll leave that is that folder site.
Next you can say that it's found the sequel like jdbc driver that we used in that earlier section.
This course leads us to default because we want to keep that next.
The suggested module structure for the project.
Nothing to change there, click on next. Now on the next screen, before you see no framework's detected.
You may or may not see an option on the screen to select the JDK.
You can see in my case I didn't get that option.
But if you have, select one point if you've got it installed on your system or JDK not if you haven't
and you've got JDK 9 then you can then just select that.
So Mike I didn't get asked that question so I can just click on finish and we've got a project that's
being created for us. Now before we run the project,
two things we need to do:
we're going to expand this,
we're going to do is right click on the project and I'm going to down and select open module settings,
I'm going to check which is the sdk by clicking down here.
You can see I've got JDK 8 and 9.0
Ok, I've got JDK 8
You could see by here the name it's pretty clear is that which is which, in JDK 9 in my system.
So I'm going to leave JDK, in other words 1.8 here.
We're going to try running it with that first.
So I don't need to actually make any changes because at one point it was selected.
What I'm going to do is come back here to project and make sure that this is set correctly.
So if you haven't got to allocate you want to select triadic I know in my case I would actually run
this with JDK 8 first and select to make sure that that version is selected.
So the reason we're doing that is to make sure we treat the right the right high level because if we
choose an earlier version and if we're using features that were introduced in a later version of the
Java compiler will actually come up with an error for those particular Come on.
Leave it on JDK 8 in this case.
So I'm going to run than try.
First I'm going to click on OK.
I'm going to get back in there for a reason just to show you that there is a program click on for much
of settings again and you can see here we've got some problems going to click on that.
And you could say that we've got a few different errors here.
But they sqlite errors that we can't ignore that is because we're not using sqlite in this course
or this project.
But what we do want to look at here is the library sqlite jdbc is not used.
So we actually can fix it and he might want to do is click on add to dependencies.
And what we could have done instead has another way of fixing it.
I have two modules, we could from there add the java file manually.
I think this is probably an easy way of doing that, so we can fix it again at the dependencies.
And you could say that it's telling us where it much going to be added to.
It's going to click on ok and you can see the error has now disappeared.
The problem's been resolved.
Once you've got these two on a sqlite that errors as I mentioned we're not using that in this course
and you probably won't see that come up on your computer so this probably can just click on ok.
That's another time that I'm going to put up the source card let's just give this a bit of a run.
So I just select mine right click and select Run mind of mine and he
and can say that we've got an application here took a while to live but now we've got our music database
and you've seen this and in any section and the course
you can see the various artist.
So that's working nicely.
So that's running in the JDK 8.
And no problems no surprises that it worked fine.
Let's close it down.
And closing them on.
And this time let's now go back and get this running on JDK 9, go there and I can click
on file and click on file and select structure if I want to, project structure.
That's probably that's one way of doing it with a right click like I did before but I'm going to click
file project structure, so that project is not already selected which it wasn't for me.
And obviously here now we need to specify JDK 9.
Come down here and choose JDK 9 here and most I can choose under Project language level 9, modules
private methods and interfaces devices etc..
So basically we're telling intelligence to use JDK 9 and we're also changing the language level
to as well so that we can actually run it, click on ok.
You can say that some compilation going on now or actually getting it compiled under a JDK and on there
the first time you run the JDK 9, it may take some time to stop but once it's run
once you find that it'll be significantly faster.
So I don't know if that's compiled.
We can just go ahead right click it and select run again or select main.main
You see that it's loading, everything working nicely there, show albums for the
artist and that's when it can also list down.
The other thing tonight was was going to close that down and he can say clearly that we're running JDK 9
over here and earlier in the video you saw that there's actually error, was a whole lot of error
which is a documented file java 1.8 and some computers and that was also showing it
was actually not causing the program to stop working or anything like that.
But the point here is you can say that clearly we're running this in JDK 9.
As you can see, a project written in the JDK 8 version works without any problems when using JDK 9.
So that's only the start though, in the next video
let's start discussing how to split the project into multiple modules, so see you in the next video.