Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » eclipse not running .java file
eclipse not running .java file [message #662480] Wed, 30 March 2011 18:56 Go to next message
dsdsdsdsd  is currently offline dsdsdsdsd Friend
Messages: 7
Registered: March 2011
Junior Member
hello;

I am getting the "the selection cannot be launched error..."

I have Window/Preferences/Launching/LaunchTheSelectedResourceOrActi veEditor checked.

I opened my .java file via File/OpenFile.

my .java file is sitting in a package.

the PackageExplorer is empty ... I thought maybe that eclipse would automatically identify the package/directory that the .java file was sitting in.

the .java file was created in netbeans, but I do not believe that that should matter.

in netbeans it runs without errors.

any thoughts please.

Re: eclipse not running .java file [message #662497 is a reply to message #662480] Wed, 30 March 2011 20:17 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33217
Registered: July 2009
Senior Member
I think you'll need to have the .java file in a Java project in the
workspace to run it.


dsdsdsdsd wrote:
> hello;
>
> I am getting the "the selection cannot be launched error..."
>
> I have Window/Preferences/Launching/LaunchTheSelectedResourceOrActi
> veEditor checked.
>
> I opened my .java file via File/OpenFile.
>
> my .java file is sitting in a package.
> the PackageExplorer is empty ... I thought maybe that eclipse would
> automatically identify the package/directory that the .java file was
> sitting in.
>
> the .java file was created in netbeans, but I do not believe that that
> should matter.
> in netbeans it runs without errors.
>
> any thoughts please.
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: eclipse not running .java file [message #662524 is a reply to message #662497] Wed, 30 March 2011 22:36 Go to previous messageGo to next message
dsdsdsdsd  is currently offline dsdsdsdsd Friend
Messages: 7
Registered: March 2011
Junior Member
hmm, that's strange ... seems like .java file would be a .java file, regardless of it's location .... I'll probably do my first eclipse tutorial tomorrow, which will of course shed some light onto the eclipse authoring experience ... thanks.
Re: eclipse not running .java file [message #662530 is a reply to message #662524] Wed, 30 March 2011 23:33 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33217
Registered: July 2009
Senior Member
Well, you can't run a .java file directly. You have to compile it to a
..class file and run that, along with a JRE. Looking at some
introductory tutorials would be best.


dsdsdsdsd wrote:
> hmm, that's strange ... seems like .java file would be a .java file,
> regardless of it's location .... I'll probably do my first eclipse
> tutorial tomorrow, which will of course shed some light onto the
> eclipse authoring experience ... thanks.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: eclipse not running .java file [message #662568 is a reply to message #662480] Thu, 31 March 2011 07:29 Go to previous message
dsdsdsdsd  is currently offline dsdsdsdsd Friend
Messages: 7
Registered: March 2011
Junior Member
Ed, thanks.

Previous Topic:faces config editor in eclipse after importing war file
Next Topic:Is Line Break the only difference between "Correct Indentation" and "Format"
Goto Forum:
  


Current Time: Mon Sep 23 16:59:53 GMT 2024

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

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

Back to the top