Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If you were running Java 8 and started your process that relied on a given port then tried to restart that process using Java 7 it may simply be you forgot to stop the original process (or it didn't stop when you thought it did) so the port is still in use.
Run "lsof -i :<port>" for the port you're talking about to see if it is already in use. If lsof sees it then it will give you the PID of the process that is using it.
Distribution: Ubuntu 14.04, Windows 8, Windows Server 2012. Ubuntu Server 14.04
Posts: 196
Original Poster
Rep:
Quote:
Originally Posted by MensaWater
What exactly do you mean by "switching back"?
If you were running Java 8 and started your process that relied on a given port then tried to restart that process using Java 7 it may simply be you forgot to stop the original process (or it didn't stop when you thought it did) so the port is still in use.
Run "lsof -i :<port>" for the port you're talking about to see if it is already in use. If lsof sees it then it will give you the PID of the process that is using it.
I wish is was that easy...when I do a netstat the ports I'm trying to bind are not used but nonetheless they will not bind...Thx. BTW switching back is made via command line with Java 8 but I did do a complete shutdown and reboot...I had the same idea that the port was in use.
Last edited by EODSteven; 08-22-2014 at 08:44 AM.
Reason: Added Information
Distribution: Ubuntu 14.04, Windows 8, Windows Server 2012. Ubuntu Server 14.04
Posts: 196
Original Poster
Rep:
Quote:
Originally Posted by EODSteven
I wish is was that easy...when I do a netstat the ports I'm trying to bind are not used but nonetheless they will not bind...Thx.
Could it be some kind of dependency with ssh and Java 7...I've tried all the usual things and its a bare bones Ubuntu 14.04 and Java server install ...I finally broke down and installed Gnome shell so I could navigate easiar but I didn't want to. Does IPTables have anything to do with Ports?...and yes, I did all the IPTables -F -X -N for both IP4 and IP6.
Last edited by EODSteven; 08-22-2014 at 08:46 AM.
Reason: Added Information
Certainly iptables deals with ports. In fact I'd say that mostly is its purpose though of course it can do NATting and other things.
However, iptables if tied to ports should either allow or forbid them regardless of which application is attempting to use them. You should be able to determine if iptables is your issue simply by stopping it and testing. If it works when iptables is stopped then it means you need to add a rule allowing the port.
I'd still suggest looking with lsof -i since you can specify the port easily instead of having to look for it. Linux netstat has some capabilities along those lines but IMHO it is still inferior to what you can glean with lsof.
Distribution: Ubuntu 14.04, Windows 8, Windows Server 2012. Ubuntu Server 14.04
Posts: 196
Original Poster
Rep:
Quote:
Originally Posted by MensaWater
Certainly iptables deals with ports. In fact I'd say that mostly is its purpose though of course it can do NATting and other things.
However, iptables if tied to ports should either allow or forbid them regardless of which application is attempting to use them. You should be able to determine if iptables is your issue simply by stopping it and testing. If it works when iptables is stopped then it means you need to add a rule allowing the port.
I'd still suggest looking with lsof -i since you can specify the port easily instead of having to look for it. Linux netstat has some capabilities along those lines but IMHO it is still inferior to what you can glean with lsof.
Ok I just switched to Java 7 and did losf -i...hold on switch computers for copy and paste...
Distribution: Ubuntu 14.04, Windows 8, Windows Server 2012. Ubuntu Server 14.04
Posts: 196
Original Poster
Rep:
Well as much as I like to brag, I don't like saying I have stumped the panel....I have 4 diffrent forums trying to brain storm with me to figure this out. I have even tried setting it up to run as a java 7 server inside a java 8 environment and same thing...failed to bind port. I also forced it to use IPv4 instead of 6, no change, and I have disabled Netty...nothing seems to work. It woud be a lot easiar for the developer to program his plugin to work with java 8 but thats not gonna happen....I wish I new how to code!
Last edited by EODSteven; 08-23-2014 at 12:41 PM.
Reason: Added Information
Most Java applications expect a certain version of Java and won't run on anything else. (Sometimes they want a very old version which is insecure). It may simply be Minecraft only runs on the one version. The failed to bind port may be a red herring for port 25570 - it may be trying to do something else (e.g. open another port as well) that it isn't telling you about but that is already in use. I notice on your second lsof -i output although 25570 has gone away other ports in the same range are still active.
To verify you can actually LISTEN on port 25570 after stopping the Java application run:
nc -l 25570
That should start a local LISTENer on the specified port. If it works you can stop it and you'll know the port itself isn't your issue.
You can run strace on your application and see what it is actually doing at the point it gives the failed to bind message.
Distribution: Ubuntu 14.04, Windows 8, Windows Server 2012. Ubuntu Server 14.04
Posts: 196
Original Poster
Rep:
Quote:
Originally Posted by MensaWater
Most Java applications expect a certain version of Java and won't run on anything else. (Sometimes they want a very old version which is insecure). It may simply be Minecraft only runs on the one version. The failed to bind port may be a red herring for port 25570 - it may be trying to do something else (e.g. open another port as well) that it isn't telling you about but that is already in use. I notice on your second lsof -i output although 25570 has gone away other ports in the same range are still active.
To verify you can actually LISTEN on port 25570 after stopping the Java application run:
nc -l 25570
That should start a local LISTENer on the specified port. If it works you can stop it and you'll know the port itself isn't your issue.
You can run strace on your application and see what it is actually doing at the point it gives the failed to bind message.
I have tried several other different Ports but thank you very much for those useful tools...I'm gonna give up on that one particular plugin and find one that works with Java 8. I hate to think of going backwards due to one particular lazy coder...Thank you. I always wondered how to do a Stack Trace and I assume strace is just that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.