Skip to content

Commit d0767d8

Browse files
authored
Update instructions_to_run_generated_code.md
1 parent ca7e29a commit d0767d8

File tree

1 file changed

+87
-46
lines changed

1 file changed

+87
-46
lines changed

doc/user_guide/instructions_to_run_generated_code.md

Lines changed: 87 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,24 @@ TODO
8181

8282
Here are the detailed instructions for running the generated API Dash code in **Java (using `AsyncHttpClient`)** for macOS, Windows, and Linux:
8383

84-
---
84+
### 1. Install Java
8585

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.
8887

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:
9091

91-
After installation, verify it by running:
9292
```bash
9393
java -version
9494
```
9595

96-
---
96+
### 2. Add the `AsyncHttpClient` Library
9797

98-
### **2. Add the `AsyncHttpClient` Library**
9998
To use the `AsyncHttpClient` library in Java, you need to add it as a dependency in your project.
10099

101-
#### Using **Maven**:
100+
#### Using Maven
101+
102102
1. Add the following dependency to your `pom.xml` file:
103103
```xml
104104
<dependencies>
@@ -109,12 +109,13 @@ To use the `AsyncHttpClient` library in Java, you need to add it as a dependency
109109
</dependency>
110110
</dependencies>
111111
```
112-
3. Save the file and run:
112+
2. Save the file and run:
113113
```bash
114114
mvn install
115115
```
116116

117-
#### Using **Gradle**:
117+
#### Using Gradle
118+
118119
1. Add the following line to the `dependencies` section in your `build.gradle` file:
119120
```gradle
120121
implementation 'org.asynchttpclient:async-http-client:3.0.1'
@@ -124,9 +125,8 @@ To use the `AsyncHttpClient` library in Java, you need to add it as a dependency
124125
gradle build
125126
```
126127

127-
---
128+
### 3. Run the Generated Code
128129

129-
### **3. Run the Generated Code**
130130
After setting up Java and adding the `AsyncHttpClient` library, follow these steps to execute the generated code:
131131

132132
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
139139
java ApiTest
140140
```
141141

142-
---
143-
144142
## Java (HttpClient)
145143

146144
Here are the detailed instructions for running the generated API Dash code in **Java (using `HttpClient`)** for macOS, Windows, and Linux:
147145

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.
149151

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:
152153

153-
---
154+
```bash
155+
java -version
156+
```
157+
158+
### 2. `HttpClient` Setup
154159

155-
### **2. `HttpClient` Setup**
156160
The `HttpClient` library is included as part of the **Java SE 11** (or later) standard library.
157161
- Ensure you have **Java 11** or a later version installed to use `HttpClient` without needing additional dependencies.
158-
159162

160163
To confirm your Java version, run:
161164
```bash
162165
java -version
163166
```
164-
---
165167

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
168169

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+
```
170181

171182
## Java (okhttp3)
172183

173184
Here are the detailed instructions for running the generated API Dash code in **Java (using `okhttp3`)** for macOS, Windows, and Linux:
174185

175-
---
186+
### 1. Install Java
176187

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.
179189

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
181199

182-
### **2. Add the `okhttp3` Library**
183200
To use `okhttp3` in Java, you need to add it as a dependency in your project.
184201

185-
#### Using **Maven**:
202+
#### Using Maven
203+
186204
1. Add the following dependency to your `pom.xml` file:
187205
```xml
188206
<dependency>
@@ -196,7 +214,8 @@ To use `okhttp3` in Java, you need to add it as a dependency in your project.
196214
mvn install
197215
```
198216

199-
#### Using **Gradle**:
217+
#### Using Gradle
218+
200219
1. Add the following line to the `dependencies` section in your `build.gradle` file:
201220
```gradle
202221
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
@@ -206,28 +225,42 @@ To use `okhttp3` in Java, you need to add it as a dependency in your project.
206225
gradle build
207226
```
208227

209-
---
228+
### 3. Run the Generated Code
210229

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:
213231

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+
```
215241

216242
## Java (Unirest)
217243

218244
Here are the detailed instructions for running the generated API Dash code in **Java (using `Unirest`)** for macOS, Windows, and Linux:
219245

220-
---
246+
### 1. Install Java
247+
248+
To run Java code, you need to have Java Development Kit (JDK) installed on your system.
221249

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.
224251

225-
---
252+
After installation, verify it by running:
253+
254+
```bash
255+
java -version
256+
```
257+
258+
### 2. Add the `Unirest` Library
226259

227-
### **2. Add the `Unirest` Library**
228260
To use `Unirest` in Java, you need to add it as a dependency in your project.
229261

230-
#### Using **Maven**:
262+
#### Using Maven
263+
231264
1. Add the following dependency to your `pom.xml` file:
232265
```xml
233266
<dependency>
@@ -241,7 +274,8 @@ To use `Unirest` in Java, you need to add it as a dependency in your project.
241274
mvn install
242275
```
243276

244-
#### Using **Gradle**:
277+
#### Using Gradle
278+
245279
1. Add the following line to the `dependencies` section in your `build.gradle` file:
246280
```gradle
247281
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.
251285
gradle build
252286
```
253287

254-
---
288+
### 3. Run the Generated Code
255289

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:
258291

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:
294+
```bash
295+
javac ApiTest.java
296+
```
297+
3. **Run the compiled program**:
298+
```bash
299+
java ApiTest
300+
```
260301

261302
## Julia (HTTP)
262303

0 commit comments

Comments
 (0)