When a IClasspathContainer contains zero IClasspathEntry - eclipse

I've built my own IClasspathContainer to link in a 3rd party JAR. On occasions no JAR can be found and getClasspathEntries return an array of zero IClasspathEntry objects.
The effect this has on the project tree is unexpected - the library/classpath-container vanishes from the project display altogether.
Ideally the library icon would remain in the project tree, leaving me something to decorate to indicate the error. More ideal still, I could decorate the root project icon to indicate a build error.
Can anyone advise how I might achieve this - if achievable at all?
M.

Related

Cannot get class-files from Java-package in eclipse

I have a webapp containing some Java-classes within some packages. However within Package-Explorer only the names of the packages are listed, but I cannot get the classes within them. Thus the icon for the package stays empty meaning there is no content within the package.
When I manually drag a class from the WinExplorer into the Package-Explorer I get a warning that the class is already contained in the package. Having said this the package is not empty, however I cannot get any of its classes.
Check Project-->Properties-->Java Build Path-->Sources tab.
Make sure that "Included" is properly set (Usually to "All").
Also check that the "Filter" (little triangle icon) is not hiding the required code sources.
You can also try to "New-->Java Project" than use the existing sources.

Why is IntelliJ highlighting errors in one project, but not another?

I'm using IntelliJ 13 and the Scala plugin. In one project if I make an obvious type error I get a visual indication, like this:
But I just started a new project and a similar thing is not highlighted, even after I compile.
I'm giving a presentation on some Scala code and I'd like it if the type errors highlighted like in the first one, but I have no idea where the setting is.
One reason could be that the level of highlighting is set to a lower setting. Check your lower right corner for a button which adjusts this setting with a slider. It looks like (at least to me) a policeman face :)
Another thing is that you might not have declared what additional languages you're using besides the primary one. You can configure this in the project settings.
Also if you are using a tool to build a project (like Maven for example) try rebuilding or reimporting your project.
edit: One last thing. Make sure IDEA isn'currently reindexing or running some background tasks, this really messes up code correction.

Eclipse - manifest.mf plugin dependencies - different icons

Greetings fellow Stackoverflownians,
I am developing an Eclipse RCP plugin, and have come across different icons in the Dependencies tab of the manifest file:
Anybody got a clue why the last one is different? My supposition is that it's coming from a different source, i.e. the Build Path, instead of the Target Platform.
It's a nebula for me, to be honest.
Any opinions and suggestions are appreciated!
It seems to be that icon on 'some.project.here' icon means the plugin is in your workspace, the other icon means the plugin comes from the target platform.
You can also get a small question mark overlayed on the image which means the plugin is optional. There is also a small arrow overlay which means the plugin dependency is marked as re-exported.
There is also an 01 overlay which I think means this a project imported using 'import plugins and fragments' with 'binary project' selected.
Maybe it has something to do with the fact that the plugin you are adding is in your package explorer.
Yep you're right. The arrow means definitly that eclipse will resolve the dependency from the TargetPlatform. And the other one with the dot indicates, that it will resolve it from your local workspace.

In Eclipse, how do I refresh the icon decorators (per-file 1+ warning, 1+ error) in my Project Explorer?

In Eclipse, in the Project Explorer pane, each Java file will have an icon decorator, indicating whether that file has 1+ compilation errors, or 1+ compilation warnings.
I often find that these icon decorators are out of date with my latest file changes.
How can I force them to be up to date?
I try right-clicking on the project's top-level directory and selecting Refresh, but that doesn't help. Neither does restarting Eclipse.
I realize that one alternative is to use the Markers pane, but that gets me the entire list of all warnings/errors across all files. I'd rather know, see visually, which files have problems and which are clean.
You haven't said which language you are using and whether autobuilds are on or off.
In general, problem markers are only added and removed by your project's builder. If you are using Java, for example, that language has full automatic incremental build support, so the markers update whenever you save a file. Not all languages enjoy this; you may need to explicitly rebuild your project(s) to force an update.
If you believe a marker is out-of-date, or just want to hide it, it's usually safe to delete it from the Markers view; the relevant builder will reinstate it if necessary next time it runs.

Eclipse 3.4.1 - how to view compiler output in Console while building a project

I have what appears to be a very annoying problem. When compiling a project in Eclipse, I see no Console that shows the invocation of the Java compiler and the build results (as in NetBeans).
If I, for instance, import an existing project into Eclipse and invoke Project->Build Project, is there a view that will show me results of the compilation? While I know that my project contains a number of files that have errors, invoking Build Project shows no visual result/progress of the compilation. It does not show the list of errors so that I can quickly jump to them.
I'm aware that there is a "Problems" view, which shows a list of problems (and not just compiler errors) in all projects and not the particular project that I am working with, which makes it very inconvenient to locate and jump to source of the problem.
You can configure the problem view to show only problems in the current project:
Click on the small triangle at the far right of the view.
In the popup menu, select "Configure Contents..."
Select each item in the "Configurations" list and click on "Scope: On any element in the same project"
If you want to see the compiler working, you need open the "Progress" view.
Since Eclipse JDT provides its own built-in Java compiler, you generally do not see the invocation of Java Compiler.
The built-in Java compiler is tightly integrated with Eclipse and JDT, and provides the source indexing that enables powerful IDE features such as refactoring and quick fix.
Plus, it enables incremental build in background after each file modification, hence no visible "java" invocation.
You can replace/complete the java compiler with a javac` call of your own:
For instance, Using Alcatel-Lucent nmake with Eclipse JDT does precisely that, and uses a configuration launcher (which you can instruct to show a console):
You will need to add that special builder in the "builder" section of your project.
Do not forget you can create many "Problem view", and set one of them to show only problems for your current project.
Select: "on any element in same project"
Goto Windows->Show View->Console
or
Alt+Shift+Q,C
Console appears in tab with Problem view
Your question contains a couple of assumptions that you might want to re-think.
It does not show the list of errors so that I can quickly jump to them.
Errors are flagged in the edit window while you are editing. You can fix them on the spot, without having to "jump" anywhere.
If you drop an entire source file into your project, you may not be in an edit window on that file. (And, of course, that's not standard Eclipse usage.) The simplest way I know do deal with that is simply to "Refresh" the project and look in the Package Explorer view to see whether there are any errors detected (which will happen immediately if you "refresh" a file into a source folder). Double-click on any files which show an error icon and look at the right-hand side of the edit window to see exactly where the errors are.
I'm aware that there is a "Problems" view, which shows a list of problems (and not just compiler errors) in all projects and not the particular project that I am working with...
Unless you are using multiple projects, with inter-project dependencies, I find it useful to close all but the current project on which I'm working. Then the "Problems" view is specific to the current context.
Finally, I'd recommend looking at the Mylin "getting started" page for other hints on how Eclipse can help you focus on the current task.