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.
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.
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.
Can you show the content of the MANIFEST.MF file in your build jar file. I think you know that how to find that file?