Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes IDEs, Version Control and other tools and the fly likes Using Eclipse as a Java editor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Using Eclipse as a Java editor" Watch "Using Eclipse as a Java editor" New topic
Author

Using Eclipse as a Java editor

Danish Shaukat
Ranch Hand

Joined: Nov 16, 1999
Posts: 340
Hi all,

I want to use Eclipse as a Java editor only.

I use Ant for my builds and have my own directory structure. Something like this:
\src\com\mycompany\server\myappNo45

I have atleast fifty applications right now. I have to maintain them and create new ones as well.

When I open up files in eclipse (using version 2.1), it creates its own files in my source code directories. Apart from this it also creates class files in the same directory, if not specified elsewhere.

I just want to use it as a java editor without all these files (class files, project files etc) being created.

Danish
[ September 16, 2005: Message edited by: Danish Shaukat ]
Lewin Chan
Ranch Hand

Joined: Oct 10, 2001
Posts: 214
Well, in order to get the features like telling you have compile problems cos you're using the wrong method in your utility class xyz you will have to allow eclipse to compile java classes. If you just wanted a syntax highlighter, then just a text editor like vim/textpad/ultraedit.

I'm in much the same position, what I do, is set the default output dir for a given project to be .eclipse, then all the class files etc etc go into the .eclipse folder, and don't annoy me when I run ant build, or leave class files lying around the source tree.


I have no java certifications. This makes me a bad programmer. Ignore my post.
Danish Shaukat
Ranch Hand

Joined: Nov 16, 1999
Posts: 340
Originally posted by Lewin Chan:
Well, in order to get the features like telling you have compile problems cos you're using the wrong method in your utility class xyz you will have to allow eclipse to compile java classes. If you just wanted a syntax highlighter, then just a text editor like vim/textpad/ultraedit.


Since I use Ant, so I get compiler errors on the console.

I just wanted to use Eclipse for coding purposes. Apart from this once I start coding in Eclipse, who knows I might start exploring other featues... And there is no harm in learning an IDE, even though I use Ant. Coding in Eclipse seems to be the first step.

I think code quality will certainly improve if I use Eclipse instead of Textpad.

Danish
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

If you want to have Eclipse you're going to have a .project file. If it's a Java project you'll have a .classpath file. This is the minimum. If you turn off automatic compiling, it won't create the class files and you can still use the Eclipse syntax-highlighting and pre-compiler, although I'm not sure how useful it will be if you never let it compile the source.

I recommend separating the source and build directories and letting Eclipse do it's thing. You can always get ANT to compile to a different location and then ANT and Eclipse won't step on each other's toes.

Failing that I agree with the previous post: look at a text editor with syntax highlighting and not a full-blown IDE like Eclipse. I like TextPad.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Danish Shaukat:

Since I use Ant, so I get compiler errors on the console.


Well, yes - but using the eclipse compiler will get you much faster feedback.


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
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

Ant and Eclipse are hardly mutually exclusive. Many of my projects can't be fully built (at least without more effort than I want to invest) just by Eclipse itself.

Apparently, your complaint is that you don't want Eclipse building classes inside the source code directory structure.

Eclipse prefers to keep its projects self-contained. Aside from its own internal convenience, it also makes life easier when working with tools such as CVS and the import/export tools (I often take work home in a ZIP file).

Eclipse needs those compiled class files in order to provide the intelligence of the IDE - it's using them as a repository of information about your project, not just as the output of the project. This is different from IntelliJ, which keeps the compiled class info in memory. I'd recommend switching to IntelliJ, if you really can't abide those classfiles.

In Eclipse, you can dispense with the classfiles only by making the project be a non-Java project and thus disabling the Java builder.

Personally, I can't see the benefit in creating the interim classes somewhere else. I only go outside the project when deploying the packaged results. But aside from the extra disk space used and occasional annyoances from having your out-of-line classes be behind the edited copies, where's the harm? If you want to keep the temportay classes out of CVS, just add the project's class output directory to .cvsignore. I do that anyway, since I don't care to waste respository space with multiple generations of files that can be automatically reconstructed anyway.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using Eclipse as a Java editor
 
Similar Threads
what software tools will I need?
Environment variables (Win 2K)
Eclipse without "projects"
file type association with my java program
any good free Java IDE + debugger