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
AspectJ does not yet support Java 21 [[1]](https://github.com/eclipse-aspectj/aspectj/issues/260), [[2]](https://github.com/eclipse-aspectj/aspectj/blob/master/docs/dist/doc/JavaVersionCompatibility.md).
17
-
If you need to use aspects - either Powertools features leveraging aspects or other libraries - you should use the JDK 17 compiler and target either the Java 17 or Java 21
18
-
Lambda runtimes.
19
-
20
12
### Installation
21
13
22
14
Powertools for AWS Lambda (Java) is available in Maven Central. You can use your favourite dependency management tool to install it
@@ -196,6 +188,39 @@ Next, configure the aspectj-maven-plugin to compile-time weave (CTW) the aws-lam
196
188
```
197
189
</details>
198
190
191
+
#### Java Compatibility
192
+
Powertools for AWS Lambda (Java) supports all Java version from 8 up to 21 as well as the
For the following modules, Powertools for AWS Lambda (Java) leverages the **aspectj** library to provide annotations:
196
+
- Logging
197
+
- Metrics
198
+
- Tracing
199
+
- Parameters
200
+
- Idempotency
201
+
- Validation
202
+
- Large messages
203
+
204
+
It's important to notice the [dependency matrix](https://github.com/eclipse-aspectj/aspectj/blob/master/docs/dist/doc/JavaVersionCompatibility.md) between this library and the JDK:
205
+
206
+
| JDK version | aspectj version |
207
+
|-------------|-----------------|
208
+
|`1.8`|`1.9.7`|
209
+
|`11-17`|`1.9.20.1`|
210
+
|`21`|`1.9.21`|
211
+
212
+
_Note: 1.9.21 is not yet available and Java 21 not yet officialy supported by aspectj, but you can already use the `1.9.21.M1`_
213
+
214
+
You may need to add the good version of `aspectjrt` to your dependencies based on the jdk used for building your function:
215
+
216
+
```xml
217
+
<dependency>
218
+
<groupId>org.aspectj</groupId>
219
+
<artifactId>aspectjrt</artifactId>
220
+
<version>1.9.??</version>
221
+
</dependency>
222
+
```
223
+
199
224
## Examples
200
225
201
226
See the latest release of the **[examples](https://github.com/aws-powertools/powertools-lambda-java/tree/v1.18.0/examples)** for example projects showcasing usage of different utilities.
0 commit comments