@@ -198,35 +198,36 @@ private async void FindJava()
198198 List < string > javas = stdout . Split ( Environment . NewLine . ToCharArray ( ) ) . ToList ( ) ;
199199 foreach ( var java in javas )
200200 {
201+ string javaq = $ "\" { java } \" ";
201202 Process jcheck = new Process ( ) ;
202- jcheck . StartInfo . FileName = java ;
203+ jcheck . StartInfo . FileName = javaq ;
203204 jcheck . StartInfo . Arguments = "-fullversion" ;
204205 jcheck . StartInfo . UseShellExecute = false ;
205206 jcheck . StartInfo . RedirectStandardError = true ;
206207 jcheck . Start ( ) ;
207208 await jcheck . WaitForExitAsync ( ) ;
208209 stdout = await process . StandardError . ReadToEndAsync ( ) ;
209- File . WriteAllText ( Path . Join ( MainWindow . ConfigFolder , new Guid ( ) . ToString ( ) + "stdout-java.txt" ) , java + " returned: " + stdout ) ;
210+ File . WriteAllText ( Path . Join ( MainWindow . ConfigFolder , new Guid ( ) . ToString ( ) + "stdout-java.txt" ) , javaq + " returned: " + stdout ) ;
210211 int javaver = int . Parse ( stdout . Split ( '\" ' ) [ 1 ] . Split ( '.' ) [ 0 ] ) ;
211212 jcheck . Dispose ( ) ;
212213 if ( javaver >= 11 )
213214 {
214215 ParentPanel . IsEnabled = true ;
215- _config . JavaPath = java ;
216+ _config . JavaPath = javaq ;
216217 break ;
217218 }
218- var box = MessageBoxManager . GetMessageBoxCustom ( new MessageBoxCustomParams
219- {
220- ContentMessage = Lang . Resources . JavaFoundWrongVerWin + $ " ({ MainWindow . ConfigFile } ), (Java-Execs: { string . Join ( "," , javas ) } )",
221- ButtonDefinitions = new List < ButtonDefinition >
222- {
223- new ( ) { Name = "Ok" } ,
224- } ,
225- Icon = MsBox . Avalonia . Enums . Icon . Error
226- } ) ;
227- await box . ShowAsPopupAsync ( this ) ;
228- ParentPanel . IsEnabled = false ;
229219 }
220+ var box = MessageBoxManager . GetMessageBoxCustom ( new MessageBoxCustomParams
221+ {
222+ ContentMessage = Lang . Resources . JavaFoundWrongVerWin + $ " ({ MainWindow . ConfigFile } ), (Java-Execs: { string . Join ( "," , javas ) } )",
223+ ButtonDefinitions = new List < ButtonDefinition >
224+ {
225+ new ( ) { Name = "Ok" } ,
226+ } ,
227+ Icon = MsBox . Avalonia . Enums . Icon . Error
228+ } ) ;
229+ await box . ShowAsPopupAsync ( this ) ;
230+ ParentPanel . IsEnabled = false ;
230231 }
231232 catch ( Exception ex )
232233 {
0 commit comments