Last updated: Apr-23-2025
This quick start lets you get an end-to-end implementation up and running using the Java SDK in 5 minutes or less.
Prerequisites 1. Set up and configure the libraryUsing a clean Java project using Maven, add the cloudinary and dotenv dependencies to the list of dependencies in pom.xml
:
We recommend updating the version number to use the
latest versionof the Java SDK.
Then, in your project, create a file called .env
and add the following line with your Cloudinary environment variable (replace cloudinary://<API_KEY>:<API_SECRET>@<CLOUD_NAME>
below with your own environment variable value):
When writing your own applications, follow your organization's policy on storing secrets and don't expose your API secret.
In your code, include the following Cloudinary
libraries as well as the dotenv
library in your project. Copy and paste the following code into your Main.java
file:
You can now load your Cloudinary credentials from your .env file as shown below. Copy and paste the following code into your Main class:
2. Upload an imageCopy and paste the following code into a try
block within your Main class:
Run your code by clicking the Run button on the main
class.
You can use the returned image tag to display the image on your website. For now, copy and paste the URL to see the transformed image in the browser:
View the completed codeYou can find the full code example for this on GitHub.
Next stepsâï¸ Feedback sent!
âï¸Â  ErrorUnfortunately there's been an error sending your feedback.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4