[MAC] Eclipse + Java Development Kit (JDK) Installation on macOS Catalina + First Java Project

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
and here and in this video tutorial I'm going to show you how to get eclipse in the Java programming language up and running on a Mac so specifically we are going to download the Java development kit we're going to download the Eclipse integrated development environment ide for short and then we're gonna go ahead and create our first simple program in a clip so we'll do that as quickly as possible so the first thing that you're going to need to do anything in Java is you're actually going to need the Java development kit ok so what I'd recommend doing is go ahead and and open up your spotlight so if you want to just click up in the corner on the little search icon and then search for a terminal and then go ahead and open up your terminal and you should be able to basically if you do Java space - version this will tell you if you have Java installed ok in my case you can see no Java Runtime present requesting install now you may have some kind of something pop-up that has a version you know Java 8 point something point something or 11 point something or 13 whatever it is and in that case you already have Java installed if you want to even go ahead and go along this process with me to download the newest version but if not you you're probably already in good shape but I do want to emphasize that there is what's called the JRE which stands for Java runtime environment that's a piece of software that you need just to run existing Java software programs that have been built using Java there's also the Java development kit so the Java development kit includes that JRE that runtime environment but it also has all the extra tools needed to actually compile and write java code so just beware that if you have Java dash version if that came up to something with something it's possible that you just have the runtime environment not necessarily all the extra tools that you'll need to write and compile Java code so you saw when I actually clicked or type Java dash version and notice the space as well and I hit enter it came up with this hey do you want to install Java go ahead and click the more info and what that will do is it'll actually take you to the Oracle comm now Oracle has basically been the gatekeepers of Java for a very long time and there are a lot of different versions of Java you can actually go ahead and type in Java versions and Google and it'll come up with a Wikipedia page here and this is a really neat thing to look at because at any time no matter when you're doing this video in the future you should be able to come look at this page you know basically be able to find the the the latest versions you can see here there are the LTS versions which stand for I believe long term stable or long term support in this case and then there's newer versions so you always want to go with typically you want to go with the latest LTS version even though in this case version 13 is out in version 14 will be out soon maybe fifteen sixteen seventeen by the time you watch this video you you typically want to go with the latest long-term support version because it's just gonna be more stable however it used to be that you could come here and what I would typically do is just go to download here's the latest version and then you could basically come down and you would say I accept and Mac OS you'd basically find your version and download that dmg file but what you'll see here is it actually wants me to log in with an Oracle account now I could create one but it's to be a little bit intrusive it's asking me for my phone number and address and all kinds of stuff like that and what's actually fairly new and true about Oracle is that they're kind of closing off of there there they're a JDK so they're they're not really meant for for you and me the average developer they're kind of meant more for the corporate world now they actually have open source versions of their their code you can find what's called open JDK but that's just the source code so what you'd probably want to do if you don't want to necessarily have your all your information given to them as well as just be aware that this Oracle even if you do go ahead and do that you download a version it's technically not for commercial usage unless you're paying them some some money so what I typically recommend doing is going out to Google and typing adopt OpenJDK okay and adopt open JDK what this is is this is pre-built versions of the open JDK library which again open JDK is coming from Oracle so you're you're still getting the good stuff so to speak now like what I would just recommend a moment ago was to download the JDK 11 but I've actually just tested this and for some reason that's not working with eclipse Oh JDK 8 has been out for quite some time and it is just kind of the the old faithful right old reliable so what I'm actually going to recommend doing is go ahead and download the the eight version LTS eight and you can keep the hot spot open up there okay so go ahead and download that and then at the same time you may want to open up a browser and type in Eclipse actually what I'll first do is I'll type in Java IDE and you'll see there are a lot of different options for our integrated development environments okay and again an IDE is basically something that allows you to write code and compile code it's really just a program for for writing your code and kind of giving you some nice highlighting and just makes programming a little bit easier it doesn't actually compile compile your code that's what this JDK is going to do for us there's a lot of different options some of the top three right here Eclipse NetBeans and IntelliJ IntelliJ is kind of the new one the very popular it kind of pushes you towards a paid version though NetBeans is the super old one Eclipse is kind of in the middle I I recommend eclipse because it's free and if you learn to write code and Java and eclipse then you can actually kind of retool it to write C++ code or Python so it's a really versatile and free integrated development environment so I'm gonna go ahead and actually just search for Eclipse and we'll go and we will go to the downloads okay and you should see yeah big orange download 64-bit version there and this is gonna figure out that you're on a Mac and it's going to download the Mac version ok so you can see I'm downloading open JDK and eclipse now I have actually already installed or downloaded these these files just to kind of speed this up so I'll go ahead and cancel these two downloads okay and minimize okay so again I have these 2 download files so again at this point if I type in Java dash version it's basically gonna say hey nothing's there so let's go ahead and run our open JDK 8 go through the prompts I will agree to those terms go ahead and put it in your login credentials for your Mac and then hit close ok so I'm gonna go ahead and run this come in one more time Java space - version and now you won't fact see open JDK version 1.8 open JDK runtime environment and so on and so forth ok so this is good news so now what I want to do is over and my clips download go ahead and just double click that that's going to create this installer so you can go ahead and run the installer by double clicking it and this should eventually run if we just kind of click open ok now this may take a little bit of time depending on how fast your computer is and whatnot but essentially this will install our our Eclipse development environment integrated development environment for us so in my case can I just wait here for just a moment and when this does finally get through there it is we are going to go ahead and select the Eclipse IDE for Java developers and go ahead and click install go ahead and accept that you can see here it did find my adopted open JDK version back there so that was good you'll go ahead and just accept all the licenses while it installs okay so I'll go ahead and Trust these certificates and there we go alright so gonna go ahead and launch eclipse should be in your launchpad now hopefully guess it's not quite there yet see ya okay so anyway when you launch eclipse it's going to ask you to select a workspace so pretty much wherever you want to put that on your computer it's fine but go ahead and click Launch one thing I will say about clips is it's not the lightest weight IDE out there it's as you can already tell it's can be a little bit slow and clinically clunky especially loading up but once you get it up and running it usually you won't have any problems whatsoever okay so once we get Eclipse up and running you'll see here a few options we'll go ahead and just create our Java project so click create a Java project and let's give it a project name so something like my first project ok so you will see that it does have the execution environment so we'll just go ahead and keep that 1.8 selected and it did find our adopt open JDK 8 and so for the most part I'm just gonna type in a project name and click finish ok and that's going to bring you to the package Explorer over here with my first project so go ahead and click to expand that little arrow and in this source directory this is where we're going to create our first class our first java class so go ahead and right click on that source directory and then go hover over new and click on class ok and then in the name you're just going to want to do something like my first program okay and the only other thing you want to make sure you do is click this public static void main ok and then go ahead just click finish you don't need to click anything else or type in anything else ok and this public static void main this is basically what Java will look for to know where to start running your code if it finds this public static void main and you'll go ahead and this is this whatever you have in here will actually get executed so let's go ahead and just do our first hello world so system dot out dot print line and we will do two quotations and we'll say hello world with dr. dan okay and then go ahead and save your file and you should be able to click this green play button ok and you'll see that all the way down here at the bottom hello world of dr. dan so congrats you just ran your first java program if you want to run another program you can do that by essentially going back over here to your source directory and just right clicking new class we'll just go to that same process and we'll say my second program alright and again make sure you do public static void main click finish ok and we'll do a system dot out dot print line Congrats you're a pro now right you just written your second program make sure you include that semi clone at the end you're well on your way okay so I'm gonna do a command S or Apple s just save these files before you run them then go ahead and click the play button so congrats you're pro now you should be able to switch back and forth between these two between these two programs by just clicking on the different clicking on the different up tabs up here in executing different programs if for some reason you get you get lost or you you lose that console window and you hit play again it'll basically bring it back for you if for some reason the play button is not working you click this little black arrow and then do run as and Java applications should usually do the trick for you just select that particular program this may happen sometimes your package Explorer you accidentally closed it and you're trying to figure out how do I get it back well the way that you do that you just come up to here to window for your your Eclipse menu go to window and then you do show view and then you can find the package Explorer you can find the console most of the items that you are looking for if they're not here then you can go to other and you'll find it ok so there we have our package Explorer in that way I can look through all kinds of different all kinds of my code and my projects okay so maybe at this point you're just starting with the clips and you're wondering where do I go from here what I would recommend is going on to the internet you can type in hello world with doctor Dan github ok and if you go to my github page for hello world with doctor Dan what you will find is a ton of code okay you will find basically everything you could ever want to know about programming and Java through eight modules each module has a number of lessons in it and I start from the beginning I assume you know nothing so you can actually come and see all the the code and if you if you're really kind of take to self-study and you can basically read the comments in the code if you want again just everything from the basics through functions and storage object-oriented programming from basic object-oriented programming to advanced the object-oriented programming how to handle exceptions and and file input and output memory organization basic data structures such as sets and maps and then further on to threads gooeys and api's making calls to third-party APs like Yelp API and on and on so all this source code is available for free to you too basically if you want to teach yourself if you do want some in-depth tutorials you can basically go to hello dr. dan comm where I have hours and hours 50 60 70 hours of video content literally walking you through all of those source code files that I just showed you so I teach with no steps skip so you can basically go through and and learn to program from scratch basically this is going to be an entire year's worth of content is gonna take you from zero knowing absolutely nothing to being really a great programmer so I encourage you to check out hello world with dr. it's really hello dr. Dan comm hope to see over there and hopefully this was a good tutorial to get you started with Java development on a Mac
Info
Channel: Daniel Grissom
Views: 44,692
Rating: undefined out of 5
Keywords: mac, macOS, Catalina, JRE, JDK, Java, Hello World, Eclipse
Id: 75Y0JjxgAEM
Channel Id: undefined
Length: 15min 51sec (951 seconds)
Published: Tue Feb 18 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.