no main() in HelloJava. files
Hello Pat, I hope you will see this at some point. In all the HelloJavax.java files there's no main() and as such I've not been able to get them to compile and nothing in the book is helping. Could you review and correct please?
Hi,
Each HelloJava.java example file should have a main() method. e.g. HelloJava4.java has the main starting on line 7. You can view it on github here:
https://github.com/patniemeyer/learningjava/blob/master/examples/ch02/HelloJava4.java
Could you tell me what you see exactly in your file and where you got it? Did you download the zip or grab it from github?
Pat
On Jul 5, 2013, at 1:25 PM, codeshift8 [email protected] wrote:
Hello Pat, I hope you will see this at some point. In all the HelloJavax.java files there's no main() and as such I've not been able to get them to compile and nothing in the book is helping. Could you review and correct please?
— Reply to this email directly or view it on GitHub.
Might I suggest you run through the latest edition of the book with your source and a clean Eclipse install.
I got it to run by creating a new Package (Right-click over 'learningjava-master' > New > Package) and drag&drop the exercise to it. ... but I don't know why this worked and what's the fix for all the other chapter exercises (I'm a complete Java newbie).
... I think I got it, the following first line is missing in 'HelloJava.java'. package examples.ch02;
I was able to resolve the problem the same way rossola did. It seems that all of my files have the same problem as well. I went through HelloJava.java, HelloJava2.java, and HelloJava4.java.
I downloaded from: https://github.com/patniemeyer/learningjava Using the Download Zip button. I'm using the fourth edition of the book.
Is there a way to get my original source files to work correctly?
Thanks!