-
What's going on everybody? It's Bucky and
welcome to your very first Java tutorial.
-
Now in this tutorial, before we begin
writing any programs, we first need to
-
download something called the JDK. And
for all you new Java developers out there,
-
this is the program that let's you
actually write Java
-
and actually compile it.
-
And compile just means - uh -
transferring it from code you can
-
understand to code the
computer can understand.
-
So - uh - just follow me and by the end
you'll be able to write Java code.
-
So the first thing I need you to do is to
go ahead and
-
open up your Internet browser right here.
-
And once you have that open,
I'm going to use Firefax - uh Firefox -
-
go ahead and go to the website
java.sun.com.
-
And this is going to give you
Java's main page.
-
What you want to look for is the
download link and this is
-
going to give you a bunch of different
Java additions to download.
-
You're going to want to go to the
Java SE link.
-
This stands for Java Standard Edition.
So go ahead and click that.
-
And what we're looking for is something
called the JDK.
-
This stands for the Java Development Kit
so we can write and - uh, well -
-
compile Java programs.
-
Now we just want the top one
which is the standard one.
-
This EE stands for Enterprise Edition
and this NetBeans is something else,
-
we don't want that.
-
Just go ahead and find the
standard basic edition and click download.
-
And once you click that it's probably
going to bring you to a new page
-
- uh - let's see.
-
Yep, it's going to say 'Windows'
which we want and 'English' which we want.
-
Go ahead and agree and press continue.
-
Um - I already have this downloaded
so I'm not going to download it again,
-
that would just be stupid.
-
But once you download it,
it's going to give you an executable file.
-
Now, your executable file is going to
look something like one of these.
-
This is something else I downloaded but
it's going to give you a file like this,
-
called .exe.
-
Once you get that file,
go ahead and double click this.
-
And that's going to start the wizard to
download the JDK.
-
Now it also might give you a
file on your desktop right here.
-
Like, put it somewhere right here.
If it's right there,
-
then just double-click that.
And once you do,
-
a wizard is going to pop up and
you're probably going to have to click
-
'Next' forty times and
press 'I agree', 'I agree' to some stuff,
-
'Next', 'Next'.
-
But once that's all done, then you're
going to have the Java compiler
-
downloaded. Now let me show you guys
what the Java compiler is.
-
If you go to your start menu,
then press 'cmd' and press enter,
-
your command prompt is going to come up.
-
Now, what this allows you to do,
is have access to your Java compiler.
-
And again, like I said before, the
Java compiler allows you to transfer code
-
that you can understand to
code the computer can understand.
-
And that's what we just downloaded.
-
So, let's test it out.
-
javac
-
Press enter, nothing's working.
And nothing's working
-
because the Java compiler,
-
um - it has it downloaded but whenever you
try and use it,
-
it doesn't know where it is.
-
So let me show you guys how to do that.
-
And again,
pay very close attention to this.
-
Hopefully you downloaded it with
all the default settings.
-
Um, if you didn't, well you'll still be
able to see what's going on.
-
But, go ahead and in your start menu,
click on 'Computer'.
-
Now go ahead and click the local disk,
or whatever your main hard drive is,
-
then go ahead and click 'Program Files'.
-
Now you should have a folder
called 'Java', go ahead and click that.
-
Now go ahead and click the version JDK.
If you don't see this it means
-
you didn't download it right.
-
So go ahead and click that, JDK.
-
The next thing and last thing I want you
guys to do is click on the thing
-
that says 'bin', right here.
-
And remember you follow all these
instructions very carefully.
-
Next, right-click on any of these things
right here.
-
Just click on your top-most one.
Remember, right-click it.
-
And click 'Properties'.
-
Now this is where you're going
to tell Java to look for your compiler.
-
So it says 'Location'.
Go ahead and copy all of 'Location'.
-
Right-click it and copy it.
-
It should say something like
C:\Program Files\Java\[your version]\[bin]
-
The last thing,
make sure you get that 'bin'.
-
It's very important, if you don't see it,
do this tutorial again
-
and do exactly as I say.
-
Anyways, you want to see that 'bin'.
-
So once you have this golden code,
that's what we're looking for,
-
go ahead and 'X' out of that.
-
Now that's where the compiler is. So how
do we tell your computer to look there?
-
Well go ahead and [right] click
'My Computer' again, from the start menu.
-
And click 'Properties'. Remember, you
want to right-click it and click
-
'Properties'.
-
All these are very important.
-
Go ahead and click
'Advanced System Settings'.
-
And probably a little message is going
to pop up. If my computer is not freezing.
-
And it is so...
-
'My Computer'. 'Properties'.
'Advanced System Settings'.
-
There we go. Continue.
-
And you're going to see something in your
'System Properties'
-
called 'Environment Variables'.
-
Go head and click that.
-
And pay attention to what
I'm going to do here.
-
What we want to do is create
a new user variable.
-
Go ahead and click 'New'.
-
Now the variable name for this,
you have to write 'Path'.
-
P. A. T. H.
-
And the variable value is going
to write where that compiler is.
-
Remember, that link with the 'bin'.
That's why it's really important
-
you get that link.
-
Now go ahead and click 'OK'.
-
And, bam. Click 'OK' on this.
-
Okay, you now have your compiler set up
and ready to run.
-
So go ahead and go back to your
command line.
-
And in command line,
go ahead and type 'javac'.
-
And, unlike before, we now have a bunch
of crap that pops up.
-
And this crap means that our compiler
is ready and set and ready to go.
-
So now, with that being said, we know that
we're now able to write Java programs.
-
So in the next tutorial,
I'll show you guys how to do that.
-
But for now, just follow this tutorial.
-
Um, that's how you install Java on your
computer so you can actually
-
write Java programs.
-
If you didn't follow those instructions
exactly like I said,
-
um - you're not going to be able to
write Java programs on your computer.
-
So make sure you follow this tutorial
very carefully and do exactly as I did.
-
I know it's kind of a pain in the butt
but it will be worth it in the long run.
-
So thank you guys for watching,
make sure you get Java installed.
-
If you have any questions,
or I wasn't clear on anything,
-
just send me a message.
-
Or leave a comment and
hopefully I'll get back to you.
-
So again, thank you guys for watching.
Hopefully you have Java installed.
-
And in the next tutorial,
-
I'll show you guys how to write
a first Java program.
-
So thank you,
don't forget to subscribe to my channel.
-
I'll see you in the next tutorial.