Skip to content

Commit e83bada

Browse files
committed
Updated docs
1 parent edc690c commit e83bada

File tree

1 file changed

+28
-35
lines changed

1 file changed

+28
-35
lines changed

docs/java-getting-started.md

Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ end
1717

1818
<h2 data-next-message="I'm ready to start">Introduction</h2>
1919

20-
This tutorial will have you deploying a Java app in minutes.
20+
This tutorial will have you deploying a Java app in minutes.
2121

2222
Hang on for a few more minutes to learn how it all works, so you can make the most out of Heroku.
2323

@@ -71,16 +71,16 @@ Download and run the installer for your platform:
7171
</div>
7272
</div>
7373

74-
When installation completes, you can use the `heroku` command from your terminal.
74+
When installation completes, you can use the `heroku` command from your terminal.
7575

7676
<div class="only-windows">On Windows, start the Command Prompt (cmd.exe) or Powershell to access the command shell.</div>
7777

78-
Use the `heroku login` command to log in to the Heroku CLI:
78+
Use the `heroku login` command to log in to the Heroku CLI:
7979

8080
```term
8181
$ heroku login
8282
heroku: Press any key to open up the browser to login or q to exit
83-
› Warning: If browser does not open, visit
83+
› Warning: If browser does not open, visit
8484
› https://cli-auth.heroku.com/auth/browser/***
8585
heroku: Waiting for login...
8686
Logging in... done
@@ -98,11 +98,11 @@ Note that if you’re behind a firewall that requires use of a proxy to connect
9898
In this step, you will prepare a sample application that's ready to be deployed to Heroku.
9999

100100
>callout
101-
>If you are new to Heroku, it is recommended that you
101+
>If you are new to Heroku, it is recommended that you
102102
>complete this tutorial using the Heroku-provided sample application.
103103
>
104104
>However, if you have your own existing application that you want to deploy
105-
>instead, see <a href="https://devcenter.heroku.com/articles/preparing-a-codebase-for-heroku-deployment" target="_blank">this article</a>
105+
>instead, see <a href="https://devcenter.heroku.com/articles/preparing-a-codebase-for-heroku-deployment" target="_blank">this article</a>
106106
>to learn how to prepare it for Heroku deployment.
107107
108108
To create a local copy of a sample app that you can deploy to Heroku, execute the following commands in your local command shell or terminal:
@@ -170,7 +170,7 @@ $ heroku logs --tail
170170
2017-04-20T15:06:33.778990+00:00 heroku[web.1]: State changed from starting to up
171171
```
172172

173-
Visit your application in the browser again to generate another log message.
173+
Visit your application in the browser again to generate another log message.
174174

175175
Press `CTRL+C` to stop streaming logs.
176176

@@ -190,7 +190,7 @@ Procfiles can contain additional process types. For example, you might declare o
190190

191191
<h2 data-next-message="I know how to scale my app">Scale the app</h2>
192192

193-
Right now, your app is running on a single web [dyno](dynos). A dyno is a lightweight Linux container that runs the command specified in your `Procfile`.
193+
Right now, your app is running on a single web [dyno](dynos). A dyno is a lightweight Linux container that runs the command specified in your `Procfile`.
194194

195195
You can check how many dynos are running using the `heroku ps` command:
196196

@@ -200,7 +200,7 @@ You can check how many dynos are running using the `heroku ps` command:
200200

