MOTOSHARE 🚗🏍️
Turning Idle Vehicles into Shared Rides & Earnings
From Idle to Income. From Parked to Purpose.
Earn by Sharing, Ride by Renting.
Where Owners Earn, Riders Move.
Owners Earn. Riders Move. Motoshare Connects.
With Motoshare, every parked vehicle finds a purpose.
Owners earn. Renters ride.
🚀 Everyone wins.
Error
flutter doctor –android-licenses jab hum ye command chala rahe hai to ERROR: JAVA_HOME is set to an invalid directory: c:\Users\dharm\AppData\Roaming\Code\User\globalStorage\pleiades.java-extension-pack-jdk\17 Please set the JAVA_HOME variable in your environment to match the location of your Java installation.
This error is given by setting the JAVA_HOME environment variable. The JAVA_HOME variable stores the path to the Java installation directory in your system. Flutter requires the Java Development Kit (JDK) for Android development.
You have given here that the directory path is invalid:
c:\Users\dharm\AppData\Roaming\Code\User\globalStorage\pleiades.java-extension-pack-jdk
Code language: CSS (css)
Solution
To fix this error, you need to set the path to the correct Java installation directory. Follow the steps given below:
- First, find the path to the correct Java JDK installation directory. This can usually be something like C:\Program Files\Java\jdk1.x.x_x or C:\Program Files\Android\Android Studio\jre. If your Java JDK path is different, note that.
- To set the JAVA_HOME environment variable for Windows, follow these steps:
- Open Computer Properties (by pressing the Windows key + Pause/Break key)
- Click on “Advanced system settings” in the left sidebar.
- Click the “Environment Variables” button on the “Advanced” tab.
- Click the “New” button in the System Variables section.
- variable name: JAVA_HOME
- Variable Value: Path to the Java JDK installation directory (eg, C:\Program Files\Java\jdk1.x.x_x)
- After saving, restart the terminal or command prompt and run the flutter doctor –android-license command. Now this command should run correctly.
This way, you should not encounter any errors accepting Flutter Android licenses after setting the java_home environment variable.