wood burning stoves*
The moose likes Beginning Java and the fly likes Messenger Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Messenger " Watch "Messenger " New topic
Author

Messenger

Vitor Mateucci
Greenhorn

Joined: Oct 06, 2011
Posts: 13
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
Bartender

Joined: May 31, 2011
Posts: 1776
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

Joined: Oct 02, 2003
Posts: 11175
    
  16

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.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Vitor Mateucci
Greenhorn

Joined: Oct 06, 2011
Posts: 13
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
Bartender

Joined: May 31, 2011
Posts: 1776
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
Bartender

Joined: May 31, 2011
Posts: 1776
To set the JAVA_HOME follow - http://www.coderanch.com/how-to/java/how-to-create-java-program#SettingJavahomeAndPath
Vitor Mateucci
Greenhorn

Joined: Oct 06, 2011
Posts: 13
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

Joined: Oct 06, 2011
Posts: 13


so what does this do? if you dont mind me asking
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Messenger
 
Similar Threads
Write and Update CSV files
Doubt about IO package
Putting an object instance into an ArrayList
Can not find my error ? Help
flushing output to different lines