- Replace all references of
Eclipse → Preferences → ...
toWindow → Preferences → ...
if you are using Windows or Linux.- If you worry that these settings will interfere with your other projects, you can use a separate Eclipse instance for TEAMMATES.
Supported Eclipse versions: Eclipse IDE for Java EE Developers version Neon or Oxygen.
-
You need the following plugins:
-
In Eclipse, do the following works before importing the project:
-
Google Cloud Tools: Go to
Eclipse → Preferences → Google Cloud Tools
and fill theSDK location
box with the directory of your installed Google Cloud SDK. -
JRE: Go to
Eclipse → Preferences → Java → Installed JRE
and ensure a JDK 1.8 (not JRE) entry exists.Note that the JDK to be used is not required to be the
default
.
-
-
Run this command to get necessary configuration files for Eclipse:
./gradlew setupEclipse
Verification: The folder
.launches
should be added to the project root directory. -
Import the project to your Eclipse instance.
- Go to
File → Import...
. - Select
Existing Gradle Project
underGradle
. ClickNext >
. - Set the
Project root directory
to the location where the repo is cloned. ClickNext >
. - If necessary, tick
Override workspace settings
and chooseGradle wrapper
. ClickFinish
.
After importing the project, you may see many errors/warnings on your marker tab. You need not be alarmed as these will be resolved in the next step.
- Go to
-
Configure the following project-specific settings (all can be found in
Project → Properties → ...
, except for the HTML, CSS and XML settings which can be found inEclipse → Preferences → ...
):-
Text encoding:
Resources
→ change theText file encoding
setting fromDefault
toOther: UTF-8
. -
JDK:
Java Build Path → Libraries
→ ensure that the system library used is JDK 8. -
Compiler compliance:
Java Compiler
→ tickUse compliance from execution environment 'JavaSE-1.8' on the 'Java Build Path'
. -
Indentation: In TEAMMATES, we use 4 spaces in place of tabs for indentations. Configure for all the languages used in TEAMMATES:
- Java:
Java → Code Style → Formatter → Edit → Tab policy → Spaces only
. - JavaScript:
JavaScript → Code Style → Formatter → Edit → Tab policy → Spaces only
.
You can find the Web and XML options in
Eclipse → Preferences → ...
.- HTML:
Web → HTML Files → Editor → Indent using spaces
. - CSS:
Web → CSS Files → Editor → Indent using spaces
. - XML:
XML → XML Files → Editor → Indent using spaces
.
- Java:
-
Validation: Go to
Validation → ...
- Disable validation for HTML, JSP, and XML: Uncheck the
Build
option forHTML Syntax Validator
,JSP Content Validator
,JSP Syntax Validator
,XML Schema Validator
, andXML Validator
. - Disable validation for JavaScript and JSON files in
node_modules
folder: Click the...
settings button forJavaScript Validation
→ ifExclude Group
is not already in the list then clickAdd Exclude Group...
→Exclude Group
→Add Rule...
→Folder or file name
→Next
→Browse Folder...
→ navigate to thenode_modules
folder and confirm →Finish
. Similarly forJSON Validator
.
- Disable validation for HTML, JSP, and XML: Uncheck the
-
-
Clean
the project for all changes to take effect. Ensure that there are no errors. Warnings are generally fine and can be ignored.If you are using Eclipse Neon, you will find that all declarations of
import
andexport
in JavaScript files are marked as errors. This is fine and is not a cause of concern. -
To set up some static analysis tools, refer to this document.
-
To move on to the development phase, refer to this document
Note: It is not encouraged to run Gradle tasks via Eclipse.
- Replace all references of
IntelliJ IDEA → Preferences
toFile → Settings
if you are using Windows or Linux.
Supported IntelliJ versions: IntelliJ IDEA Ultimate Edition (required to work with Google App Engine). You can sign up for the free JetBrains student license if you are a student registered in an educational institution.
-
You need a Java 8 SDK with the name
1.8
defined in IntelliJ IDEA as follows: -
You need the Google Cloud Tools plugin installed and configured:
- During installation, you may encounter two prompts: one to install the
Google Account
plugin dependency and another to disable the obsoleteGoogle App Engine Integration
plugin. AnswerYes
to both prompts. - After installation, restart IntelliJ IDEA and configure the plugin.
Click
Configure → Settings/Preferences
(orIntelliJ IDEA → Preferences
if a project is currently open), go toOther Settings → Google → Cloud SDK
, and select your Google Cloud SDK directory.
- During installation, you may encounter two prompts: one to install the
-
Import the project as a Gradle project as follows:
- Click
Import Project
(orFile → New → Project from Existing Sources...
if a project is currently open). - Select the local repository folder and click
Open
. - Select
Import project from external model
and thenGradle
. - Click
Next
. - Check
Use auto-import
and uncheckCreate separate module per source set
. - Ensure
Create directories for empty content root automatically
is unchecked. - Ensure
Use default gradle wrapper
is selected. - Ensure for
Gradle JVM:
that a JDK 8 with a name of1.8
is selected. - Click
Finish
. Wait for the indexing process to complete. - You should see a dialog box with the message:
Framework detected: Google App Engine Standard framework is detected.
.
OR
Frameworks detected: Web, Google App Engine Standard frameworks are detected
.
ClickConfigure
and ensure that only theGoogle App Engine Standard
framework is shown, then clickOK
. If there are other frameworks shown, clickCancel
and wait until indexing completes, then try again.If you closed or missed the dialog box, go to
View → Tool Windows → Event Log
. You should see the same message as the dialog box, clickConfigure
and thenOK
.
- Click
-
Configure the project settings as follows:
In TEAMMATES, we have standards defined for indentation. See Coding standards in Supplementary documents.
- Open
IntelliJ IDEA → Preferences
. - Go to
Editor → Code Style
and ensure thatUse tab character
is unchecked forJava
,JavaScript
,JSON
,CSS
andXML
. - Ensure that
Tab size:
,Indent:
andContinuation indent:
are4
,4
and8
respectively for the different languages. - Ensure
HTML
hasUse tab character
unchecked and setTab Size:
,Indent:
andContinuation indent:
to2
,2
and4
respectively. - Ensure
JSP
hasUse tab character
unchecked and setTab Size:
,Indent:
andContinuation indent:
to2
,2
and4
respectively.
Go to
Editor → File Encodings
and ensure thatProject Encoding
andDefault Encoding for properties files
is set toUTF-8
.Go to
Languages & Frameworks → JavaScript
and selectECMAScript 6
for theJavaScript language version
. - Open
-
Click
OK
. -
Run this command to set up the run configurations for IntelliJ:
./gradlew setupIntellij
-
To set up some static analysis tools, refer to this document.
-
To move on to the development phase, refer to this document.