Can no longer compile/run an existing project [message #268161] |
Tue, 27 January 2009 14:06  |
Eclipse User |
|
|
|
Everything was working fine until today. Now, when I try to run a class
with a main() method, I get a message dialog that says:
Launching CodeTester has encountered a problem.
apache.commons.lang does not exist
I also can't seem to compile any code in this project. I tried
Project>clean... All that did was delete all the .class files, but it did
not rebuild them.
The problem started when I tried to change the Java compiler for this
project to 1.6. It recompiled the project, but I still couldnt use API
that was new in 1.6. So I typed java -version in the command line and it
showed I only have 1.5. So I changed the project settings back to 1.5.
Thats when it stopped compiling any code. I had made a full back up of
my machine yesterday, so I restored my *entire* Eclipse workspace
directory to the pre-problem state. But that didnt fix the problem
either. Other projects in this workspace do not appear to be affected.
Is there anything I can do short of starting a fresh project and importing
the source code from the broken project?
|
|
|
|
Re: Can no longer compile/run an existing project [message #268171 is a reply to message #268161] |
Tue, 27 January 2009 15:52   |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
On 1/27/2009 2:06 PM, Jonathan Eck wrote:
> Everything was working fine until today. Now, when I try to run a class
> with a main() method, I get a message dialog that says:
>
> �Launching CodeTester� has encountered a problem.
> apache.commons.lang does not exist
>
> I also can't seem to compile any code in this project. I tried
> Project>clean... All that did was delete all the .class files, but it
> did not rebuild them.
>
> The problem started when I tried to change the Java compiler for this
> project to 1.6. It recompiled the project, but I still couldn�t use API
> that was new in 1.6. So I typed java -version in the command line and it
> showed I only have 1.5. So I changed the project settings back to 1.5.
> That�s when it stopped compiling any code. I had made a full back up of
> my machine yesterday, so I restored my *entire* Eclipse workspace
> directory to the pre-problem state. But that didn�t fix the problem
> either. Other projects in this workspace do not appear to be affected.
> Is there anything I can do short of starting a fresh project and
> importing the source code from the �broken� project?
Do you specify the JVM to run Eclipse, either on the command line or in
eclipse.ini? If not, you REALLY should; see this for help:
http://wiki.eclipse.org/Eclipse.ini
Now, when you set your Java Compiler settings for the project to 1.6,
you also needed to set the JRE in the Java Build Path, Libraries tab to
be a 1.6 JRE. If you launch Eclipse with a 1.6 JRE/JDK, that will be the
default choice (unless you've overridden the default in Preferences >
Java > Installed JREs)
Some general advice: in addition to always specifying the JVM in
eclipse.ini, go to the Installed JREs preferences and configure the ones
you want to use - this is a workspace setting, so if you use more than
one workspace make sure to export/import your preferences to move these
settings. Finally, when setting the JRE Library on a project's build
path, always use an Execution Environment rather than a specific JRE name.
If you follow those tips, you'll avoid many problems like you've
encountered here.
Hope this helps,
Eric
|
|
|
|
Re: Can no longer compile/run an existing project [message #268183 is a reply to message #268179] |
Wed, 28 January 2009 01:02  |
Eclipse User |
|
|
|
"Jonathan Eck" <joneck@myuw.net> wrote in message
news:11dff832b4272a7eac5f5c719e48327d$1@www.eclipse.org...
> Ah! I think the JRE for running Eclipse might be the issue. But I can't
> find the eclipse.ini file. I'm using Mac OS X, not Windows. Would that
> make any difference?
On my Mac, I've got an eclipse.ini in the same directory as my Eclipse.app,
but I think I might have had to actually open the Eclipse.app and extract it
from there.
|
|
|
Powered by
FUDForum. Page generated in 0.31006 seconds