Results 1 to 4 of 4
  1. #1
    viper81 is offline Member
    Join Date
    Dec 2008
    Posts
    3
    Rep Power
    0

    Default Jar file problems!

    Hi, I'm new.

    Here is my problem. Currently, i've used Eclipse to do my assignment which is a simple game( MasterMind Game using Server and Client socket). The thing is my program worked really fine within the Eclipse(API environment itself). However, when i exported my project to 2 jar files, one is server.jar and the other is client.jar, the program didn't work properly.

    any one has solution or suggestion for this?

    Thx in advance.

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    You didn't narrow things down much...

    First, you need each application to run separately. I assume the server starts first and then waits for the client. Create two batch files, one for each application. Make sure you set up the classpath correctly on the java command line. The JAR file must be listed in the classpath. Make sure you specify the fully qualified main class, i.e. dir1.dir2.MainClassName

    Get the server working first. Using java, rather than javaw, so your batch window gets the console messages. Put a "pause" at the end of the batch file to keep it from ending.

    Once the server is working, work on the client.

    Eclipse helps you out a lot by setting up the environment. That's most likely your problem.

    Good luck...

  3. #3
    viper81 is offline Member
    Join Date
    Dec 2008
    Posts
    3
    Rep Power
    0

    Default

    Thank you for your help.
    Yes you are right. In my program, the server starts first and waits for the client. And I traced the log file, nothing was wrong in the server side. Here is the situation where the problem occurs in the client side:
    Logically, when a user runs the program, a main window will come up. This main window has a few buttons like: single game, multiplayer game...etc. Then when the user clicks on either those two buttons, the main window supposingly leads to another window(i used card layout for this). However, the program didnt work as it's supposed to (It worked in Eclipse though o.o). Anyway, i will do as what you told me and see if i can solve this. Thx again.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

Similar Threads

  1. File read/write problems
    By p900128 in forum New To Java
    Replies: 4
    Last Post: 06-27-2008, 12:15 AM
  2. Problems with file dir
    By willemjav in forum Java Applets
    Replies: 0
    Last Post: 02-07-2008, 12:08 AM
  3. Problems sending file throught TCP sockets
    By Nite in forum Advanced Java
    Replies: 2
    Last Post: 08-04-2007, 09:01 PM
  4. Replies: 1
    Last Post: 07-18-2007, 11:20 PM
  5. problems with the name of file
    By bbq in forum Java Servlet
    Replies: 0
    Last Post: 06-28-2007, 04:47 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
  •