Search code examples
spring-bootspring-tool-suite

Prevent STS4 from launching browser when run?


I have a Spring Boot application with only api rest calls.

Everytime I press the "run on server" button a browser is launched trying to access the current file. Of course it always prompt an error:

Error Prompt

Sorry for the image being in Spanish. It basically says that cannot download the resource.

My question is how to avoid this browser from launching everytime I run my application.

Thanks.


Solution

  • I found the solution to my problem. Here is what I did:

    Go to Window > Preferences > General > Web Browser > New...

    Add a new browser with:

    • name = NO BROWSER (or whatever you want)
    • location = C:\Windows\System32\cmd.exe
    • parameters = /c

    Press OK.

    Finally select Use external web browser, select the browser we just added and press Apply and Close.

    The browser configuration should look like this.

    Web Browser configuration

    Instead of using the cmd you could use a batch/shell script that does nothing (without the /c parameter which is only needed for the cmd to do nothing).

    NOTE: This solution is applied to the IDE not to the project.