Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java context from path cannot be modified #148

Open
maldag opened this issue Jul 3, 2024 · 0 comments
Open

java context from path cannot be modified #148

maldag opened this issue Jul 3, 2024 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@maldag
Copy link

maldag commented Jul 3, 2024

Description of the bug

Usage of dart run -vv build_runner build --delete-conflicting-outputs does not work, if provided "java" command on command line does not point to appropriate java version.

Due to native system requirements, the "java" command on console points to an older version of java.
The command in main.dart just uses the call to "java" which will be looked up on PATH.

Steps to reproduce

set Path environment variable to old java version.

Expected behavior

no exception like this:

Codegen Failed. Generator output: Exception in thread "main" java.lang.UnsupportedClassVersionError: org/openapitools/codegen/OpenAPIGenerator has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Logs

flutter doctor -v
[√] Flutter (Channel stable, 3.22.1, on Microsoft Windows [Version 10.0.22621.3737], locale de-DE)
    • Flutter version 3.22.1 on channel stable at C:\Users\username\sdk\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a14f74ff3a (6 weeks ago), 2024-05-22 11:08:21 -0500
    • Engine revision 55eae6864b
    • Dart version 3.4.1
    • DevTools version 2.34.3

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\username\AppData\Local\Android\Sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = C:\Users\username\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Professional 2022 17.9.6)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Professional
    • Visual Studio Professional 2022 version 17.9.34728.123
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2023.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)

[√] VS Code (version 1.90.2)
    • VS Code at C:\Users\username\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.86.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22621.3737]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 126.0.6478.127
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 126.0.2592.81

[√] Network resources
    • All expected network resources are available.

• No issues found!


> java -version
java version "1.8.0_411"
Java(TM) SE Runtime Environment (build 1.8.0_411-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.411-b09, mixed mode)

Screenshots

No response

Platform

Windows

Library version

5.0.2

Flutter version

3.22.1

Flutter channel

stable

Additional context

Only relying on system path is not a robust implemention imho. It should consider using the Android SDK Version which `flutter doctor -v` correctly reports.
@maldag maldag added the bug Something isn't working label Jul 3, 2024
@gibahjoe gibahjoe added the enhancement New feature or request label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants