- Get Started
-
Guides
- Cloudinary Image
- Cloudinary Video
- Upload
- Asset management
- Account management
- Retail and e-commerce
- User-generated content
- Accessible media
- AI in action
- Native mobile
-
Add-ons
- Advanced Facial Attributes Detection
- Amazon Rekognition AI Moderation
- Amazon Rekognition Video Moderation
- Amazon Rekognition Auto Tagging
- Amazon Rekognition Celebrity Detection
- Aspose Document Conversion
- Cloudinary AI Background Removal
- Cloudinary AI Content Analysis
- Cloudinary AI Vision
- Cloudinary Duplicate Image Detection
- Google AI Video Moderation
- Google AI Video Transcription
- Google Auto Tagging
- Google Automatic Video Tagging
- Google Translation
- Imagga Auto Tagging
- Imagga Crop and Scale
- Perception Point Malware Detection
- Microsoft Azure Video Indexer
- OCR Text Detection and Extraction
- Pixelz - Remove the Background
- URL2PNG Website Screenshots
- VIESUS™ Automatic Image Enhancement
- WebPurify Image Moderation
- References
- SDKs
- Release Notes
- Get Started
- Image & Video APIs overview
- Developer kickstart
- SDK quick starts
- Try it!
- AI agent tools and MCP servers (Beta)
- VS Code Extension (Beta)
- Video tutorial library
- Programmatic asset management
- Programmatic upload
- Upload programmatically
- Upload with Fetch API
- Create upload presets (Node.js)
- Create upload presets (Console UI)
- Auto upload
- Moderate images with AI
- Use AI to generate image captions
- Upload images in Flutter
- Upload images in Node.js
- Auto-tag images in Node.js
- Upload multiple files in Node.js
- Upload videos in Node.js
- Upload images in Python
- Auto-tag images in Python
- Upload videos in Python
- Upload images in PHP
- Upload images in Go
- Upload assets in a React app
- Upload assets in a Vue.js app
- Drag-and-drop uploads in React
- Upload assets in a Next.js app
- Upload assets with Server Actions
- Upload assets in Svelte
- Upload assets in a SvelteKit app
- Upload assets in a Remix app
- Upload images in Astro
- Upload images in Hono
- Use webhooks to remove backgrounds
- Upload images in Laravel
- Interaction with Cloudinary APIs
- Cloudinary SDKs
- Find your credentials
- Configure the JavaScript SDK
- Configure the React SDK
- Configure the Angular SDK
- Configure the Flutter SDK
- Configure Svelte Cloudinary
- Configure the Javascript SDK in Svelte
- Getting started with Cloudinary in Node.js
- Configure the Node.js SDK
- Configure the Python SDK
- Configure the PHP SDK
- Install and configure Laravel SDK
- Configure the Go SDK
- Configure the Vue.js SDK
- Configure the Next.js SDK
- List images in Next.js
- Lazy load images with Next.js
- Image fallbacks in JavaScript
- Captioning on upload with Node.js
- Delete assets with Node.js
- Manage images in a Django app
- Image gallery with Astro
- Cloudinary CLI
- Widgets and tools
- Programmatic upload
- Optimization and delivery
- Transformations
- Get started with transformations
- Advanced transformation features
- Text overlay transformations
- Add watermarks in JavaScript
- Complex transformations
- Named transformations
- Named transformations using TX Builder
- Advanced image components
- Trim videos in Node.js
- Splice videos in Node.js
- Zoompan effect
- Video transformations
- Crop and resize images in React
- Crop and resize videos in React
- Crop and resize images in Python
- Remove backgrounds and add drop shadows
- AI generative fill in Next.js
- Color accessibility in JavaScript
- Transformations for social media
- Dev Hints on YouTube
- Dev Hints en Español
- Cloudinary Café Training Sessions
- Programmatic asset management
- Additional onboarding resources
- Guides
- Cloudinary Image
- Product overview
- Image transformations
- Image transformations overview
- Resizing and cropping
- Placing layers on images
- Effects and enhancements
- Background removal
- Generative AI transformations
- Face-detection based transformations
- Custom focus areas
- Transformation refiners
- Animated images
- Transformations on 3D models
- Conditional transformations
- User-defined variables and arithmetic transformations
- Custom functions
- Image optimization and delivery
- Programmatic image creation
- Product Gallery widget
- Media Editor widget
- Image add-ons
- Cloudinary Image troubleshooting and tips
- Troubleshooting image transformation errors
- 404 errors for transformed assets
- Add a solid color overlay
- Images delivered without gzip compression
- Long time to first byte (TTFB) on WebPageTest.org
- Update a named transformation
- Cloudinary vs Imagga cropping
- Placeholder images (LQIP)
- Common error codes in X-Cld-Error header
- How to detect corrupted images
- Force specific image when sharing links on Facebook
- Offset face-detection gravity
- Cloudinary Video
- Product overview
- Cloudinary Video Player
- Video Player features
- Installation and setup
- How to embed the Video Player
- Video Player Studio
- Video Player customization
- Playlists and recommendations
- HLS and MPEG-DASH
- Video Player accessibility
- Video Player advanced features
- Video Player API reference
- Player profiles API reference
- Video config API reference
- Adaptive bitrate streaming
- Video transformations
- Video and audio optimization
- Video transcription
- Video analytics
- Live streaming
- Video add-ons
- Video best practices
- Social media videos
- Troubleshooting and tips
- Upload
- Asset management
- Account management
- Retail and e-commerce
- User-generated content
- Accessible media
- AI in action
- Native mobile
- Add-ons
- Advanced Facial Attributes Detection
- Amazon Rekognition AI Moderation
- Amazon Rekognition Video Moderation
- Amazon Rekognition Auto Tagging
- Amazon Rekognition Celebrity Detection
- Aspose Document Conversion
- Cloudinary AI Background Removal
- Cloudinary AI Content Analysis
- Cloudinary AI Vision
- Cloudinary Duplicate Image Detection
- Google AI Video Moderation
- Google AI Video Transcription
- Google Auto Tagging
- Google Automatic Video Tagging
- Google Translation
- Imagga Auto Tagging
- Imagga Crop and Scale
- Perception Point Malware Detection
- Microsoft Azure Video Indexer
- OCR Text Detection and Extraction
- Pixelz - Remove the Background
- URL2PNG Website Screenshots
- VIESUS™ Automatic Image Enhancement
- WebPurify Image Moderation
- Cloudinary Image
- References
- SDKs
- Release Notes
Java quick start
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
Notes- This quick start is designed for quick onboarding. It doesn't necessarily employ coding best practices and the code you create here isn't intended for production.
- If you aren't familiar with Cloudinary, you may want to first take a look at the Developer Kickstart for a hands-on, step-by-step introduction to Cloudinary features.
You may also find our Glossary helpful to understand Cloudinary-specific terminology.
1. Set up and configure the library
Using a clean Java project using Maven, add the cloudinary and dotenv dependencies to the list of dependencies in pom.xml:
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):
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 image
Copy and paste the following code into a try block within your Main class:
3. Get details of the image
4. Transform the uploaded image
5. Run your code
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 code
You can find the full code example for this on GitHub.
Next steps
- Learn more about the Java SDK by visiting the other pages in this SDK guide.
- Get comprehensive details about Cloudinary features and capabilities:
- Upload guide: Provides details and examples of the upload options.
- Image transformations guide: Provides details and examples of the transformations you can apply to image assets.
- Video transformations guide: Provides details and examples of the transformations you can apply to video assets.
- Transformation URL API Reference: Provides details and examples of all available transformation parameters.
- Admin API guide: Provides details and examples of the methods available for managing and organizing your media assets.
✔️ Feedback sent!
Error
Unfortunately there's been an error sending your feedback.
