Confusion with making new projects/java files [message #878917] |
Wed, 30 May 2012 07:44 |
Ed Z Messages: 1 Registered: May 2012 |
Junior Member |
|
|
Hi I just started using Eclipse, and I'm still a bit unfamiliar with some very basic stuff. One question I have is regarding creating files. The first thing I wanted to do is create a simple hello world program
class HelloWorld{
public static void main(String[] args){
System.out.println("Hello World");
}
}
which works fine when I create a class file within a java project. However, when I create a general file and then name it helloworld.java, it says I have no main method. What is the distinction between the two, and why does it do that?
Another thing I'm having trouble with is importing preexisting java files. I have in a folder, several .java files and .png images for a project I did a while back. When I try to use the import, with a file system, I can see all the files in that folder in the package explorer. But when I try to run the file, it gives me the same main method error as above. This is really puzzling as I used to use JCreator, and I could compile and run that same file with no problems at all. What would be the correct way to import preexisting related java files in a folder?
Thanks for your help.
|
|
|
|
Powered by
FUDForum. Page generated in 0.08037 seconds