This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes Small IDEA complaint.  Workaround? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Small IDEA complaint.  Workaround?" Watch "Small IDEA complaint.  Workaround?" New topic

Small IDEA complaint. Workaround?

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

I don't think IDEA 4 has a way of adding existing files to an existing project. For example, let's say I have a project setup and I decide I need to add Hibernate to the mix. So I need to put the hibernate.jar file in my lib folder. As it is right now, I have to go outside of the Editor, open the path to my project and copy that lib folder.
Granted then IDEA finds the newly added file and it shows up in the project view. But the fact is I had to leave the editor just to add a file to the project. Am I missing something here or is this the way it is.

GenRocket - Experts at Building Test Data
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24195

In the settings "Paths" dialog, you can add a JAR to the project wherever it lives on your machine; it won't get moved, however. IDEA will just use it in-place. If you want to move it to the project directory, I suppose you're right, there's no way built into the IDE to do this.
Honestly, this behavior is one of the things I like about IDEA. If I added a JAR to a project, and the IDE copied the JAR to project/Build/jars/ or whatever (like Visual Studio used to do) it would drive me nuts. Part of the charm of IDEA is that it does only what it needs to do, nothing more. If you want to manage files, then you ought to use a file manager, not the IDE. That's the way they designed it.
On my machine I have a /home/ejfried/lib/java directory full of JAR files, and these are the ones I add to IDEA projects. There's only one copy of each, which makes upgrades easy.

[Jess in Action][AskingGoodQuestions]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

To me, File Management is important in the IDE.
I know what you are saying about the JAR files being copied. But I don't mind this. I know you don't use ANT, but if you did you would realize that adding a Folder full of JARS that are unique to your project to your WEB-INF/lib folder when creating your WAR is a lot easier than adding and/or excluding individual JAR files from a global JAR folder in your ANT script.
I always have a [b]lib[/url] folder in every project where I keep JAR files specific for my web app, even if some of those JAR files carry over to other projects.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
should be possible to write something that updates your ant buildscript when you add something to your project classpath.
Best of both worlds

Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
This is something that annoyed me at first, but I am growing to like it. When I was using Eclipse, I would use the import feature frequently. I absolutely hated the interface though. Windows Explorer is just a better interface for moving files around IMO. The fact that IDEA recognizes that is a bonus.

Matthew Phillips
I agree. Here's the link:
subject: Small IDEA complaint. Workaround?
jQuery in Action, 3rd edition