- 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
and files.classpath
,.project
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:
UTF-8
is used for text encoding. Configure for all the languages used in TEAMMATES inEclipse → Preferences → ...
. Change toUTF-8
if it is not the default value.- General:
General → Workspace → Text file encoding
. - HTML:
Web → HTML Files → Encoding
. Alternatively, tickUse workspace encoding
. - CSS:
Web → CSS Files → Encoding
. - JSP:
Web → JSP Files → Encoding
. - XML:
XML → XML Files → Encoding
.
- General:
-
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: 4 spaces are used in place of tabs for indentations. For JSON, HTML, and HTML-like documents, 2 spaces are used instead. 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, XML, and JSON 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
. - JSON:
JSON → JSON 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
-
-
Refresh
andClean
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 a prompt to disable the obsolete
Google App Engine Integration
plugin. AnswerYes
. - 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 a prompt to disable the obsolete
-
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 following project-specific settings (all can be found in
IntelliJ IDEA → Preferences → ...
):-
Indentation: 4 spaces are used in place of tabs for indentations. For JSON, HTML, and HTML-like documents, 2 spaces are used instead. Configure for all the languages used in TEAMMATES:
- Go to
Editor → Code Style
. - Select
Project
forScheme
if you do not wish to make the rules the default for your IDE. - For
Java
,JavaScript
,JSON
,CSS
,XML
,HTML
, andJSP
:- Ensure that
Use tab character
is unchecked, andTab size:
,Indent:
, andContinuation indent:
are4
,4
, and8
respectively. - For
HTML
,JSON
, andJSP
, the numbers are2
,2
, and4
instead.
- Ensure that
- Go to
-
Text encoding:
UTF-8
is used for text encoding. Go toEditor → File Encodings
and ensure thatProject Encoding
andDefault Encoding for properties files
is set toUTF-8
. -
JavaScript: Go to
Languages & Frameworks → JavaScript
and selectECMAScript 6
for theJavaScript language version
.
-
-
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.