• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Minecraft server - Fail to bind Port

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I run a minecraft server for my grandkids and recently installed ubuntu server 14.04 to host the games. When I upgraded to Java 8 I had a program (plugin) that wouldn't work so I switched back to Java 7 and it sais failure to bind port everytime I start up the server even after a complete power down. When I swich back to Java 8 it works fine but the plugin won't work. How can I fix it so that it can bind the ports with Java 7?
 
Tyler Lusk
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
would it have anything to do with this?
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tyler Lusk wrote:I run a minecraft server for my grandkids and recently installed ubuntu server 14.04 to host the games. When I upgraded to Java 8 I had a program (plugin) that wouldn't work so I switched back to Java 7 and it sais failure to bind port everytime I start up the server even after a complete power down. When I swich back to Java 8 it works fine but the plugin won't work. How can I fix it so that it can bind the ports with Java 7?



The most likely reason to not be able to bind to a port, is that the port is already in use. From a programming point of view, you can see what ports are already in use via a tool like "netstat". And match it to a stack trace to see what port is your program trying to bind to.

Having said that, you do know that the ranch is a coding website right? For games, such as minecraft, it may be better to go to their forums -- as we know nothing about configuring minecraft...

Henry

 
Tyler Lusk
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It says sockets and internet protocols; the Minecraft help sites are pretty much useless since this is a Java related problem but that doesn't explain why just switching from Java 7 to Java 8 would suddenly free up a port. Its a bare bones server install with only Java installed and there is nothing running on those ports. It has something to do with the Java VM binding those ports but I can't find anything saying that they are bond with Java 7. Right now I have Java 8 loaded so netstat does return that those ports are in use....I guess I need to take this problem somewhere else...Thanks
 
Henry Wong
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you configure the game to use a different port? ... and hopefully, my question doesn't sounds stupid, as we have zero to very little minecraft experience.

Henry
 
Tyler Lusk
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Henry Wong wrote:Can you configure the game to use a different port? ... and hopefully, my question doesn't sounds stupid, as we have zero to very little minecraft experience.

Henry



I'll try that tomorrow...Switching between Java 8 and 7 is real easy via command line, switching the ports requires 2 different edits one on java vm config (the minecraft server) and one on the proxy server...Thanks! I'll make it a total random port that is not configured in my IPTables.
I just ran out of ideas on how to fix this...
Stupid question...but can you run Java 7 and Java 8 at the same time? that would fix everything...Apparently my server wants Java 8 but that one plugin requires Java 7.
Heres the error its giving if this means anything...

[/code]
 
Tyler Lusk
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No matter what port I use it will not bind in Java 7....Mystery
I did a simple command line switch back to Java 8 and did nothing else and all the game ports binded fine....Ugh!
 
Henry Wong
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tyler Lusk wrote:
Stupid question...but can you run Java 7 and Java 8 at the same time? that would fix everything...Apparently my server wants Java 8 but that one plugin requires Java 7.



That depends. Does the plugin run in the same server? If so, then it is all one program, and hence, you can only run it in one JVM.

If however, they are two different programs, then yes. You can run as many different versions of Java as you like. It is likely easier to use a script though. Create a batch file (assuming Windows) that changes the environment variable and start the application.

Henry
 
Tyler Lusk
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Henry Wong wrote:

Tyler Lusk wrote:
Stupid question...but can you run Java 7 and Java 8 at the same time? that would fix everything...Apparently my server wants Java 8 but that one plugin requires Java 7.



That depends. Does the plugin run in the same server? If so, then it is all one program, and hence, you can only run it in one JVM.

If however, they are two different programs, then yes. You can run as many different versions of Java as you like. It is likely easier to use a script though. Create a batch file (assuming Windows) that changes the environment variable and start the application.

Henry



I use a script...here it is... So whats the argument to use Java 7 instead of Java 8? BTW I realize (-XX:MaxPermSize) is deprecated in Java 8..I'll remove it when I give up on Java 7. I can run the whole server as Java 7 but I don't know how and when I switch the environment Via command line to Java 7 I get the port bind failure.. I'll upload some logs I got next post if your interested in seeing...
 
Tyler Lusk
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Seems the bold tags don't work....


Java 8 running all servers running

