Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Using Run(Eclipse does not seem to be running what I want)
Using Run [message #773788] Mon, 02 January 2012 14:40 Go to next message
Francisco Queirós is currently offline Francisco QueirósFriend
Messages: 4
Registered: January 2012
Junior Member
Hello, Eclipse Community.

I am here, hoping to get some help on a matter.

To start off, I'm sort of a noob looking to learn Java and for that, I'm using Eclipse.

I've encountered something that is *really* bugging me. The problem is that every time I try to run a .class file, I click run, but then, Eclipse tries to run something that isn't selected, or that doesn't even exist!

I've posted a picture, showing what I mean. In the picture I got my helloWorld.java file selected. I clicked to run it. But for some reason, Eclipse wants to run the whole project. And I really don't know how to change that. I really need some help here.

index.php/fa/6608/0/

P.S.: I know that I already posted this on Newcomers forums, but I wasn't getting any answers, so, I decided to post here. I tried to just "forward" the post over here, but the forums doesn't let me use links yet. Sorry.
Re: Using Run [message #773899 is a reply to message #773788] Mon, 02 January 2012 21:01 Go to previous messageGo to next message
Rylan Cottrell is currently offline Rylan CottrellFriend
Messages: 5
Registered: January 2012
Location: Calgary, Alberta
Junior Member

Just right click on the java file and choose 'run as' select Java Application and it should default that execution for future clicks of the run button. Another tip is your classes should always start with a capital letter to follow the Java standard coding convention (java.sun.com/docs/codeconv/html/CodeConventions.doc.html#16712).
Re: Using Run [message #773908 is a reply to message #773899] Mon, 02 January 2012 21:25 Go to previous messageGo to next message
Francisco Queirós is currently offline Francisco QueirósFriend
Messages: 4
Registered: January 2012
Junior Member
I've tried what you suggested, but that option doesn't seem to exist...

This next screenshot shows what I mean:

index.php/fa/6609/0/

Also, I tried looking at the "Run Configurations", didn't really understand how it worked.

Also, I've applied the tip you gave me. I was using lowercase class names because I had an odd memory of Eclipse telling that uppercase class names are not advised. But apparently, it's the other way around. Embarrassed
  • Attachment: Eclipse.png
    (Size: 215.81KB, Downloaded 242 times)
Re: Using Run [message #773921 is a reply to message #773908] Mon, 02 January 2012 22:07 Go to previous messageGo to next message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
On 01/02/2012 03:25 PM, Francisco Queirós wrote:
> I've tried what you suggested, but that option doesn't seem to exist...
>
> This next screenshot shows what I mean:
>
>
>
> Also, I tried looking at the "Run Configurations", didn't really understand how it worked.
>
> Also, I've applied the tip you gave me. I was using lowercase class names because I had an odd memory of Eclipse telling that uppercase class names are not advised. But apparently, it's the other way around. :blush:
The class that you have selected is not a runnable class. Your main
method has to take a string array.
Re: Using Run [message #773946 is a reply to message #773921] Mon, 02 January 2012 23:53 Go to previous messageGo to next message
Francisco Queirós is currently offline Francisco QueirósFriend
Messages: 4
Registered: January 2012
Junior Member
You sir, made my day.

I am following a set of tutorials, and on the tutorial it has as argument for the main method "String args[]". I was wondering what it was for... and I didn't write it. Now I know what it is for... Embarrassed

Thanks, once again.
Re: Using Run [message #774013 is a reply to message #773946] Tue, 03 January 2012 04:56 Go to previous message
malika goyal is currently offline malika goyalFriend
Messages: 1
Registered: January 2012
Junior Member
Hi,

You can just run the it as a java application by choosing "run" from the menu bar or like you have done right in the java
application, you have two options "Java Applet" and "Java Application", you choose "Java application" to run the program.


Thanks & Regards,
Malika
igimarketcare.com

Previous Topic:Plugin to generate executable file?
Next Topic:AntRunner vs Eclipse Indigo
Goto Forum:
  


Current Time: Wed Apr 24 18:26:52 GMT 2024

Powered by FUDForum. Page generated in 0.02972 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top