File tree Expand file tree Collapse file tree
Framework/install_handler/android Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,14 +97,12 @@ def update_java_path():
9797 os .environ ['JAVA_HOME' ] = str (jdk_home )
9898 print (f"JAVA_HOME set for current process: { jdk_home } " )
9999
100- # Add Java bin to PATH for the current process (prepend so it takes precedence)
100+ # Add Java bin to PATH for the current process (always prepend so it takes precedence)
101101 java_bin_path = str (java_path .parent )
102102 current_path = os .environ .get ('PATH' , '' )
103- if java_bin_path not in current_path :
104- os .environ ['PATH' ] = f"{ java_bin_path } { os .pathsep } { current_path } "
105- print (f"Java added to current process PATH: { java_bin_path } " )
106- else :
107- print (f"Java already in PATH: { java_bin_path } " )
103+ # Always prepend to ensure isolated Java takes precedence (even if path already exists)
104+ os .environ ['PATH' ] = f"{ java_bin_path } { os .pathsep } { current_path } "
105+ print (f"Java prepended to current process PATH: { java_bin_path } " )
108106
109107
110108async def _get_jdk_download_url ():
You can’t perform that action at this time.
0 commit comments