weird icons beside my java project classes - java

I have opened my project today and I noticed some weird icons beside my classes as in this image :
I don't know what that means !
when I run my application it works great, and I get no exception.
how can I resolve this issue

If you're using a Source Code repository like SVN or CVS (you might have checked out this project out of some code repository) your recent changes must have made your local workspace go out of sync.
By using different colour codes and icons, Netbeans is simply trying to inform you which of these files are in conflict with the repository and need to be merged.
Some of the other icons could simply be informative like that "play" sign on your .java files indicates that the file contains a main() method and can be executed.

You should not be scared at all, the IDE marks the different file types with different icons. Most of the IDEs have similar functionality.

Related

Why cant I see Java project view in VS Code?

So I'm trying to add jar files to a java project.
I've been told the following:
If you want a more beginner-friendly way of adding libraries, you can
also use the Project Manager for Java extension, which is included in
the Java Extension Pack. With it, you can click the + icon on
Referenced Libraries in the JAVA PROJECTS view, as shown in this
example. A quick tip if you need to add many libraries from a folder
is to Shift or Alt + click the + icon, which will let you select an
entire folder containing multiple .jar files.
After installing Project manager extension and creating a new Java project in VS code, I get to this screen.
As mentioned by VS code, I should be able to see the project view tab after creating my java project. The issue is I don't see the project view tab as shown in the image above. VS code says I should see the 3 dots by the explorer subheading to enable it, but again, I don't have these 3 dots as shown in the first image.
I have both project manager and the extension pack installed, so I really don't understand why I cant see or enable project view.
Any suggestions on enabling project view?
Have you tried to open a java file? Because the extension activated depends on the opened filename extension.
You can refer to here.
If it still does not work, could you provide the OS and the versions of the
VSCode and extensions?
I have struggled quite a bit with this and none of the 'obvious' solutions worked.
The way I ended up solving the issue is by creating a new Java Project and looking at the difference in the config of the files.
Especially in the .project file, there were missing entries. Some also in the .settings/*.prefs files
After updating those in my own project, it got detected properly.
As for the 3 dots, here's what I think: different versions may be slightly different, you see, there are no three points in this one enter image description here. So you may update it when you are free.
As for the project view, you may have to open a project before it appears, Steven-MSFT has said it in detail, you can see it first. If you still have questions, you can provide some details again.
Anyway, you can try the following 2 steps:
open a .java file
reboot your vscode

How to ignore packages in netbeans 8

I inherited a big project, of which only a few packages are relevant to my work. I accidentally edited the wrong package today, and to avoid this in the future, would like to exclude them from netbean's project viewer (but not change them on disk).
Looks like there was an ignored folders property in older versions of netbeans (https://blogs.oracle.com/netbeansphp/entry/ignored_folders_sure) but I can't find this anywhere in netbeans8.1. Does it still exist?
Netbeans does not actually let you hide any packages that you have opened as a part of your project. One thing you can do is to select a package you do not want and choose to close it instead. After closing, you can "delete" it from your perspective. A dialogue will pop up and what you DO NOT want to do is also delete project contents on the disk, so be sure to unselect that option. :)

Change IntelliJ code construct symbols

Is there a way to change the icons for symbols suchs the C for classes and the M methods. They're a little hard to distinguish on my laptop. Ideally I'd like to change it throughout the IDE but fine if it's just for the project pane or auto complete.
The icons can't be changed via the UI as far as I know. It is however possible to change them manually. All icons used by IntelliJ are located in $IDEA_HOME/lib/icons.jar, where $IDEA_HOME represents the IntelliJ installation directory.
It might be possible to modify content of this JAR (by unzipping it, changing the icons and creating JAR from it again) and replace the original icons.jar with it. But change such as this will probably be overwritten during IntelliJ upgrade.
One solution would be to package the icons into a plugin. There is a Idea 11 Icon Pack plugin which does exactly the same thing you want. It is a JAR with the same structure as the icons.jar. Except two things:
It has plugin descriptor (META-INF/plugin.xml) in order for the JAR to be registered as plugin
It has implementation class com/bulenkov/idea/Idea11IconPack in order to register the icons I guess
I would use this as an inspiration. You can modify the descriptor so that there are no clashes in plugins, and change all of the old icons for your modified ones. One thing I'm not sure about is the implementation class. You could keep it and it might work. Or you could decompile it to see what it does and create your own version.
You can then install the JAR with the plugin descriptor by clicking Install plugin from disk button in the plugin settings.
Here is also a documentation for plugin development which might be useful.

Sudden weird errors on a project

Today I came to work, happy. But when I opened my Eclipse, I saw that one of my projects has errors.It's weird because it shows that it has errors only in the window bar, and not in the Navigator. I don't have any Java errors, this is a valid project that was fine all the time:
Some of the errors on the error log of Eclipse:
JavaBuilder handling ImageBuilderInternalException while building: SP_Procedure
Cannot connect to VM
File <SomeFile> has been skipped, problem while reading ('Resource is out of sync with the file system')
Unhandled event loop exception
Internal error
When I run an application from this project, I get a warning message but when I proceed, it works fine, but still. It's very disturbing and I'm not sure if it's harmless.
I tried to:
Restart Eclipse
Restart my machine
Clean projects and recompiling them.
Refresh projects
Pray
Nothing helped. What could be the problem? (I'm using Indigo Service Release 2)
The following nuclear option has desperation written all over it. But I have been where the OP has been with the Juno version of Eclipse.
Run a "Synchronize with Repository" and save all of your local updates to a different directory.
Delete the project. (Check the box to delete the contents on disk. Scary step, but that's OK, because you saved it in a different directory in the previous step, right?)
Read in a fresh project from the repository. It builds happily at this point.
Integrate your local updates.
Keep on praying.
Looks that one unused JAR was deleted, but for some reason, I didn't get errors in any file, even in the files that imports this JAR! So what I did was restoring this JAR, delete unused imports and deleted the JAR again.
I've found this error after two days of navigating on this project on each file.. This is weird that Eclipse didn't recognize that1 this is an error, and throw many unrelated errors such as:
Cannot connect to VM
File has been skipped, problem while reading ('Resource is out of sync with the file system')
Unhandled event loop exception
Is this a bug in Eclipse? (All errors and warnings are enabled!)
1 As seen in the image in the question..
A class from the list of imports for the file seems to have moved out or the jar file containing the class is missing.
Expand the imports section and check if you find some classes that are missing but have been imported.
Though it is a pain, sometimes the easiest solution is to back up all your projects (either in a repository or somewhere else on your computer) then uninstall and reinstall eclipse. No it's not fun, but it should reset eclipse so everything works again. The downfall though is that you have to reconfigure eclipse to any special settings you had/reinatall any extra functionality currently installed (eg. android add-on) and reconnect to any repositories you have. While punting isn't fun, it can be effective... I hope you don't have to resort to this though.
I have went through that problem a lot of times, and tried everything you tried. Rebuild, recompile, refresh, remove and add JDK, remove and reinstall Eclipse... nothing worked
The only thing I concluded is that the workspace metadata was corrupted.
What I did (every time it happened) was
Create an empty workspace
Import -> existing projects into worskpace
Mark the "copy projects" (else it will only link them)
Wait for the copy, and start working with the new workspace
If you work with SCM systems (Git, SVN, etc), making a full checkout will do the trick too, but the worskpace import will let you retrieve those changes you didn't get to commit (if any).
It's a little painful if you have somethings already set (like JDK names, servers, etc), but then I realized it was faster than keep searching how to fix the workspace
Regards!
PS : I've been working with Kepler lately, and everything works fine till now
Click Window -> Show View -> Other -> General -> Problems
This view will show you what is wrong.
Did you, by any chance, update your virtual machine outside of Eclipse? I can't help but feel that we're both missing a finer detail here. I just keep seeing "cannot connect to VM" and thinking that it's a major clue.
Have you tried running anything from the terminal? Does it work there?
If so, do you know where your current edition of Java is located? Is Eclipse looking somewhere else?
Is this exclusive to one project? Do you use any additional libraries to the JDK?
Maybe try this for Resource is out of sync with the file system error:
Right click project in Eclipse Package Explorer
Close Project.
Right click project in Eclipse Package Explorer
Open Project.
Other things not mentioned:
project properties > java build path, see if any of those tabs got changed, local file got moved? read/write permissions on some file you are linking to?
project properties > java compiler, see if workplace settings have changed? maybe under errors/warnings, you can systematically set them to 'ignore' until the error goes away to determine what type of error it is?
maybe update some of the eclipse plugins?
I saw something like this happening for a number of reasons. Mainly because of validation in files other Java source code. See if you are validating XML for instance.
Right click your project and chose Properties (Alt+Enter) and Validation to see the related configuration.
As for the danger, I lived with those marks for ages and nothing wrong ever happened.

IntelliJ IDEA 12 duplicate class R.java and BuildConfig.java

I use Eclipse for android development and trying to use IntelliJ. I have successfully run the application once. But now, I couldn't seem to rebuild the example Hello World application. What am I missing here? The R.java is not rebuilding anymore. Here is a screenshot of the errors.
And here is my setting
This happened to me because I've marked source folders incorrectly.
Under project settings once you click on particular module, Just check whether you have Mark any additional folders as source folders.
Check the screenshot, By default it should be something like below, All mark as buttons should be unchecked
By mistake I've checked Mark as: "Source" button and I got this error. Just uncheck it.
R and BuildConfig are autogenerated by the android build system. Maybe you somehow copied an autogenerated version of your eclipse project into the idea project and then idea generated second ones. By default, idea will use a folder called gen for these files which is marked as a source folder. Make sure there are no other source folder containings these files.
You can quickly find classes by pressing Ctrl+N and starting to type the name of the class. If you find duplicate results, delete any of them and let idea regenerate the correct ones.
Unfortunately you may not like my answer, but my project is due yesterday and I don't have time to check every setting to fix the issue.
The way I resolved it is to re-create a new project, only copying the src, res, lib etc across. This was painfully difficult and presents other issues (manifest files and run/debug configs) , but proved relatively short as opposed to creating a new project ANYWAY and sifting through build options that may or may not be valid.
I encountered the problem while trying to add the KSOAP2 libs to the IDEA project, and although KSOAP has nothing to do with the problem, I may have imported them in the incorrect manner the first time and created extra self referential dependancies. This makes the most sense, but trying to figure out how to undo it would be next to impossible.
you can try to delete the r and buildconfig files from the com/x/x folder under android -> java
that fixed it for me.

Categories

Resources