Eclipse keeps building workspace - java

I'm using Eclipse Mars 4.5.0 IDE, and developing ColdFusion applications using CFEclipse plugin. Also, I have SVN Subversion and FileSync plugins.
The company, which I work, has a huge repository. I synchronized all files to the my own workspace and when I do any changes in Eclipse it should update my own workspace and development folder in our server.
It works fine, but sometimes, let's say once a week it starts to build workspace automatically. As I said workspace is huge, so it takes forever.
I cannot do any changes while it was building. Actually I can change the codes but I cannot save the file, saving task is just waiting to build workspace. When I cancel the building task, then try to save the code, before saving building workspace start again.
It's really annoying. I cannot do any work, I have to leave my computer at the work, when I came next morning building is done, and I can start to work. I tried everything to get ride of it, none of them worked.
Also project build automatically is unchecked. But when I do chances in the code, I have to build project not the workspace to sync the code to the development. But of course it builds all workspace not just project.
Interesting thing is that it is not happening all the time. Sometime it works fine, sometime not. For example, yesterday, I just copied one folder from one project to another one, and tried to build project, but Eclipse build whole workspace. I don't know what to do?
EDIT: Screenshot is added.

Have you tried unchecking build automatically in
Window/preferences/general/workspace?
EDIT:
similar question has been asked before on SO.
The answer was (as far as I can understand) to make jar-s out of projects that you use but don't want to compile them every time.

Make sure you have unchecked the option Build Automatically under the Project menu.

Related

IntelliJ only compiles files once