201201
By default, your app is deployed on a free dyno. Free dynos sleep after thirty minutes of inactivity (i.e., if they don't receive any traffic). This causes a delay of a few seconds for the first request upon waking. Subsequent requests will perform normally.
202202

203-
Free dynos consume from a monthly, account-level quota of [free dyno hours](free-dyno-hours). As long as the quota is not exhausted, your free apps can continue to run.
203+
Free dynos consume from a monthly, account-level quota of [free dyno hours](free-dyno-hours). As long as the quota is not exhausted, your free apps can continue to run.
204204

205205
To avoid dyno sleeping, you can upgrade to a hobby or professional dyno type as described in [Dyno Types](dyno-types). For example, if you migrate your app to a professional dyno, you can easily scale it by running a command telling Heroku to spin up a specific number of dynos, each running your web process type.
206206

@@ -212,15 +212,15 @@ Scale the number of web dynos to zero:
212212
:::>- $ heroku ps:scale web=0
213213
```
214214

215-
Access the app again by refreshing your browser or running `heroku open`. You will get an error message because your app no longer has any web dynos available to serve requests.
215+
Access the app again by refreshing your browser or running `heroku open`. You will get an error message because your app no longer has any web dynos available to serve requests.
216216

217217
Scale it up again:
218218

219219
```term
220220
:::>- $ heroku ps:scale web=1
221221
```
222222

223-
To prevent abuse, scaling a non-free application to more than one dyno requires [account verification](account-verification).
223+
To prevent abuse, scaling a non-free application to more than one dyno requires [account verification](account-verification).
224224

225225
<h2 data-next-message="I've installed the app dependencies locally">Declare app dependencies</h2>
226226

@@ -248,7 +248,7 @@ Run `mvn clean install` in your local directory to install the dependencies, pre
248248

249249
If you do not have Maven installed, or get an error like `'mvn' is not recognized as an internal or external command`, then you can use the wrapper command instead by running `mvnw clean install` on Windows or `./mvnw clean install` on Mac and Linux. This both installs Maven and runs the Maven command.
250250

251-
The Maven process compiles and build a JAR, with dependencies, placing it into your application's `target` directory. This process is accomplished with the `spring-boot-maven-plugin` in the `pom.xml`.
251+
The Maven process compiles and build a JAR, with dependencies, placing it into your application's `target` directory. This process is accomplished with the `spring-boot-maven-plugin` in the `pom.xml`.
252252

253253
If you aren't using Spring in your app, you can accomplish this with the following plugin configuration in the `pom.xml` file.
254254

@@ -278,7 +278,7 @@ Start your application locally with the `heroku local` CLI command (make sure yo
278278

279279
Just like the Heroku platform, `heroku local` examines your `Procfile` to determine what command to run.
280280

281-
Open [http://localhost:5000](http://localhost:5000) with your web browser. You should see your app running locally.
281+
Open [http://localhost:5000](http://localhost:5000) with your web browser. You should see your app running locally.
282282

283283
To stop the app from running locally, go back to your terminal window and press `CTRL+C` to exit.
284284

@@ -378,8 +378,11 @@ Heroku lets you externalize your app's configuration by storing data such as enc
378378

379379
At runtime, config vars are exposed to your app as environment variables. For example, modify `src/main/java/com/example/Main.java` so that the method obtains an energy value from the `ENERGY` environment variable:
380380

381+
```
382+
:::-- $ sed -e '56,68d' src/main/java/com/example/Main.java
383+
```
384+
381385
```java
382-
:::-- sed -e '56,68d' src/main/java/com/example/Main.java
383386
:::>> file.append("src/main/java/com/example/Main.java#56")
384387
@RequestMapping("/hello")
385388
String hello(Map<String, Object> model) {
@@ -426,9 +429,7 @@ Deploy your updated application to Heroku to see this in action.
426429
The `heroku run` command lets you run maintenance and administrative tasks on your app in a [one-off dyno](one-off-dynos). It can also lets you launch a REPL process attached to your local terminal for experimenting in your app's environment, or code that you deployed with your application:
427430

428431
```term
429-
:::-- $ heroku run java -version
430-
:::-- | grep -vq starting
431-
:::-> | grep -vq connecting
432+
:::>> $ heroku run java -version
432433
```
433434

434435
If you receive an error, `Error connecting to process`, then you might need to [configure your firewall](one-off-dynos#timeout-awaiting-process).
@@ -499,11 +500,7 @@ The example app you deployed already has database functionality, which you can r
499500
The code to access the database is straightforward. Here's the method to insert values into a table called `tick`:
500501

501502
```java
502-
:::-- sed -e '45,49p' src/main/java/com/example/Main.java
503-
504-
...
505-
506-
:::-- sed -e '66,109p' src/main/java/com/example/Main.java
503+
:::-> $ sed -n '45,49p;90,109p' src/main/java/com/example/Main.java
507504
```
508505

509506
This ensures that when you access your app using the `/db` route, a new row is added to the `tick` table, and all rows are then returned so that they can be rendered in the output.
@@ -529,22 +526,18 @@ Assuming that you have [Postgres installed locally](heroku-postgresql#local-setu
529526

530527
```term
531528
$ heroku pg:psql
532-
heroku pg:psql
533-
psql (9.3.2, server 9.3.3)
534-
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
529+
psql (10.1, server 9.6.10)
530+
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
535531
Type "help" for help.
536-
=> SELECT * FROM ticks;
532+
533+
DATABASE=> SELECT * FROM ticks;
537534
tick
538535
----------------------------
539-
2014-08-08 14:48:25.155241
540-
2014-08-08 14:51:32.287816
541-
2014-08-08 14:51:52.667683
542-
2014-08-08 14:51:53.1871
543-
2014-08-08 14:51:54.75061
544-
2014-08-08 14:51:55.161848
545-
2014-08-08 14:51:56.197663
546-
2014-08-08 14:51:56.851729
547-
(8 rows)
536+
2018-03-01 20:53:27.148139
537+
2018-03-01 20:53:29.288995
538+
2018-03-01 20:53:29.957118
539+
2018-03-01 21:07:28.880162
540+
(4 rows)
548541
=> \q
549542
```
550543

0 commit comments

Comments
 (0)