I want to run a specific .java file (a class), but Eclipse is not co-operating.
I have tried to follow the instructions here -->
eclipse how to run a different class
... but my "Run As" menu item never contains "Java Project".
I have tried accessing the menu after right-clicking in the .java pane and tab itself, and from the .java name and class name in the Package Explorer, but of course that doesn't make a difference. The only option I ever get is "Run Configurations".
(and yes, my .java has a "main" method.)
import com.jsyn.JSyn;
public class SuperSimpleSounds {
public static void main() {
[...]
What, exactly, is needed to be able to run an individual class (an individual .java file)?
解决方案
Add a String array argument to the main method as expected by the JVM
public static void main(String[] args) {