IntelliJ (Ultimate 2018.1) is not building my project properly. The project is using Maven which doesn't seem to have any problems (all libs are there). The problem is as follows:
Everytime I start up IntelliJ, I am able to build all changes exactly one time. I can change contents of my files and those changes will be contained in the build. But every change I do after that first build is ignored by the build tool. So, every time I build the project (ctrl+f9) after that, I get "All files are up-to-date" and nothing is compiled. (If I am running the app on the application server and try a hot swap, the build says "loaded classes are up to date ...")
Only a restart of the IDE lets me rebuild the project.
Edit: As I just found out, a restart of the IDE is not the only possibility to make a build possible again. In the state of not being able to compile, I changed a setting in the compiler settings. After that, I was able to build again. But only once. I then changed the setting back and well, I could build again. Looks like something odd in the IDE. /Edit
Edit2: Oddly enough, the explicit compiling of the class (ctrl+shift+f9) is working. So the problem circles around the compiling of the whole project. While this is making IntelliJ usable again, it's error prone regarding multiple changed files... /Edit2
A few notes and configurations of the project:
The build produces a .war
It is deployed on a wildfly (which is not started once in this cycle, so this shouldn't be the root of the problem)
The exact same project was formerly developed in Eclipse where building and Hot-Swap worked flawlessly (and still do when I try Eclipse again)
Maven Config:
Compiler config:
Check with Intellij version. As I am using 1.4 community edition and for me its running proper.
Even I have updated few dependencies after building First Time and it get's rebuild automatically.
So for my understanding what you can do it just check with the Intellij update or change the default directory and rebuild it.
The problem with the "Build Project" command is the source discovery of IntelliJ. A long time ago, we made the choice to place our sources inside a folder named ".git" (not the folder in the repository), so IntelliJ had problems to discover the code inside that directory. The reason for that was an old approach of Eclipse to clone repositories into a .git folder. The directory looked like this:
C:\dev\.git\workspace and inside that folder was another .git folder (from the repository).
So, the answer is:
Don't put your git repository in a folder named ".git" or IntelliJ will not compile it (unless you only compile class wise).

Libgdx Crashes upon execution. No error messages

I create my project using the LibGDX setup tool and import it using eclipses, but when I test the project, without making any modifications, No windows pop up, and the program terminates.
I've tried both importing it as a Gradle and as a project.
I had the project working 1 week ago, but I cannot seem to get the project to run anymore.
Previous versions of LibGDX and Eclipse dont work either
Not sure if this will help you or not:
When you create your libGDX project, create it in folder that is NOT within the workspace folder you wish to use for Eclipse - that can cause quite a lot of unexpected results.
A basic setup as follows has always worked for me, first time, every time:
C:\MyProjects\MyLibGdxProject\libGDX <- Target folder for libGDX (not within Workspace)
C:\MyProjects\MyLibGdxProject\workspace <- Workspace for Eclipse

Changes to my classes in Eclipse are not reflected when I run the project

I recently wiped my disk, but I have numerous backups of all Eclipse-related files. Everything that I need seems to be here, but whenever I make changes to my classes, even after I quit and restart Eclipse, the changes aren't reflected when I run the program. The changes still have been saved in my .java files, but they don't get compiled when I run.
Things I have done:
Project > Clean (numerous times)
Project > Build Automatically is checked
I tried building manually several times to no avail
All my hot code replace options are enabled
Downloaded a fresh copy of Eclipse
Restored my old Eclipse folder from before the wipe
I should be using the same settings as before, back when everything worked, and I haven't changed any operating procedures. The project is a simple game, nothing outside the box. I checked the build path, the only things there are the old class files.
So that's my situation. Thoughts?
Not sure the reasoning behind why it happens, but a quick fix is to copy the class to a separate project, then copy it back. Fixed the issue for me.

Adding 3 projects to version control (SVN) in Eclipse

I'm currently developing an application, and I have worked in the last weeks with the following 3-project setup :
the code itself;
unit tests;
acceptance tests.
Until now, I had only the code itself under version control. I'm researching on how to include all the 3 projects under version control. I'd like to have everything under the same repository. I've created 3 folders(one for each project) under my SVN repo.
In a new workspace, I've imported each one of the projects into Eclipse. This seems, at first, to be working fine, but I'm not sure if I won't get problems later on when trying to make commits to the server and the different projects aren't in the most recent update.
I'd guess this wouldn't be a problem as they don't share any file, at all, but I'm not really sure. Is this the correct approach for the given situation? How would you handle this?
You create a local project in Eclipse, right-click on it, and select Team/Share project...
Then a wizard will guide you, and allow putting the code into the correct folder of the svn server.

Eclipse does not refresh project files in package explorer view

Today I see a strange behaviour of Eclipse 3.5.2 for the first time in 3 months.
First, when I run a main function, it runs a previously compiled version. Let's say I press Ctrl+F11 in the window with an open java class and existing main function. Usually it rebuilds the class and runs a new version. Today even if there was a compile mistake, it would run fine. So I guess it does not recompile the class.
Next, more strangely, if I intentionally make a mistake in the code and Eclipse underlines those lines in red, still the project Explorer does not mark them as containing errors. They remain of grey color if there were not any errors.
First I did not know how to solve this problem. I tried to reopen the project, restart Eclipse and finally reboot the OS. After the tenth attempt, after rebooting, Eclipse said that all project's files are "OUT OF SYNC with the file system". When I pressed "Refresh" - F5 on a project's header name in Project Explorer it finally marked all the files with errors as containing errors and running the main function gave the desired result.
An hour of my work passed and this happened again , with the other project. All the same. No marking of files as red, running no matter what old version of class with no compile errors.
And since Eclipse does not tell that files are out of sync, simply pressing F5 on a project cannot help.
What can you suggest?
When you select a project in the Project Explorer view and press F5, Eclipse should traverse the entire directory tree for the project checking that all files and directories all in sync. It does for me ...
The only thing I can think of that would cause this not to work is if you have file system timestamp anomalies. For example, if a file in the file system is updated but the file's last-modified shows that it was updated in the past. This kind of thing can happen if your machine's system clock is moved backwards or forwards at an inconvenient time. If you think this might have happened, try closing all projects, restarting Eclipse and doing another F5 refresh.
(I used to run into Eclipse synchronization issues a lot, but I put that down to a combination of flakey plugins and doing builds from the command line. Either F5 or Project>Clean usually works for me.)
It is also worth checking that you haven't turned off "Build automatically"; see https://stackoverflow.com/a/2818290/139985. This is not a "refresh" problem, but it would be easy to confuse it with one.
Is Build automatically on? (Menu > Project > Build automatically)
It happened to me because there was a cyclic dependency between two projects. Each project had the other on its build path.
Solution: Reimport the project
It happened to me when checking out a new file from svn in explorer. Eclipse could not find the new file for some reason.
I tried refreshing the project(F5) and Project > Clean and build the project(Project > Build All) none of these worked for me.
So I deleted the project from the Project Explorer view(Not from hard disk). Make sure you unselect "Delete project contents on disk(cannot be undone)" checkbox and save any unsaved changes before you do this.
Now reimport the project using File > Import option. That should work in most cases.
If you use gradle, or something similar, instead of reimporting a project you can just regenerate the project files (gradle eclipse for example), and then you can refresh the project. Less cumbersome than deleting and reimporting.

Categories