Frustrated evaluation user

I've been testing IDEA for a week now, and I absolutely love the editor.

But I'm having a lot of problems too. I can never seem to get my projects to understand libraries that I add. For example, I have this web-module, which is to use a library I've written. The library right now is just 3 classes.

I've tried everything. My latest attempt was to add the library to the list of global libraries. I added it, I specified it's source location, I specified it's javadoc location, and I made sure it was hooked off in the Paths->Libraries->Global libraries box.

But the names simply will not resolve. I can build it all right, but the names won't resolve in the editor. I have this JSP page which starts by importing the package, and that works, but as soon as I try to use any of the classes it fails, giving me "Unresolved symbol" all over the place. The only way I can get around this is by copying the entire library into the current project.

Also, when I browse using the Project or Packages tab, the package is there and I can browse it, but the classes are all without names. The only external library I can browse properly is the JDK.

Incidentally I had the same problems when trying to use JUnit in a project, and I just gave up.

Can anyone please help me? I'm very close to giving up on IDEA :(

12 comments
Comment actions Permalink

Hi,

Please, post small sample project which illustrates the problem as well
as IDEA build you are using.

Aggie wrote:

I've been testing IDEA for a week now, and I absolutely love the editor.

But I'm having a lot of problems too. I can never seem to get my projects to understand libraries that I add. For example, I have this web-module, which is to use a library I've written. The library right now is just 3 classes.

I've tried everything. My latest attempt was to add the library to the list of global libraries. I added it, I specified it's source location, I specified it's javadoc location, and I made sure it was hooked off in the Paths->Libraries->Global libraries box.

But the names simply will not resolve. I can build it all right, but the names won't resolve in the editor. I have this JSP page which starts by importing the package, and that works, but as soon as I try to use any of the classes it fails, giving me "Unresolved symbol" all over the place. The only way I can get around this is by copying the entire library into the current project.

Also, when I browse using the Project or Packages tab, the package is there and I can browse it, but the classes are all without names. The only external library I can browse properly is the JDK.

Incidentally I had the same problems when trying to use JUnit in a project, and I just gave up.

Can anyone please help me? I'm very close to giving up on IDEA :(



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

I'm using the current evaluation version, which is build 1182.

I solved the problem, sort of. I thought using jars was just fine, nothing told me otherwise. But as it turns out, adding the classes rather than the jar file made everything work. So maybe there should be a hint somewhere that using jars is not a good idea? I mean, when you create a web project it will try to include lots of jars, so you sort of get the understanding that jars are ok, agree?

0
Comment actions Permalink

Aggie wrote:

I'm using the current evaluation version, which is build 1182.

I solved the problem, sort of. I thought using jars was just fine, nothing told me otherwise. But as it turns out, adding the classes rather than the jar file made everything work. So maybe there should be a hint somewhere that using jars is not a good idea? I mean, when you create a web project it will try to include lots of jars, so you sort of get the understanding that jars are ok, agree?

Of course using jars as libraries are allowed and more than that is a preferred way. The problems you're expecting
aren't usual behaviour of IDEA and we're still suspect some configuration errors there. So we're kindly requesting for a
sample project here if that possible.

--
Maxim Shafirov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Of course using jars as libraries are allowed and
more than that is a preferred way. The problems
you're expecting
aren't usual behaviour of IDEA and we're still
suspect some configuration errors there. So we're
kindly requesting for a
sample project here if that possible.


Ok... I created a new project, and added the bundled junit.jar file to the library. To do this I opened settings->Paths and opened the Libraries tab where I added the jar as a Module Library.

I then created a new class like this:

import junit.framework.TestCase;

public class JarTest extends TestCase {

}

The TestCase is underlined with red, because it doesn't resolve. It does however compile using "Make module".

I've included the JarTest.* files.



Attachment(s):
JarTest.iml
JarTest.ipr
JarTest.iws
0
Comment actions Permalink

I should also remark that if I try to browse the junit.jar file in the Project->Libraries view on the left, all the classes are nameless and if I doubleclick one of them I get this:

// IntelliJ API Decompiler stub source generated from a class file
// Implementation of methods is not available

class _ {
}

0
Comment actions Permalink

Huh, it's all clear now. As the matter of fact junit.jar is not a usual class-file bundle. Meaning it does not contain
root class package in the jar's root directory. Rather than that it contains a couple of intermediate folders inside.
So, to get the things working in this particular file you're to add a junit folder under bundled junit.jar to the
libraries rather than jar itself.
More generally speaking the library (regardless of is it inside jar or not) is a folder where root packages (like com,
java, org etc.) are reside.

--
Maxim Shafirov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Very well. I added the junit folder found in the jar file. The path to the library now reads: /home/andre/installed/idea4.0/lib/junit.jar!/junit

When I added this and tried to browse the junit.framework package, IDEA started thinking. It kept thinking for quite a while. Until I shut it down. I reopened the project, and now when I browse the junit package all the classes are still nameless.

And now it's junit that's underlined with red in
import junit.framework.TestCase.

So, if I use the junit folder in the junit.jar file, IDEA doesn't find the junit package. If I use the junit.jar directly, IDEA can't find the TestCase class. In both cases it doesn't seem to be able to read the files properly, as all the classes are nameless.

JUnit is just an example. I also have a web application that has /home/andre/installed/tomcat-5/common/lib/servlet-api.jar
in it's library path. In this project HttpServletRequest is unresolved (and I have the same problem with missing classnames when browsing the package).

0
Comment actions Permalink

I should also add that if I unjared the jar file into a folder called junit, this folder contains the following:

junit/
junit3.8.1/
META-INF/
stylesheet.css

If I added this folder to the library path (i.e. the jar root folder) everything works perfectly, and the class names all show up. Seems to me like IDEA isn't able to extract the classes from the jar file, because when I added the unpacked folder I could briefly see IDEA processing the class files, that did not happen if I added the jar file.

0
Comment actions Permalink

Well, I was completely wrong in my suggestion about wrong library root. Sorry. Just opened your project and everything
works right. A couple more assumptions:
1. What folder IDEA is installed to? I mean what is the full path to IDEA installation home?
2. Have you changed the default folder for IDEA system (caches)? If yes, what is the full path to there?

--
Maxim Shafirov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

That's finally might be the clue: are you using kernel 2.6.x? There's a known issue of IDEA 4.0 with that kernels which
is worked around in upcoming 4.5 (pretty close to actually). You may download a prerelease version at www.intellij.net/eap.

--
Maxim Shafirov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Yeah, I'm using Mandrake 10.0, so kernel is 2.6.x. I'll try out the prerelease. Thanks for your time!

0
Comment actions Permalink

You were right, with 4.5 it works like a charm :)

0

Please sign in to leave a comment.