Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Messenger

 
Vitor Mateucci
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello i reciently started to take a java class in school so i taught what would be more fun then making a chat program that i could message between mine and my friends computer in class so i found a basic program online and just kinda copyed it
This is the ServerApp


and this is the ClientApp


now theirs 2 little problems

when i try to run the program through javac through the command prompt it gives me a error saying im not authorised, but i can run the program just fine through Jcreator

my second question is i dont know how to take this messenger program and put it in my friends computer and have the other in my computer. and have the program send messages back and forth.

I am still new to java programing and i know it was kinda cheap of me to take some ones codes but i really wana build into this and make this program nice especialy since this is my senior year i want to leave behind this program for the underclassmen.


Edit: this is where i got the code from http://www.youtube.com/watch?v=WMXA9qwDEp0
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of Java have you installed and do you have the JAVA_HOME variable set. On typing javac on the cmd prompt what is the error you receive.

The code uses the port number 100 to establish the Socket connection. Use something > 1024 for custom sockets. The code also uses deprecated methods.

To connect to the server you have to change the IP address and port number in the ClientApp.java class.


 
fred rosenberger
lowercase baba
Bartender
Posts: 12126
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please cite the source where you got this code from. 1) It is polite to give the actual author credit. 2) It allows us to check and make sure you copied it correctly, and 3) By not giving the original author credit, you may be committing a copyright violation.
 
Vitor Mateucci
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John Jai wrote:What version of Java have you installed and do you have the JAVA_HOME variable set. On typing javac on the cmd prompt what is the error you receive.

The code uses the port number 100 to establish the Socket connection. Use something > 1024 for custom sockets. The code also uses deprecated methods.

To connect to the server you have to change the IP address and port number in the ClientApp.java class.




my java is version 7.0.0.147 and i dont think i have JAVA_HOME set and i get error when i try to enter this on the comand promp

javac ClientApp.java

then i get this error

ClientApp.java:5: error: error while writing ClientApp: ClientApp.class <acess is denied>
public class ClentApp implements ActionListener,Runnable

Note: ClientApp.java uses or overrides a deprecated API
Note Recompile with -Clint:deprecation for details

(i get the same error when i run the ServerApp)
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you change the server socket numbers to something greater than 1024..?

What is the output you see when you type javac and java commands on the cmd prompt as such?
 
John Jai
Rancher
Posts: 1776
 
Vitor Mateucci
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John Jai wrote:Did you change the server socket numbers to something greater than 1024..?

What is the output you see when you type javac and java commands on the cmd prompt as such?


yes i changed it to 5000 and when i changed the Ip adress on the program it worked with J creator but not with cmd.

Also when i type javac onto the cmd i get the possible options outcome.
 
Vitor Mateucci
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


so what does this do? if you dont mind me asking
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic