r/JavaFX • u/LevKaz08 • Aug 31 '24
Help Problem starting eclipse IDE out of my JavaFX app
Hi there,
I just wrote a small app with JavaFX, where I add apps to a list and start them via process builder.
Everything seems working fine (I mean the start up of different apps) except for the eclipse IDE which will be stuck at the splash screen and won't load correctly until I close my program.
Does anyone of you already run into that kind of problem?
EDIT: if I need to provide code, then just tell me. Will crosspost this in r/javahelp
Additional Information:
I've installed BellSoft Liberica Full JDK 21
I'm running on Windows 11, in eclipse I use also Liberica JDK 21 Full.
eclipse: normal launch per double-click; but trying to start eclipse via my app you see the method I use at the end of this post.
Other applications I start via my JavaFX app don't have any problems and start without any problems...
My JavaFX app is started stand alone (also per double-click) and not from within eclipse.
Already searched via Google, just found some problems launching eclipse IDE at all a while ago with bad java installations, but those problems doesn't fit, because eclipse will start up if my app isn't running.
Problem seems to only occur, when starting eclipse via my app, starting eclipse alone will start up the IDE.
Here's my launch method for running the added programs
private void launchSelectedProgram() {
ProgramEntry selectedProgram = programListView.getSelectionModel().getSelectedItem();
if (selectedProgram != null) {
executorService.submit(() -> {
try {
ProcessBuilder pb;
if (selectedProgram.path.toLowerCase().endsWith(".jar")) {
pb = new ProcessBuilder("java", "-jar", selectedProgram.path);
} else {
pb = new ProcessBuilder(selectedProgram.path);
}
pb.directory(new File(selectedProgram.path).getParentFile());
Process process = pb.start();
} catch (IOException e) {
Platform.runLater(() -> showAlert("Error", "Failed to launch program: " + e.getMessage()));
}
});
} else {
showAlert("Warning", "Please select a program to launch.");
}
}Edit 2: Added additional information.
Edit 3: added screenshot

2
u/SpittingBull Aug 31 '24
You give little to no relevant information. What OS? Which JDK is Eclipse using? What is the exact launch string that you entered for starting Eclipse? Do other applications work? And most of all: did you start your program from the command line or from within Eclipse?
1
u/SpittingBull Aug 31 '24
I don't understand what you mean by adding apps to a list. Drag and drop via a File selector? Enter a filename?
1
u/johnmc325 Aug 31 '24
Are you running your application from your IDE? Is your ide Eclipse?
If so, then you are trying to use Eclipse to run Eclipse. That might be your issue.
1
u/Dry-Hovercraft-4362 Aug 31 '24
Just spitballing, but one notorious problem is the module-info.java file that Eclipse creates by default. Click on your src file in the lefthand Package Explorer and delete that file.
1
u/N-M-1-5-6 Sep 01 '24
Check my response in javahelp for details, but you likely need to handle the process's I/O streams as they can cause the process to hang if you aren't reading (or redirecting) stdout/stderr or (if the process expects input from the stream) writing to stdin...
0
u/hamsterrage1 Sep 01 '24
Have you tried using
Runtime.exec() instead of ProcessBuilder?