aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse3.0 removes class files automatically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse3.0 removes class files automatically" Watch "Eclipse3.0 removes class files automatically" New topic
Author

Eclipse3.0 removes class files automatically

Nira Shavitt
Greenhorn

Joined: Jul 26, 2004
Posts: 19
hi,

I've noticed that Eclipse removes all class files in the following cases:

1) Whenever I save a source file (and 'Build Automatically' is on) Eclpise runs 'Building workspace...' (you can see it on the lower right corner of eclpise), and this process actually removes all the class files.
So when I choose ant target to compile my java classes it compiles ALL the files although I saved only one file.

2) If I turn 'Build Automatically' to off, then Eclipse run the 'Building Workspace' only when I select an ant target to build the project. so Again, all the class files are removed just before I choose to compile them, so again, I'm compiling all the sources!!!

Anyone knows why it removes all the class files, and how to solve thsi problem? I can't have partial compilation now.

thanks,
Nira.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Well, the fix is to not use Ant to compile. Why would you want to, anyway? You are loosing all the benefits of the incremental Eclipse compiler...


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Nira Shavitt
Greenhorn

Joined: Jul 26, 2004
Posts: 19
How exactly I should use the eclipse compiler to compile incrementaly?

Should I check the 'Build automatically' on and use my ant file only for building the jar? or I should turn off the 'build Automatically' and use 'Build Project' once in a while? When I click on Build Project, it looks like nothing happens. Also Build All didn't compile my sources...

Any idea?
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Nira Shavitt:
How exactly I should use the eclipse compiler to compile incrementaly?

Should I check the 'Build automatically' on and use my ant file only for building the jar?


That's one option, especially if you are the only one working on the project.

In a team it might be a better idea to build distributions totally outside of Eclipse, on a build server or something.

When I click on Build Project, it looks like nothing happens. Also Build All didn't compile my sources...


Take a look at wether the Build Path is set correctly for your project...
Nira Shavitt
Greenhorn

Joined: Jul 26, 2004
Posts: 19
well, yes, the Build path is set correct.

Any other idea?

Nira Shavitt.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Can you post the contents of the .project and .classpath files, please?
Nira Shavitt
Greenhorn

Joined: Jul 26, 2004
Posts: 19
here is .classpath:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry sourcepath="X:/Titan/TOOLS/junit3.8.1/src.jar" kind="lib" path="X:/Titan/TOOLS/junit3.8.1/junit.jar"/>
<classpathentry kind="lib" path="X:/Titan/directory_root/System/BusinessLogic/Lib/Ext/xml-apis.jar"/>
<classpathentry kind="lib" path="X:/Titan/directory_root/System/BusinessLogic/Lib/Ext/concurrent.jar"/>
<classpathentry kind="lib" path="X:/Titan/directory_root/System/BusinessLogic/Lib/Ext/jce.jar"/>
<classpathentry kind="lib" path="X:/Titan/directory_root/System/BusinessLogic/Lib/Ext/jmxri.jar"/>
<classpathentry kind="lib" path="X:/Titan/directory_root/System/BusinessLogic/Lib/Ext/log4j.jar"/>
<classpathentry kind="lib" path="X:/Titan/directory_root/System/BusinessLogic/Lib/Ext/websphere/wsexception.jar"/>
<classpathentry kind="lib" path="X:/Titan/directory_root/System/BusinessLogic/Lib/Ext/xalan.jar"/>
<classpathentry kind="lib" path="X:/Titan/directory_root/System/BusinessLogic/Lib/Ext/websphere/admin.jar"/>
<classpathentry kind="lib" path="X:/Titan/directory_root/System/BusinessLogic/Lib/corba.jar"/>
<classpathentry kind="lib" path="X:/Titan/directory_root/System/Tomcat/common/lib/servlet.jar"/>
<classpathentry kind="lib" path="X:/Titan/directory_root/System/BusinessLogic/Lib/Endorsed/crimson.jar"/>
<classpathentry kind="lib" path="X:/Titan/directory_root/System/JBoss/client/jboss-j2ee.jar"/>
<classpathentry kind="lib" path="X:/Titan/directory_root/System/Tomcat/common/lib/ant.jar"/>
<classpathentry kind="output" path="classes"/>
</classpath>


Here is .project:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Framework</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>


thnaks for trying...
Nira Shavitt.

[edited to show full XML]
[ August 29, 2004: Message edited by: Jeanne Boyarsky ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Eclipse3.0 removes class files automatically