Java Web Dev Projects
The steps here will walk you through setting up the repository that you’ll use to study example code, work on studios, and complete your first assignment of this unit.
Create a Fork of LaunchCodeEducation/java-web-dev-projects . Do not clone and create a local version of this repo just yet.
If the app opens up to an existing project, simply close that window to return to the welcome screen.
If you prefer to have IntelliJ NOT open your most recent project:
- Mac users: Select IntelliJ > Preferences > Appearance & Behavior > System Settings and un-check Reopen projects on startup.
- Windows users: Use File > Settings > Appearance & Behavior > System Settings.
The Welcome to IntelliJ dialog looks different now. It includes a list of your most recent projects. However, we have the same three options in the upper-right corner. Select Get from VCS.
Select the GitHub option on the left side of the next window. Click Log In via GitHub or Use token and follow the on-screen prompts.Note
To work with a remote repository in IntelliJ, you need to configure the program to access your GitHub account. We recommend authenticating your account using a token. This takes only one brief extra step, and will prevent you from having to update IntelliJ settings whenever you change your GitHub password.
Now return to the Repository URL tab. From the URL dropdown options, select your fork of
java-web-dev-projects, along with an appropriate destination directory (like the folder where you’ve stored other projects for this class).
When ready, click the Clone button!
If you’re asked about other settings for your project. Select the Next button every time to accept the default options.
When your project is ready, you’ll see a page that looks like the image below. Click on Load, if you are prompted to load the Gradle Build Scripts.
You should see the file structure of the project you have just set up. If you do not, click on the folder icon in the upper left corner.
Navigate down datatypes/datatype-examples/src/main/java/org.launchcode and double-click on the HelloMethods file. This will open it in the workspace to the right.
To run the HelloMethods program, click on the green arrow next to the class definition and select Run ‘HelloMethods.main()’ from the dropdown menu.
After a few seconds, you should see a new window appear with your program’s output.Note
You may have a message saying the Project JDK is not defined. Click on ‘Setup SDK’ and select the Java 17 version.
With that, you’re ready to go!
After setting up the project, if you experience
when you run the code, follow these steps:
Select File > Close Project. If you have any other IntelliJ projects open, close them as well.
You should see the IntelliJ startup window. Click the gear icon next to
java-web-dev-projectsand select Remove from Recent Projects.
From the same startup window, select File –> New –> Project from Existing Sources.
When prompted, select the
java-web-dev-projectsfolder and click Open.
In the next panel, select the Create project from existing sources radio button. Click Next.
Follow the steps that IntelliJ guides you through, accepting all defaults. Each time you are prompted to overwrite IntelliJ settings files, confirm that you want to do so.
Eventually the project will open, and you can successfully run your code!