Hi, guys! I learn Java with "Head First Java" book. There are server and cleint classes like a "DailyAdviceClient.java" and "DailyAdviceServer.java".
Just I've edited it by my code for visualization and graphics. It runs on localhost.
But then I made JAR files for client and server. And after my runnig try it doesn't run.
I've used IntelliJ IDEA for it.
Could you help me please. Classes code is below. Thank you for your advices beforehand.
Please post text; screenshots are very difficult to read. But even with the difficult reading, I can see a problem. You haven't got a main class named in the manifest file. Read the section in the Java™ Tutorials, particularly the part about an application's entry point.
Campbell Ritchie wrote:Please post text; screenshots are very difficult to read. But even with the difficult reading, I can see a problem. You haven't got a main class named in the manifest file. Read the section in the Java™ Tutorials, particularly the part about an application's entry point.
That says that you have two packages, Client and Server.
However the screenshot of your jar files shows that neither of the two classes are in a package...they both sit at the root level.
Which (as with the screenshots) shows clearly that the files are not in packages in the jar file.
It also shows that they are .java files and not .class files, so they won't run.
I don't know how the Eclipse jarring stuff works offhand, so I can't give you the solution, but it looks to me like you haven't told it to jar up the correct bits.
Oh, hang on, that's IntelliJ in those screenshots isn't it?
When I add an artifact and select an empty jar, I get the <Module name> compile output option to add in, over in Available Elements.
Your's should be under Head First Project I think.
Dave Tolls wrote:Oh, hang on, that's IntelliJ in those screenshots isn't it?
When I add an artifact and select an empty jar, I get the <Module name> compile output option to add in, over in Available Elements.
Your's should be under Head First Project I think.
Ouch, Dave, exactly! You are my big boss!
Campbell, thank you very much again.
I added "'Head First Project' compile output" into "Output layout" (jar archive).
PS. How can I stop server now?
Post by:autobot
Tomorrow is the first day of the new metric calendar. Comfort me tiny ad:
a bit of art, as a gift, that will fit in a stocking