java 5253 steve 40u IPv6 113558 0t0 TCP localhost:46088->localhost:mysql (ESTABLISHED)
java 5253 steve 44u IPv6 114808 0t0 TCP *:25565 (LISTEN)
java 6238 steve 28u IPv6 139795 0t0 TCP *:25568 (LISTEN)
java 6238 steve 79u IPv6 145592 0t0 TCP localhost:8193 (LISTEN)
java 6238 steve 89u IPv6 163542 0t0 UDP *:25569
java 6238 steve 90u IPv6 352727 0t0 TCP eodsteven.org:42175->192.230.66.3.ip.incapdns.net:https (ESTABLISHED)
java 6238 steve 91u IPv6 163351 0t0 TCP *:19002 (LISTEN)
java 6238 steve 108u IPv6 163551 0t0 TCP localhost:46210->localhost:mysql (ESTABLISHED)
java 6367 steve 28u IPv6 140975 0t0 TCP *:25572 (LISTEN)
java 6367 steve 45u IPv6 146849 0t0 TCP localhost:46180->localhost:mysql (ESTABLISHED)
java 6367 steve 46u IPv6 146850 0t0 TCP localhost:46181->localhost:mysql (ESTABLISHED)
java 6367 steve 55u IPv6 160083 0t0 TCP *:19003 (LISTEN)
java 6367 steve 56u IPv6 160252 0t0 UDP *:25573
java 6487 steve 28u IPv6 150747 0t0 TCP *:25570 (LISTEN)
java 6487 steve 81u IPv6 157847 0t0 TCP *:8192 (LISTEN)
java 6487 steve 90u IPv6 159438 0t0 TCP localhost:46186->localhost:mysql (ESTABLISHED)
java 6487 steve 95u IPv6 161785 0t0 UDP *:25571
java 6487 steve 99u IPv6 160528 0t0 TCP *:19001 (LISTEN)
java 6487 steve 113u IPv6 160674 0t0 TCP localhost:46195->localhost:mysql (ESTABLISHED)

I switch over to Java 7
I shut down the server using port 25570...


steve@eodsteven:~$ lsof -i
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 5253 steve 40u IPv6 113558 0t0 TCP localhost:46088->localhost:mysql (ESTABLISHED)
java 5253 steve 44u IPv6 114808 0t0 TCP *:25565 (LISTEN)
java 6238 steve 28u IPv6 139795 0t0 TCP *:25568 (LISTEN)
java 6238 steve 79u IPv6 145592 0t0 TCP localhost:8193 (LISTEN)
java 6238 steve 89u IPv6 163542 0t0 UDP *:25569
java 6238 steve 91u IPv6 163351 0t0 TCP *:19002 (LISTEN)
java 6238 steve 108u IPv6 163551 0t0 TCP localhost:46210->localhost:mysql (ESTABLISHED)
java 6367 steve 28u IPv6 140975 0t0 TCP *:25572 (LISTEN)
java 6367 steve 45u IPv6 146849 0t0 TCP localhost:46180->localhost:mysql (ESTABLISHED)
java 6367 steve 46u IPv6 146850 0t0 TCP localhost:46181->localhost:mysql (ESTABLISHED)
java 6367 steve 55u IPv6 160083 0t0 TCP *:19003 (LISTEN)
java 6367 steve 56u IPv6 160252 0t0 UDP *:25573

and when I restart the server....

[14:43:00 INFO]: Starting minecraft server version 1.7.10
[14:43:00 INFO]: Loading properties
[14:43:01 INFO]: Default game type: SURVIVAL
[14:43:01 INFO]: This server is running CraftBukkit version git-Spigot-1610 (MC: 1.7.10) (Implementing API version 1.7.10-R0.1-SNAPSHOT)
[14:43:02 INFO]: Debug logging is disabled
[14:43:02 INFO]: Server Ping Player Sample Count: 12
[14:43:02 INFO]: Using 4 threads for Netty based IO
[14:43:02 INFO]: Generating keypair
[14:43:03 INFO]: Starting Minecraft server on *:25570
[14:43:04 WARN]: **** FAILED TO BIND TO PORT!
[14:43:05 INFO]: Stopping server

and finally...

steve@eodsteven:~$ lsof -i:25570
steve@eodsteven:~$


switch back to Java8...

