Skip to content

Setting up the development environment

Mario Muñoz edited this page Jun 24, 2014 · 2 revisions

Checking out the code

Just navigate into a directory of your convenience and checkout the code from this repository using the command:

git clone https://github.com/mariomgal/eurosentiment-tutorial-java.git

Building the project

The project is built using Apache Maven. You can use any editor of your choice for coding, here some steps are given for the most usuals ones (Eclipse and IntelliJ Idea).

Building the project in Eclipse

  • Open a shell window and navigate to the directory where you just checked out the project code.
  • Execute the maven command mvn clean eclipse:eclipse.
  • Open Eclipse and navigate to the menu File -> New -> Java Project.
  • Uncheck the "Use default location" option and select the location of the code.
  • Click "Finish". You should be ready to start coding.

Building the project in IntelliJ Idea

  • Just open IntelliJ Idea, navigate to File -> Import project and select the pom.xml file in the projects' folder. That's all.

Running the default example

Inside your IDE

The project comes with a simple default sentiment service already implemented and deployable as web service. Just run the class samples/Application.java inside your IDE. It will start an emmbedded web server in http://localhost:8090/sentiment to which you can send POST requests and examine the results.

This approach is useful for doing specific tasks at the development stage, such as code debugging.

Inside the shell

You can also run the project inside a command shell with Maven. Just go to the project folder and run the command mvn spring-boot:run.

Troubleshooting

Eventually, you can face some errors while running the embedded web container. When this happens, it's usually useful perform clean operations, via command shell (mvn clean) or in the IDE (Project -> Clean, in Eclipse).