From the course: Java 8+ Essential Training: Syntax and Structure

How to use the exercise files - Java Tutorial

From the course: Java 8+ Essential Training: Syntax and Structure

Start my 1-month free trial

How to use the exercise files

- [Instructor] This course is accompanied by exercise files that you can use to follow along with the demonstrations on screen. I've copied the exercise files to my desktop but you can place them anywhere on your hard disk. The exercise files are organized by chapter. In some videos, particularly early in the course, I'm working in Jshell. Java nine's new command line environment for testing Java code. But for those exercises in the solutions directory under the folder for that video you'll find the resulting output from the Jshell session that I demonstrate. These are Java files that you can open in any text editor. You can use these files to examine the code that I typed and be able to copy and paste them into your own Jshell session. In other exercises I'm working with IntelliJ IDEA projects. You can identify those projects by the inclusion of folders named ".idea" and "src". On Windows, in Explorer, the .idea directory is visible by default. On MAC you won't see the directory in finder by default but it is there. That directory contains a variety of configuration files that are critical to the IntelliJ project structure. The important part of the code, though, is in the source directory, where you'll find a series of sub directories. Those are called "The Package Directories" and then the actual Java code file. You can open these files in any text editor as well. But really these kinds of projects are designed to be used from IntelliJ. To use them, open IntelliJ IDEA Community edition. Then on the "Welcome" screen click Open. If you placed your exercise files on the desktop you can press control D on Windows or command D on MAC to jump to the desktop directory. Then open the exercise files directory, navigate to the folder you're interested in, and you'll see that the project is marked by a little IntelliJ IDEA icon. Select the directory, and click OK, and that will open up the project. When the project opens the code file that I'm working in may or may not be visible. If it isn't go to the project window, you can open and close it from this tab on the left, or if that tab isn't invisible, go down to the lower left corner and choose project from here. Drill down to the com.example.javadirectory and double click the main class and you'll be ready to code in Java. Just as with the Jshell sessions for the IntelliJ projects I include finished versions of each project. You'll find those under the solutions directory under the sub directory for the chapter and for the video. You can open these in IntelliJ IDEA or you can open the source code files in any text editor to compare the finished code to the beginning code.

Contents