You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/user_guide/instructions_to_run_generated_code.md
+87-46Lines changed: 87 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,24 +81,24 @@ TODO
81
81
82
82
Here are the detailed instructions for running the generated API Dash code in **Java (using `AsyncHttpClient`)** for macOS, Windows, and Linux:
83
83
84
-
---
84
+
### 1. Install Java
85
85
86
-
### **1. Install Java**
87
-
To run Java code, you need to have Java Development Kit (JDK) installed on your system.
86
+
To run Java code, you need to have Java Development Kit (JDK) installed on your system.
88
87
89
-
- Visit the official **[Java Downloads Page](https://www.oracle.com/in/java/technologies/downloads/#jdk23)** and follow the instructions to install the latest JDK on macOS, Windows, or Linux.
88
+
- Visit the official **[Java Downloads Page](https://www.oracle.com/in/java/technologies/downloads/#jdk23)** and follow the instructions to install the latest JDK on macOS, Windows, or Linux.
89
+
90
+
After installation, verify it by running:
90
91
91
-
After installation, verify it by running:
92
92
```bash
93
93
java -version
94
94
```
95
95
96
-
---
96
+
### 2. Add the `AsyncHttpClient` Library
97
97
98
-
### **2. Add the `AsyncHttpClient` Library**
99
98
To use the `AsyncHttpClient` library in Java, you need to add it as a dependency in your project.
100
99
101
-
#### Using **Maven**:
100
+
#### Using Maven
101
+
102
102
1. Add the following dependency to your `pom.xml` file:
103
103
```xml
104
104
<dependencies>
@@ -109,12 +109,13 @@ To use the `AsyncHttpClient` library in Java, you need to add it as a dependency
109
109
</dependency>
110
110
</dependencies>
111
111
```
112
-
3. Save the file and run:
112
+
2. Save the file and run:
113
113
```bash
114
114
mvn install
115
115
```
116
116
117
-
#### Using **Gradle**:
117
+
#### Using Gradle
118
+
118
119
1. Add the following line to the `dependencies` section in your `build.gradle` file:
@@ -124,9 +125,8 @@ To use the `AsyncHttpClient` library in Java, you need to add it as a dependency
124
125
gradle build
125
126
```
126
127
127
-
---
128
+
### 3. Run the Generated Code
128
129
129
-
### **3. Run the Generated Code**
130
130
After setting up Java and adding the `AsyncHttpClient` library, follow these steps to execute the generated code:
131
131
132
132
1.**Create a new Java file**: Save the generated code into a file with a `.java` extension, such as `ApiTest.java`.
@@ -139,50 +139,68 @@ After setting up Java and adding the `AsyncHttpClient` library, follow these ste
139
139
java ApiTest
140
140
```
141
141
142
-
---
143
-
144
142
## Java (HttpClient)
145
143
146
144
Here are the detailed instructions for running the generated API Dash code in **Java (using `HttpClient`)** for macOS, Windows, and Linux:
147
145
148
-
---
146
+
### 1. Install Java
147
+
148
+
To run Java code, you need to have Java Development Kit (JDK) installed on your system.
149
+
150
+
- Visit the official **[Java Downloads Page](https://www.oracle.com/in/java/technologies/downloads/#jdk23)** and follow the instructions to install the latest JDK on macOS, Windows, or Linux.
149
151
150
-
### **1. Install Java**
151
-
👉 Follow the instructions provided above under **Java (AsyncHttpClient)** for detailed steps on how to install the Java Development Kit (JDK) on macOS, Windows, or Linux.
152
+
After installation, verify it by running:
152
153
153
-
---
154
+
```bash
155
+
java -version
156
+
```
157
+
158
+
### 2. `HttpClient` Setup
154
159
155
-
### **2. `HttpClient` Setup**
156
160
The `HttpClient` library is included as part of the **Java SE 11** (or later) standard library.
157
161
- Ensure you have **Java 11** or a later version installed to use `HttpClient` without needing additional dependencies.
158
-
159
162
160
163
To confirm your Java version, run:
161
164
```bash
162
165
java -version
163
166
```
164
-
---
165
167
166
-
### **3. Run the Generated Code**
167
-
👉 Refer to the instructions above under **Java (AsyncHttpClient)** for steps to save, compile, and execute the Java code.
168
+
### 3. Run the Generated Code
168
169
169
-
---
170
+
After setting up Java and checking the version, follow these steps to execute the generated code:
171
+
172
+
1.**Create a new Java file**: Save the generated code into a file with a `.java` extension, such as `ApiTest.java`.
173
+
2.**Compile the file**: Use the following command in the terminal:
174
+
```bash
175
+
javac ApiTest.java
176
+
```
177
+
3.**Run the compiled program**:
178
+
```bash
179
+
java ApiTest
180
+
```
170
181
171
182
## Java (okhttp3)
172
183
173
184
Here are the detailed instructions for running the generated API Dash code in **Java (using `okhttp3`)** for macOS, Windows, and Linux:
174
185
175
-
---
186
+
### 1. Install Java
176
187
177
-
### **1. Install Java**
178
-
👉 Follow the instructions provided above under **Java (AsyncHttpClient)** for detailed steps on how to install the Java Development Kit (JDK) on macOS, Windows, or Linux.
188
+
To run Java code, you need to have Java Development Kit (JDK) installed on your system.
179
189
180
-
---
190
+
- Visit the official **[Java Downloads Page](https://www.oracle.com/in/java/technologies/downloads/#jdk23)** and follow the instructions to install the latest JDK on macOS, Windows, or Linux.
191
+
192
+
After installation, verify it by running:
193
+
194
+
```bash
195
+
java -version
196
+
```
197
+
198
+
### 2. Add the `okhttp3` Library
181
199
182
-
### **2. Add the `okhttp3` Library**
183
200
To use `okhttp3` in Java, you need to add it as a dependency in your project.
184
201
185
-
#### Using **Maven**:
202
+
#### Using Maven
203
+
186
204
1. Add the following dependency to your `pom.xml` file:
187
205
```xml
188
206
<dependency>
@@ -196,7 +214,8 @@ To use `okhttp3` in Java, you need to add it as a dependency in your project.
196
214
mvn install
197
215
```
198
216
199
-
#### Using **Gradle**:
217
+
#### Using Gradle
218
+
200
219
1. Add the following line to the `dependencies` section in your `build.gradle` file:
@@ -206,28 +225,42 @@ To use `okhttp3` in Java, you need to add it as a dependency in your project.
206
225
gradle build
207
226
```
208
227
209
-
---
228
+
### 3. Run the Generated Code
210
229
211
-
### **3. Run the Generated Code**
212
-
👉 Refer to the instructions provided above under **Java (AsyncHttpClient)** for steps to save, compile, and execute the Java code.
230
+
After setting up Java and adding the `okhttp3` library, follow these steps to execute the generated code:
213
231
214
-
---
232
+
1.**Create a new Java file**: Save the generated code into a file with a `.java` extension, such as `ApiTest.java`.
233
+
2.**Compile the file**: Use the following command in the terminal:
234
+
```bash
235
+
javac ApiTest.java
236
+
```
237
+
3.**Run the compiled program**:
238
+
```bash
239
+
java ApiTest
240
+
```
215
241
216
242
## Java (Unirest)
217
243
218
244
Here are the detailed instructions for running the generated API Dash code in **Java (using `Unirest`)** for macOS, Windows, and Linux:
219
245
220
-
---
246
+
### 1. Install Java
247
+
248
+
To run Java code, you need to have Java Development Kit (JDK) installed on your system.
221
249
222
-
### **1. Install Java**
223
-
👉 Follow the instructions provided above under **Java (AsyncHttpClient)** for detailed steps on how to install the Java Development Kit (JDK) on macOS, Windows, or Linux.
250
+
- Visit the official **[Java Downloads Page](https://www.oracle.com/in/java/technologies/downloads/#jdk23)** and follow the instructions to install the latest JDK on macOS, Windows, or Linux.
224
251
225
-
---
252
+
After installation, verify it by running:
253
+
254
+
```bash
255
+
java -version
256
+
```
257
+
258
+
### 2. Add the `Unirest` Library
226
259
227
-
### **2. Add the `Unirest` Library**
228
260
To use `Unirest` in Java, you need to add it as a dependency in your project.
229
261
230
-
#### Using **Maven**:
262
+
#### Using Maven
263
+
231
264
1. Add the following dependency to your `pom.xml` file:
232
265
```xml
233
266
<dependency>
@@ -241,7 +274,8 @@ To use `Unirest` in Java, you need to add it as a dependency in your project.
241
274
mvn install
242
275
```
243
276
244
-
#### Using **Gradle**:
277
+
#### Using Gradle
278
+
245
279
1. Add the following line to the `dependencies` section in your `build.gradle` file:
246
280
```gradle
247
281
implementation 'com.konghq:unirest-java:3.14.1'
@@ -251,12 +285,19 @@ To use `Unirest` in Java, you need to add it as a dependency in your project.
251
285
gradle build
252
286
```
253
287
254
-
---
288
+
### 3. Run the Generated Code
255
289
256
-
### **3. Run the Generated Code**
257
-
👉 Refer to the instructions provided above under **Java (AsyncHttpClient)** for steps to save, compile, and execute the Java code.
290
+
After setting up Java and adding the `Unirest` library, follow these steps to execute the generated code:
258
291
259
-
---
292
+
1.**Create a new Java file**: Save the generated code into a file with a `.java` extension, such as `ApiTest.java`.
293
+
2.**Compile the file**: Use the following command in the terminal:
0 commit comments