steve@eodsteven:~$ sudo update-java-alternatives -s java-8-oracle
[sudo] password for steve:
steve@eodsteven:~$
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 5253 steve 40u IPv6 113558 0t0 TCP localhost:46088->localhost:mysql (ESTABLISHED)
java 5253 steve 44u IPv6 114808 0t0 TCP *:25565 (LISTEN)
java 6238 steve 28u IPv6 139795 0t0 TCP *:25568 (LISTEN)
java 6238 steve 79u IPv6 145592 0t0 TCP localhost:8193 (LISTEN)
java 6238 steve 89u IPv6 163542 0t0 UDP *:25569
java 6238 steve 91u IPv6 163351 0t0 TCP *:19002 (LISTEN)
java 6238 steve 108u IPv6 163551 0t0 TCP localhost:46210->localhost:mysql (ESTABLISHED)
java 6367 steve 28u IPv6 140975 0t0 TCP *:25572 (LISTEN)
java 6367 steve 45u IPv6 146849 0t0 TCP localhost:46180->localhost:mysql (ESTABLISHED)
java 6367 steve 46u IPv6 146850 0t0 TCP localhost:46181->localhost:mysql (ESTABLISHED)
java 6367 steve 55u IPv6 160083 0t0 TCP *:19003 (LISTEN)
java 6367 steve 56u IPv6 160252 0t0 UDP *:25573

[14:50:29] [Server thread/INFO]: Starting minecraft server version 1.7.10
[14:50:29] [Server thread/INFO]: Loading properties
[14:50:29] [Server thread/INFO]: Default game type: SURVIVAL
[14:50:30] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-1610 (MC: 1.7.10) (Implementing API version 1.7.10-R0.1-SNAPSHOT)
[14:50:30] [Server thread/INFO]: Server Ping Player Sample Count: 12
[14:50:30] [Server thread/INFO]: Using 4 threads for Netty based IO
[14:50:30] [Server thread/INFO]: Debug logging is disabled
[14:50:31] [Server thread/INFO]: Generating keypair
[14:50:31] [Server thread/INFO]: Starting Minecraft server on *:25570
[14:50:32] [Server thread/INFO]: Set PluginClassLoader as parallel capable
[14:50:34] [Server thread/INFO]: [WorldEdit] Loading WorldEdit v5.6.3
[14:50:34] [Server thread/INFO]: [OpenInv] Loading OpenInv v2.2.2
[14:50:34] [Server thread/INFO]: [LimitCreative] Loading LimitCreative v1.7.2
[14:50:34] [Server thread/INFO]: [Essentials] Loading Essentials vDev2.14.95
[14:50:34] [Server thread/INFO]: [Prison] Loading Prison v2.0.4

[b] Server starts up just fine.....see what I mean? Very weird! [\b]

 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tyler Lusk wrote:Seems the bold tags don't work....



They don't work within a code block, so I edited your post to change it to use a quote block instead, in which they work.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For using a specific version/vendor of Java, you could update your script to something like this:



 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One other thing you could try to get it work on Java 7 too is to force it to use IPv4 addresses. You can do that by setting the following in your startup script of Minecraft server:



I don't know how minecraft server is started so can't tell exactly where these params should go, but I think you will be able to figure out on your own (just find the place where the java command is being used to trigger the server and add the -D options that I noted above at relevant position on that line).
 
Tyler Lusk
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jaikiran Pai wrote:One other thing you could try to get it work on Java 7 too is to force it to use IPv4 addresses. You can do that by setting the following in your startup script of Minecraft server:



I don't know how minecraft server is started so can't tell exactly where these params should go, but I think you will be able to figure out on your own (just find the place where the java command is being used to trigger the server and add the -D options that I noted above at relevant position on that line).



Ughhhhh! When I Change it for this one server to use Java 7 its back to the Failed to Bind Port message but thanks! I'm not really sure where to force it to use IPv4 addresses...I'll keep tweaking it.

No, even forcing it to use IPv4 in Java 7 still fails to bind port...

 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe this will help http://www.spigotmc.org/threads/failed-to-bind-to-port.1402/. Apparently you have to disable Netty by adding -Dorg.spigotmc.netty.disabled=true to the startup script (the same place where you tried adding the IPv4 params earlier).
 
Tyler Lusk
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jaikiran Pai wrote:Maybe this will help http://www.spigotmc.org/threads/failed-to-bind-to-port.1402/. Apparently you have to disable Netty by adding -Dorg.spigotmc.netty.disabled=true to the startup script (the same place where you tried adding the IPv4 params earlier).



Still fails to bind port.... I saw that post about Netty when I first started this adventure...

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic