1. Run `java --version`. Note, this may open a prompt you to install Java: click "More Info" and follow installation instructions. Once complete, rerun the previous command
1. The first line that this command gives you is the version of Java and the date of its release (e.g. `java 15 2020-09-15` tells you it is Java version 15)
1. Make sure the number next to `java.runtime.version` in the system.properties file in your repo matches your version of Java. If not, change that line of code. Then git add/commit/push
1. Now open the `system.properties` file that is at the root of this project. Make sure the number next to `java.runtime.version` in the `system.properties` file in your repo matches your version of Java. Eg `java.runtime.version=15` is the correct version for the above output from terminal. If not, change that line of code to the correct number from terminal. Then git add/commit/push
Set up an environment variable so your local spring app will use your local postgres database:
Set up an environment variable so your local spring app will use your local postgres database. In terminal:
**Important** - make sure you have a database named `contacts`, if you are using another database, be sure to change the last part of the url from `contacts` to the name of the database you want to use
Now start spring:
@ -53,6 +54,19 @@ go to http://localhost:8080/ to view local app (note this uses your local postgr
### in your terminal
### in your terminal
1. if running `psql` gives you "command not found", run `ln -s /Applications/Postgres.app/Contents/Versions/latest/bin/psql /usr/local/bin/psql`
1. run `heroku pg:psql`
1. once inside heroku's psql, run
1. `CREATE TABLE people (id SERIAL, name VARCHAR(16), age INT);`
1. `INSERT INTO people ( name, age ) VALUES ( 'Matt', 38 );`
1. `INSERT INTO people ( name, age ) VALUES ( 'Sally', 54 );`
1. `INSERT INTO people ( name, age ) VALUES ( 'Zanthar', 4892 );`
1. exit heroku psql with `\q`
1. run `git push heroku master`
1. run `heroku open` to see app (note this uses your heroku postgres database, which will have different data than your local db)
1. run `git push heroku master`
1. run `heroku open` to see app (note this uses your heroku postgres database, which will have different data than your local db)
@ -63,7 +77,7 @@ Open Postgres app and start the db
In terminal:
1. Go to repo root dir
1. Run `export JDBC_DATABASE_URL=jdbc:postgresql://localhost:5432/springreactapp` again
1. Run `export JDBC_DATABASE_URL=jdbc:postgresql://localhost:5432/contacts` again