eclipse-jdt / eclipse.jdt.debug

Eclipse Public License 2.0
16 stars 45 forks source link

Add "Detect JVMs" Button to Preferences #445

Closed jukzi closed 1 month ago

jukzi commented 1 month ago

I just had a workspace where an appropriate JVM was not installed, image I thought it would be easier to just add a Button for that case that runs the detect job instead of waiting for a restart: image

jukzi commented 1 month ago

@mickaelistria mind to review?

mickaelistria commented 1 month ago

I think we need to address that "Detect" and "Search" seem similar. and IMO this button would best belong to the right column. Maybe "Search..." should be "Find in folder..." and "Detect" should be "Find in usual folders" ?

jukzi commented 1 month ago

"Find in usual folders"

i think a Buttons text should not be that long especially if it is on the right side - that columns are already very wide. I put that new botton in the top because it is related to the checkbox. if we put the button to the right side we should also move that checkbox there? Other ideas anybody?

mickaelistria commented 1 month ago

The button affects the content of the list, that's why I think it should get to the column, like its colleagues. The checkbox doesn't affect immediately the content of the list, so it doesn't have to be so close to the button.

As for the label, it's indeed tricky, a shorter proposal could be "Search folder..." vs "Search system", but it's still long. Maybe aligning those 2 buttons at the bottom of the column with a "Search" text header and buttons being "Folder..." and "System" ?

jukzi commented 1 month ago

BTW: "search..." currently opens a progress dialog, visible when a lot places to search: image

jukzi commented 1 month ago

and it stops on files it can not read :-( : image

!ENTRY org.eclipse.jdt.launching 4 4 2024-05-29 14:39:50.390
!MESSAGE Process returned with error code "1".
Command line arguments: C:\$Recycle.Bin\S-1-5-21-842925246-1214440339-682003330-54083\$RDS8FMX.tmp\plugins\org.eclipse.justj.openjdk.hotspot.jre.minimal.stripped.win32.x86_64_17.0.10.v20240120-1143\jre\bin\javaw.exe -Xmx16m -classpath C:\Users\jkubitz\platform-2023-05-29\ws\.metadata\.plugins\org.eclipse.pde.core\.install_folders\1716962137807\..\..\..\..\..\..\git\eclipse.jdt.debug\org.eclipse.jdt.launching\lib\launchingsupport.jar org.eclipse.jdt.internal.launching.support.LibraryDetector
Output: Standard output:

Standard error:

!STACK 0
java.lang.IllegalStateException: Process returned with error code "1".
Command line arguments: C:\$Recycle.Bin\S-1-5-21-842925246-1214440339-682003330-54083\$RDS8FMX.tmp\plugins\org.eclipse.justj.openjdk.hotspot.jre.minimal.stripped.win32.x86_64_17.0.10.v20240120-1143\jre\bin\javaw.exe -Xmx16m -classpath C:\Users\jkubitz\platform-2023-05-29\ws\.metadata\.plugins\org.eclipse.pde.core\.install_folders\1716962137807\..\..\..\..\..\..\git\eclipse.jdt.debug\org.eclipse.jdt.launching\lib\launchingsupport.jar org.eclipse.jdt.internal.launching.support.LibraryDetector
Output: Standard output:

Standard error:

    at org.eclipse.jdt.internal.launching.StandardVMType.checkProcessResult(StandardVMType.java:891)
    at org.eclipse.jdt.internal.launching.StandardVMType.generateLibraryInfo(StandardVMType.java:705)
    at org.eclipse.jdt.internal.launching.StandardVMType.getLibraryInfo(StandardVMType.java:222)
    at org.eclipse.jdt.internal.launching.StandardVMType.getVMVersion(StandardVMType.java:263)
    at org.eclipse.jdt.internal.launching.Standard11xVMType.canDetectDefaultSystemLibraries(Standard11xVMType.java:100)
    at org.eclipse.jdt.internal.launching.StandardVMType.validateInstallLocation(StandardVMType.java:643)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.search(InstalledJREsBlock.java:1046)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.search(InstalledJREsBlock.java:1069)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.search(InstalledJREsBlock.java:1069)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.search(InstalledJREsBlock.java:1069)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.search(InstalledJREsBlock.java:1069)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.search(InstalledJREsBlock.java:1069)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock$16.run(InstalledJREsBlock.java:889)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:124)
humphreygao commented 1 month ago

And the name of jre it generate is not good, for example jre(1).

jukzi commented 1 month ago

and logs some mysterious errors to stdout:

!SUBENTRY 1 org.eclipse.debug.core 4 125 2024-05-29 15:30:12.479
!MESSAGE Exception occurred executing command line.
!STACK 0
java.io.IOException: Cannot run program "C:\Users\jkubitz\Downloads\spring-boot\spring-boot\spring-boot-project\spring-boot-tools\spring-boot-maven-plugin\src\intTest\projects\run-toolchains\jdkHome\bin\java": CreateProcess error=193, %1 ist keine zulässige Win32-Anwendung
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
    at java.base/java.lang.Runtime.exec(Runtime.java:681)
    at java.base/java.lang.Runtime.exec(Runtime.java:577)
    at org.eclipse.debug.core.DebugPlugin.exec(DebugPlugin.java:1007)
    at org.eclipse.debug.core.DebugPlugin.exec(DebugPlugin.java:958)
    at org.eclipse.jdt.internal.launching.StandardVMType.generateLibraryInfo(StandardVMType.java:689)
    at org.eclipse.jdt.internal.launching.StandardVMType.getLibraryInfo(StandardVMType.java:225)
    at org.eclipse.jdt.internal.launching.StandardVMType.getVMVersion(StandardVMType.java:263)
    at org.eclipse.jdt.internal.launching.Standard11xVMType.canDetectDefaultSystemLibraries(Standard11xVMType.java:100)
    at org.eclipse.jdt.internal.launching.StandardVMType.validateInstallLocation(StandardVMType.java:643)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.search(InstalledJREsBlock.java:1046)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.search(InstalledJREsBlock.java:1069)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.search(InstalledJREsBlock.java:1069)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.search(InstalledJREsBlock.java:1069)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.search(InstalledJREsBlock.java:1069)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.search(InstalledJREsBlock.java:1069)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.search(InstalledJREsBlock.java:1069)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.search(InstalledJREsBlock.java:1069)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.search(InstalledJREsBlock.java:1069)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.search(InstalledJREsBlock.java:1069)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.search(InstalledJREsBlock.java:1069)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.search(InstalledJREsBlock.java:1069)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.search(InstalledJREsBlock.java:1069)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.search(InstalledJREsBlock.java:1069)
    at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock$16.run(InstalledJREsBlock.java:889)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:124)
Caused by: java.io.IOException: CreateProcess error=193, %1 ist keine zulässige Win32-Anwendung
    at java.base/java.lang.ProcessImpl.create(Native Method)
    at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:500)
    at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:159)
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
    ... 26 more
mickaelistria commented 1 month ago

BTW: "search..." currently opens a progress dialog

On my Linux installation, Seach opens a DirectoryDialog to set from where to start the search.

jukzi commented 1 month ago

How about this: image

mickaelistria commented 1 month ago

I think this later proposal is good.

SarikaSinha commented 1 month ago

On Mac, historically the Directory Dialog was not shown for "Search" as it was supposed to search only in the specified default directory.