https://github.com/alexpanov/freeportfinder
Find a free local port (mainly) for testing purposes
https://github.com/alexpanov/freeportfinder
java micro-library networking open-ports
Last synced: 3 months ago
JSON representation
Find a free local port (mainly) for testing purposes
- Host: GitHub
- URL: https://github.com/alexpanov/freeportfinder
- Owner: alexpanov
- License: unlicense
- Created: 2015-05-05T08:35:52.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2023-11-18T02:00:57.000Z (over 2 years ago)
- Last Synced: 2025-07-06T16:02:22.733Z (11 months ago)
- Topics: java, micro-library, networking, open-ports
- Language: Java
- Homepage:
- Size: 18.6 KB
- Stars: 15
- Watchers: 2
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# freeportfinder
[](https://travis-ci.org/alexpanov/freeportfinder)
[](https://maven-badges.herokuapp.com/maven-central/me.alexpanov/free-port-finder/)
A micro Java library that does one thing and one thing only: finds a free local port (mainly) for testing purposes.
Finding a free local port is as easy as:
```
int port = FreePortFinder.findFreeLocalPort();
```
Which can then be used to set up local Jetty without hitting
```
java.net.BindException: Address already in use
```
## Contributors
[Shlomi Alfasi](https://github.com/shlomialfasi)