Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore debug output when getting runtime jar path #197

merged 1 commit into from Nov 16, 2017


Copy link

commented Nov 15, 2017

This fixes #185.

When you use -jvm-debug <port> this line will run something like this:

$ java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9999 -jar /usr/share/sbt/bin/java9-rt-export.jar --rt-ext-dir
Listening for transport dt_socket at address: 9999

As you can see because the -agentlib:... param gets added the first line that will be printed is Listening for transport dt_socket at address: 9999. And of course because of this java9_rt in the next line ends up to contain that Listening... line where we only want it to contain the path to the runtime jar.

My fix is easy by just ignoring that Listening... line by inverting grep.

However maybe it would be nicer if the -agentlib:... argument wouldn't even be passed to that command...? Opening the port (and closing it immediately afterwards again because it's a very short lived process) while an IDE is maybe already listening on it is maybe not the best idea.
I leave that up to you how to solve this however 馃槈


This comment has been minimized.

Copy link
Contributor Author

commented Nov 15, 2017

Oh and the windows launcher .bat probably needs to fix this as well, but I am not sure and didn't test.

Copy link

left a comment

I'm happy to just workaround this problem, and just the bash script.

@dwijnand dwijnand merged commit efdc7c9 into sbt:master Nov 16, 2017

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed

@mkurz mkurz deleted the mkurz:debugFix branch Nov 16, 2017

mkurz referenced this pull request in sbt/sbt Nov 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can鈥檛 perform that action at this time.