A simple Java console application that fetches real-time weather data using the OpenWeather API.
- Get current weather by city
- Displays temperature, humidity, and condition
- Uses real-world API integration
- Java
- OpenWeather API
- JSON parsing (org.json)
- Compile:
javac -cp .:json-20240303.jar WeatherApp.java
- Run:
java -cp .:json-20240303.jar WeatherApp
Weather in Mumbai
Temperature: 27.9°C
Humidity: 78%
Condition: haze
- Get API key from OpenWeather
- Replace in code:
String apiKey = "YOUR_API_KEY";
Beginner-friendly API integration project in Java.