LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-28-2011, 06:48 PM   #1
cajunchief
Member
 
Registered: Sep 2010
Posts: 233

Rep: Reputation: 0
Linux and eclipse. With an eclipse problem


Hello All,

I am a Linux Newbie and am a JAVA newbie too. I am in a java class and am learning to write code. Yesterday, after completing most of my code I went and closed out all the -- for lack of a better term -- "screens" Now when I open Eclipse I hunt for my program and open it and when i go to compile my program i get " RUN AS
Select what to run:

Ant Build.

this is not the normal compile option and I don't know what is going on or how to fix it.
I hope this is the right forum for help. PLEASE HELP.

Thanx!!!
 
Old 09-30-2011, 03:48 AM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Hi,

Make things easy on yourself, leave everyhting as it is and just close Eclipse. It restores everything later on, well, it did now, but you did'nt expect this, did ya?

Somewhere on the left, you should see your project tree, expand it until you see your class(es), double-click on the one(s) you want to open and "poof"...

Happy coding!

Thor
 
Old 10-01-2011, 07:47 AM   #3
cajunchief
Member
 
Registered: Sep 2010
Posts: 233

Original Poster
Rep: Reputation: 0
THOR, no it didn't :(

Thor,
I did a close all. Is that what you were saying? Now when I logged back on, I have a total blank screen and have to figure out how to open all the windows and then figure out how to get it to compile again??????????????????????????????????????

HELP HELP HELP!
 
Old 10-01-2011, 12:01 PM   #4
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Dont panic, Eclipse is your friend

Okay, look at this image, see the left? Where it says "src" right above the folder "com.vehicles" - this is an example of how Eclipse organises stuff.

Look at your screen, see the tree at the left? Expand it until you see your source code...in this example, the file is called "car", by double-clicking on that name (in the tree) you open the file.

I'll keep this thread on the scope, dont worry

Thor
 
Old 10-02-2011, 06:42 PM   #5
cajunchief
Member
 
Registered: Sep 2010
Posts: 233

Original Poster
Rep: Reputation: 0
All a.f.u.

Thor,

I do see what your saying, however I can't figure out how to get the Eclipse to open as it did the first time i ever used it. Which would let me see all the views, and the edit section and also hopefully the compile option would be correct.

Sorry if i sound dumb!
 
Old 10-02-2011, 07:44 PM   #6
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by cajunchief View Post
Thor,

I do see what your saying, however I can't figure out how to get the Eclipse to open as it did the first time i ever used it. Which would let me see all the views, and the edit section and also hopefully the compile option would be correct.

Sorry if i sound dumb!
Ok, let's take this one step at a time. Start by attaching a screenshot of how your Eclipse looks at the moment.

[EDIT]:
BTW, the very first time eclipse starts you get the 'Welcome Screen'. Is this what you want?
In this case click on Help->Welcome. At least in Galileo that is how to get to the welcome screen.

Last edited by crts; 10-02-2011 at 07:46 PM.
 
Old 10-04-2011, 10:45 PM   #7
cajunchief
Member
 
Registered: Sep 2010
Posts: 233

Original Poster
Rep: Reputation: 0
Thanks for trying to help me thor

Thor,

I am trying to upload the screenshot you asked for thor. I am trying to find where it puts the file.
Attached Thumbnails
Click image for larger version

Name:	Screenshot-Java - Eclipse SDK .png
Views:	19
Size:	34.2 KB
ID:	8113  
 
Old 10-05-2011, 01:51 AM   #8
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,272

Rep: Reputation: 154Reputation: 154
Open the Window menu, go to Show View and click Package Explorer.
 
Old 10-06-2011, 11:49 AM   #9
cajunchief
Member
 
Registered: Sep 2010
Posts: 233

Original Poster
Rep: Reputation: 0
Talking Step one (1) worked, what's next

Phil,d.g.,

Step one worked! what is next I am trying to get the compiler to compile my program.

I opened the code up and hit the compile button and got the following message:

"Selection does not contain a main type."

Last edited by cajunchief; 10-06-2011 at 11:55 AM.
 
Old 10-06-2011, 12:32 PM   #10
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Did you open the project? Again, attach a screenshot. This is the fastest way for us to see what is missing.
 
Old 10-06-2011, 08:16 PM   #11
cajunchief
Member
 
Registered: Sep 2010
Posts: 233

Original Poster
Rep: Reputation: 0
Added the requested/required screen shot

CRTS,

THANKS and good feedback attached is the screen shot. Still need help. Thanx!!!
Attached Thumbnails
Click image for larger version

Name:	Screenshot-Java - distance and travel-src-distanceTravel.java - Eclipse SDK .png
Views:	18
Size:	140.6 KB
ID:	8136  
 
Old 10-06-2011, 08:49 PM   #12
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Ok, your Eclipse looks fine so far.
The problem is that your program is flawed. As the message in a previous post suggests, it is missing the main function. I also see a lot of marked errors in your screenshot. This is another reason why your program will not execute even if you supply a class with a main function. Did your program execute before? If yes, then it might be necessary that you import some missing classes into your project, i.e. copy/move them to your source folder and then refresh the project by marking it in the package explorer and then hitting F5.
 
Old 10-09-2011, 10:20 PM   #13
cajunchief
Member
 
Registered: Sep 2010
Posts: 233

Original Poster
Rep: Reputation: 0
Current error message i am getting

CRTS,

I understand what you said about my program not being correct. So I opened up an older program that I know does work. But the screen message i get when i try to compile it is shown on the attachment.
Attached Thumbnails
Click image for larger version

Name:	Screenshot-Run As -1.png
Views:	14
Size:	18.6 KB
ID:	8150  
 
Old 10-10-2011, 04:20 AM   #14
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by cajunchief View Post
CRTS,

I understand what you said about my program not being correct. So I opened up an older program that I know does work. But the screen message i get when i try to compile it is shown on the attachment.
AFAIK, you cannot just open a program and try to compile it in eclipse. You will have to create a project first. Then you can manually copy the existing source files into its project source folder.

Try the following:
File->New->Java Project

As project name enter: test
Click 'Finish'.

Right click on the newly created project and select:
New->Class

In field 'Name' enter: test
Click 'Finish'.

The new class window opens. Add a main function. E.g., This is how your class could look like:
Code:
public class test {
	public static void main(String[] args) {
		System.out.println("Hello World!");
	}
}
Save and run the project.
For more detailed tutorials have a look here:
http://eclipsetutorial.sourceforge.n...lbeginner.html
http://eclipsetutorial.sourceforge.net/
http://www.eclipse.org/resources/?category=Tutorial
 
Old 10-12-2011, 10:26 PM   #15
cajunchief
Member
 
Registered: Sep 2010
Posts: 233

Original Poster
Rep: Reputation: 0
[solved]

[SOLVED]
Thank you CTRS,
the comments you gave me did help. I know I need to do the tutorials and I will very
very soon.

Thanx man.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Metrics plug-in for Eclipse, does it support Eclipse CDT? like2learn Programming 2 04-02-2012 03:13 AM
Eclipse mp3 player model type: ECLIPSE-CL2BLK Bagatelle Linux - Newbie 0 12-25-2009 01:39 PM
Eclipse PDT 2.0 vs Zend Studio for Eclipse NaCo Programming 1 02-01-2009 11:35 AM
LXer: Gentleware Unveils New Apollo for Eclipse and openArchitectureWare Eclipse Dist LXer Syndicated Linux News 0 10-25-2007 09:30 PM
LXer: Netbeans attempts to eclipse Eclipse LXer Syndicated Linux News 0 04-17-2006 09:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration