-1

I've been having problems running a project, and others in Eclipse.

I was mainly developing plugins before this, so it's been a while since I've done a stand-alone project. Maybe I'm just forgetting about something? =/

When I "run as" "java application" in Eclipse, absolutely nothing happens with no console output, too.

I have a guess that I am using the wrong buildpath (although I never changed it.)

Here is a screenshot of all the options:

List of Java Execution Environments

Which one should I choose?

Since this is happening to all my projects, I thought there would be no need to post project-specific code. If I was wrong in thinking that, please inform me and I'll post it.

Sorry for the huge question, first time asking on here...

Turtled
  • 11
  • 4

1 Answers1

0

What kind of project are you working on? I mean: is it a command line application? If that is the case, then your application should have a class with a main method.

NicoPaez
  • 426
  • 2
  • 12
  • It's a simple GUI program containing, of course, the main method. – Turtled Feb 04 '16 at 01:26
  • Then J2SE is ok. I would check the signature of the main method: `public static void main(String [] args)`. – NicoPaez Feb 04 '16 at 01:31
  • Here's my main method: `public static void main(String[] args) { JFrame window = new JFrame("Spacewar!"); Content content = new Content(); window.setContentPane(content); window.setSize(600,480); window.setLocation(100,100); window.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); window.setVisible(true); window.setResizable(false); System.out.println("Debug"); }` – Turtled Feb 04 '16 at 01:33
  • The main seems to be fine. But there is something strange with your screenshot: the package icon is white when I think it should be brown. I think that is related to the build path. Could share a screenshot of the build path? – NicoPaez Feb 04 '16 at 01:44
  • That is the classpath, not the buildpath. Check this please: http://screencast.com/t/ggBLmvnwmx – NicoPaez Feb 04 '16 at 02:00
  • Nothing wrong there. Given you are running on Windows, I think there could be an issue with the "!" in the name of your project. I would try to create a new Java Project and just a a simple class with main that prints "hello", just to check that you environment is properly setup. Avoid any "strange" character in names. – NicoPaez Feb 04 '16 at 02:19
  • Hhmmm, I would have never thought that would be the problem.... Wait, it's happening for my other projects, too. Would one incorrectly-named project break them all? =D – Turtled Feb 04 '16 at 02:21
  • I just refactored it, no difference. – Turtled Feb 04 '16 at 02:22
  • Sometimes there are issues about "strange" characters. But I think the issue this time is related to your environment. Do the following check. Close Eclispse an open it again but create a new Workspace. Once there, create a simplemente project like I mentioned: just a class with a Main method to perform a System.out.println – NicoPaez Feb 04 '16 at 02:26
  • Well, I got as far as the first step - http://imgur.com/jVABsYL It's been "saving workspace" for about 15 minutes. Although it doesn't seem to be responding, I'm scared to close it and lose all of the work I've done today. I think I'll be switching to IntelliJ IDEA soon... lol – Turtled Feb 04 '16 at 02:40
  • It deleted the whole project. Well, problem solved I guess. Dang. – Turtled Feb 04 '16 at 02:50