Opening a single .java file in Eclipse
Hello everyone, I'm sorry to have to ask such a simple question but I have downloaded a single .java file from my university and I don't know how to open it correctly in Eclipse. I have tried creating a new project first and simply dragging the file into eclipse. The program shows correctly but doesn't run. I have tried importing the file but there is no browser option which identifies the file. I have also tried copying the file into the 'src' directory, creating a new project with identical name as the .java but it still won't run. Its says it can't find the 'main' but the main is in the file, ie. the "...main String[] args..."
Please can someone explain how to simply import (or simply have run) a single .java file. Im sure its got something to do with incorrect path locations or what not.
Cheers.
Re: Opening a single .java file in Eclipse
If you want to just open the file go to file -> open file ...
If you want to run java file, create a simple java project, then copy your java file to the src package and right click (over your java file) -> run as java application.
This should work.
Re: Opening a single .java file in Eclipse
lol thankyou! I'm an idiot.
Re: Opening a single .java file in Eclipse
Quote:
Originally Posted by
Dreamer999
lol thankyou! I'm an idiot.
Jaja no problem !!