Setting Up Your Spring Boot Environment

Software Needed

  • JDK 1.8
  • Heroku CLI
  • IntelliJ by JetBrains

You can download the Java Development Kit or JDK from It gives your machine all the tools it needs to create a Java application. Just click on the JDK download button and select the platform that you are using (if you are using windows and you aren't sure if you are 64 bit or 32 bit, at this point, you are probably using a 64 bit machine). Once downloaded, run the installer to install the JDK on your machine and reboot it for the next step.

The Heroku Command Line Interface or CLI can be downloaded from It gives your machine the tools it needs to execute Heroku commands from the command line and use the git version-control software. Once you run the installer, you should open a terminal window and type heroku login, if you have installed the software properly, the system should ask for your login and password. If not, you will get an error.

Developing with Spring Boot doesn't require IntelliJ( You can work with Eclipse ( or STS(, but IntelliJ is my favorite and it is free for use by students! If you have installed the other two components, installing IntelliJ should make you ready for writing your first Spring Boot application.


Slowly I Turned (Setting up JPA for Java)

A lot of my java students have trouble getting JPA set up in Eclipse, so I have included here A way to get JPA installed and setup. I do not assert or even believe that it is the only way to set up JPA, but it is a way that works that my students can use 

1) First Create a New Java Project

2) Click the Next Button (not the Finish button) and get the Java Settings Screen.

3) Click on the Libraries tab so you can add the necessary jar files to the build path.

4) Click on the Add External JARs… button and select the eclipselink.jar file and click Ooen

5) Click on the Add External JARs… button and select javax.persistence_2.1.0.v201304241213.jar (or whatever the current version is)

6) Click on the Add External JARs… button and select ojdbc6.jar (or whatever the current version is) and click Finish.

7) Right-Click your project in the Project Explorer and select properties from the drop-down.

8) Select Project Facets from the List on the Left…

9) If you see the screen below, you need to click the “Convert to faceted form…” link…

10) This project has a Java version level that is too low. Make the window a little wider so that you can see the controls to increase the java level.

11) Click the drop-down triangle next to the number that is on the line with the Java Project Facet

12) Click on the checkbox next to JPA and you will be asked to do some configuration. Click the link and get the following screen. Set the platform to EclipseLink, the JPA Implementation Type to Disable Library Configuration, and the Connection to the name of your connection. Once this is done click the connect link immediately under and to the right of the connection drop down. And then click OK.

13) Click Apply to save your JPA settings…

14) Look in the JPA Content container inside your project and double-click it.

15) This is the dialog box for configuring your persistence.xml file

16) If you click the General tab, you will see the raw xml of the persistence file

17) On the General tab, set the Persistence Provider to   org.eclipse.persistence.jpa.PersistenceProvide

18) Uncheck the Exclude unlisted classes checkbox…

19) On the connection tab, change the Transcation Type to Resource Local...

20) After that, click the Populate from connection link…

21) A dialog will appear asking you to select your connection, click Ok after you have done so…

22) The dialog should now look like this…

23) If you click on the source tab, the XML should now look approximately like this… Save the file changes and you are done…

24) Right-Click your project and Select New… JPA Entities from Tables…

25) This is the Generate Custom Entities dialog. If you completed all the previous steps you should see your connections listed and when connected you will see your schemas and tables listed…

26) Once you have selected the Connection, the Schema and at least one Table, you should see the Next button light up...

27) This screen will be blank if you have only selected one table (and possibly even if you have selected multiple tables but they don’t have any relationship to each other

28) Hit Next on this screen too…

29) Hit Next again (but this is where you would customize the name of the class and/or the names of the columns)…

30) Once you click Finish, you should right-click the project name again…

31) Select New… Class…

32) This is the class creation dialog, the main things you want to do are set your Package to customTools, your name to DBUtil and then click Finish…

33) You will get a class on your screen ready for editing. Edit it to look something like this…

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class DBUtil {
 private static final EntityManagerFactory emf =
Persistence.createEntityManagerFactory("name of your persistence unit");
 public static EntityManagerFactory getEmFactory() {
return emf;

34) Right-Click the Project Name and Select New… Class…

35) For this class just pick a name and check the public static void main(String[] args) checkbox…

36) After you click Finish, edit the class to look like this:

import javax.persistence.EntityManager;
import data.DBUtil;

public class QS3 {
 public static void main(String[] args) {
EntityManager em = DBUtil.getEmFactory().createEntityManager();
try {
model.DemoCustomer cust = em.find(model.DemoCustomer.class, (long)2);
} catch (Exception e){
} finally {


37)  Edit the Generated Class and add , schema=”TESTUSER” to the table annotation like you see on line 13.

38) Now you are done…Run it and see where you are at…