Results 1 to 2 of 2

Thread: Java and xcode

  1. #1
    FishStickBoy
    Guest
    Java and xcode
    I'm new to Java and xcode and I need some help.
    I'm trying to make a server application and client application. I can do it on a pc but I was wondering how to do it in xcode. This is my client program:

    import java.net.*;
    import java.io.*;
    public class Noland4 {
    public static void main( String[] args ) {
    if ( args.length < 1 ) {
    System.err.println( "This does not work" );
    return;
    }

    try {
    System.out.println ("Please type a message: ");
    BufferedReader input = new BufferedReader(new
    InputStreamReader (System.in));
    String s = input.readLine();
    Socket sock = new Socket( args [0], 1234);
    PrintWriter out = new PrintWriter( sock.getOutputStream() );
    out.println( s);
    out.flush();
    BufferedReader in = new BufferedReader(
    new InputStreamReader( sock.getInputStream() ) );
    String t = in.readLine();
    if ( t !=null )
    System.out.println( "To server: "+ s +
    "\nFrom server" + t );
    sock.close();
    } catch( IOException e ) {System.err.println( e ); }
    }
    }

    When you run the code on a PC you enter in the command below, telling it to run the application and the IP address of the server. But when I run it in xcode I am not sure how to tell the application the IP address of the server to send or recieve anything.

    c:java "name of the file" "ip address"

  2. #2
    FishStickBoy
    Guest
    Don't Worry about it I figured it out!

    Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Java for Mac OS X 10.6 Update 17 latest java version?
    By Applet in forum OS X - Operating System
    Replies: 2
    Last Post: 09-12-2014, 02:07 AM
  2. Edit Java based code on Xcode and upload to Testflight
    By iostheguy in forum iOS Development
    Replies: 2
    Last Post: 09-07-2014, 11:03 AM
  3. Taking screenshot with java applet using java robot class not working
    By sagngh8 in forum OS X - Development and Darwin
    Replies: 1
    Last Post: 07-06-2011, 08:53 AM
  4. JNI with Xcode 3.0 - Adding Java Package
    By niroshpg in forum OS X - Operating System
    Replies: 2
    Last Post: 05-28-2009, 08:57 AM
  5. Newbie programmer needs JAVA help in XCODE
    By zeroelink in forum OS X - Development and Darwin
    Replies: 1
    Last Post: 02-02-2006, 11:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •