Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How I'm support to run a server with a client in java?  RSS feed

 
jin Otanashi
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As the question is asking above
I have this program for server:

and this one for client:


by the way I'm using eclipse.
when I run the server is fine but when run the client, its crash any idea why is not working ??

crash.JPG
[Thumbnail for crash.JPG]
server-client
 
Knute Snortum
Sheriff
Posts: 4073
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only array retrieval is on line 3 of your posted client code, so I suspect that you're not passing an argument in.
 
Knute Snortum
Sheriff
Posts: 4073
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my version of Eclipse, you can add a program argument by creating a Run Configuration. Run -> Run Configurations..., select or create a configuration, click the Arguments tab.
 
jin Otanashi
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Knute Snortum wrote:In my version of Eclipse, you can add a program argument by creating a Run Configuration. Run -> Run Configurations..., select or create a configuration, click the Arguments tab.
what I'm support to put on the argument tab, client?
 
Knute Snortum
Sheriff
Posts: 4073
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you write this?

args is an array of argument that are usually passed from the command line. By looking at the documentation it seems you need an Internet address.
 
jin Otanashi
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Knute Snortum wrote:Did you write this?

args is an array of argument that are usually passed from the command line. By looking at the documentation it seems you need an Internet address.


like this ?

I guess i need find IP using the command prompt
client.JPG
[Thumbnail for client.JPG]
 
Knute Snortum
Sheriff
Posts: 4073
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, but not "args", the IP address of the computer you're running the server on, don't you think?
 
jin Otanashi
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Knute Snortum wrote:Yeah, but not "args", the IP address of the computer you're running the server on, don't you think?

you mean the IP numbers on the Arguments>
 
jin Otanashi
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jin Otanashi wrote:
Knute Snortum wrote:Yeah, but not "args", the IP address of the computer you're running the server on, don't you think?

you mean the IP numbers on the Arguments>


got it and already fixed thank you so much

working.JPG
[Thumbnail for working.JPG]
 
Knute Snortum
Sheriff
Posts: 4073
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!