Skip to content

Using IntelliJ IDEA for ten.java

lol768 edited this page Jul 7, 2014 · 5 revisions

IntelliJ IDEA is a popular IDE with integrated Maven and Git support. This article will explain how to get up and running with IntelliJ.

Installing IntelliJ IDEA

To get started, download the installer from the IntelliJ Download page. For ten.java, the community edition will be more than enough.

Run the installer and the IDE will be installed. That's it!

Importing your project

Open the IDE and select the "Check out from Version Control" option:

Choose GitHub at the dropdown and enter your username and password when prompted:

You may be prompted for a master password. If you'd like to store your GitHub password securely, you can provide one.

Next, you'll be prompted for the VCS URL. In your browser, find the clone URL section of your GitHub repository (in the sidebar) and copy the URL. You'll probably want to use the HTTPS URL for this.

Paste the URL into the Clone Repository dialog that should have appeared and hit the Clone button:

Press Yes when prompted to checkout the project file. The project should now open and you should be able to view the sidebar by pressing Alt + 1.

Try opening the TenJava class. If you see a "Project SDK is not defined" notice, you'll want to click the configure link and add an SDK:

Using IntelliJ IDEA during the contest

Now that you've got the project setup, I'll explain how to commit, push and build.

Adding a run configuration

The first thing you need to do is tell IntelliJ IDEA how to build the project. To do this, click the dropdown next to the run button and choose the "Edit configurations..." option:

Add a new Maven configuration:

Supply the configuration with a name and click OK:

You can now build the project by clicking the green build button (). If everything worked, you should see a success message in the console:

Committing code

To commit code, right click on the project and choose the Git -> Commit Directory... option. This will open a dialog where you can type your commit message:

Choose the commit and push option and then hit push in the resultant dialog:

This will send your changes to GitHub. They'll be announced in our IRC channel, featured on the website (along with the most recent changes) and our build server will automatically build your latest code.

We strongly recommend you stay in our IRC channels throughout the contest if you can. If you join the #ten.commits channel, we'll ping you (notify you by saying your username in chat) if a build fails so you can figure out why and fix it. You can also chat and ask for help in the #ten.java channel if you need it.

Remember, if your project doesn't compile at all throughout the contest we cannot judge it. If a later build fails, we'll end up using the last successful build.

Note: There's no obligation to use IntelliJ's git support and some developers prefer other options. You're free to use GitHub for Windows, SourceTree, the command line or any other client if you prefer.

If you have any questions (about the contest, git, Maven etc), please don't hesitate to send us a tweet @tenjava or ask in our IRC channel.

Clone this wiki locally