Headless Eclipse Build returns ERRORLEVEL 13 - java

Everything was going well. Nightly builds ran for more than a month with no problems. However, suddenly when invoking the feature builder from Eclipse the execution ends right away with the message.
ERRORLEVEL 13
As far as I know I haven't changed anything, as this computer is normally not touched. (It is only used for the nightly builds).
I've googled around to see what this error means but to no avail. I found a link from IBM that shows a custom bat file that catches this error, but the explanation given is not very useful.
My guess is that this is related to the workspace, somehow, or that the whole eclipse installation is corrupted.
Do you have any idea what this error means and how can it be corrected?

After reading what the error code means thanks to the answer from VonC I understood where to look. The problem was a lot more obscure that it seems.
I looked into the configuration folder for Eclipse (logs are either written there or in the .metadata folder when something goes wrong), and I found a huge log file. Inside the file I found the following error:
application org.eclipse.sdk not found
and the following exception, followed by a plugin name, several times:
java.util.zip.ZipException: Too many open files
Several plugins could not be loaded, causing a cascade of missing dependencies that prevented Eclipse from launching. I searched the web for this exception and found the following bug description from SUN, which says that Java 1.5.0 can not open more than 2,100 zip files.
The problem started a while after I installed the BABEL project translations for Eclipse into the build computer. These are more than 900 fragments, containing translations for many plugins, one for each language. As I installed it on top of an existing eclipse installation, it seemed that it was not a problem to open them.... until I cleared the workspace for the builds. Then Eclipse wouldn't launch anymore. I went over the limit. It didn't help that the first thing I tried to fix the build was, again.... clearing everything.
Because I only use this computer for headless builds, I didn't realize that the problem was in Eclipse itself and I was looking inside the build process. I only realized when I looked into the log file.
After installing Java 1.6.0_11 I was able to launch Eclipse and go on with my build.

It should mean "ant build failed", meaning the headless ant script fails at some point.
You should check if you can catch the log/output generated by this script to analyze this ant session and see at what point the ant script fails.
If it fails right away, it usually is because of:
a change in rights (writing access), or
in environment variable modifications, or
in resource access (path non accessible).
You also have to check if the computer is still in its original windows domain, and if the rights (admin ?) associated with the account running the ant script are still the same.

Related

IntelliJ strange behavior

I've installed 30 day trial of IntelliJ 15.0.2 and cloned my project using git (I've created this project in community version). Project compiles (maven), runs, works. But new IntelliJ does not underline my errors, misspellings etc. When I wanted to commit, IntelliJ shows big number of errors, mostly on imports, as it can't resolve them. All dependencies are inside pom.xml. Once again, there were no errors in community version of IntelliJ. Ultimate version builds project just fine, but doesn't underline any errors and shows almost every import as unsolvable. What could go wrong? How to fix it?
Go to Build -> Make Project. After that errors should be visible in the project tree and in the specific project files.
You may need to mark the source dir, by right-clicking it on the project tab and select mark directory as -> source root
Check that you have a correct project sdk set in modules configuration. If IJ doesn't found any classes, jdk classes included, probably there is no sdk set.
You can also try to invalidate caches (in File menu) and rebuild project
I have faced with strange behaviour of Intelij Idea after update (syntax highlight stopped working). If you want to understand what is going on with yor Idea and can not quickly find an answer in internet, just go to Log files (for Mac OS the path is
~/Library/Logs/IntelliJIdea< your version>
List all files in that directory
ls -la
in terminal and find the latest one. Usually it should be idea.log (without numbers, logs with numbers identify logs for previous days). View that log. If that log contains a lot of ERRORS, try to find the reason (you can just type
grep "ERROR" idea.log
in terminal to find all lines that contain errors). Usually log files shouldn't contain errors, just info and warnings.
In my case syntax highlight stopped working. The log looked like
You can see here that error is in plugins that called like haxe.
I found that plugin in my idea, uninstalled it and idea started working properly. I investigated the log after and what I have seen there:
You can see just INFO in new rows.
Investigating a log can be really useful if you can not find the rootcase of your problem quickly in the internet. I hope it can help you even if it can be quite tricky.
Good luck!

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.

Eclipse doesn't import java libraries on cold start, plus other compiling errors

Eclipse is giving me a few problems.
After a cold start and the loading of android libs, Eclipse underline the import statements or says that java.lang.Object couldn't be found.
Closing it and reopening often fix the problem. If it doesn't, another close-open fix it definitely. But it shows at each cold-start.
It also gives
"The type java.lang.Enum cannot be resolved. It is indirectly referenced from required .class files"
"The project cannot be build until build path errors are resolved"
But if i restart the build path errors and the enum problem are not show any more(sometimes the enum proble got fixed some time after eclipse's loading finished)
"Project 'xxx' is missing required source folder: 'gen' "
that should be generated automatically generated while building, and still restarting will fix them
In addition, in many projects, while building or cleaning, eclipse says that it couldn't delete the bin/. directory. I noticed that that directory is read-only, and if i try to remove the attribute(even from dos), it immediately return to read-only.
This problems aren't show-stoppers, i still can code and i still can get my apps exported, but it is quite annoying to have to restart eclipse a few times before being able to use it(and eclipse isn't that fast at opening), and i would really know how to fix it.
I searched in the net a bit, but i dind't found nothing useful or that worked.
Is there a way to fix them?
I didn't "unistalled"(it is just stored in a directory) Eclipse, since i should then reinstall android sdk, mercurial plugin, and re download and set up a few libraries i use in quite all my project, and i really hope there is another way.
final notes:
everything works when this problems doesn't show: the app works, logcat too, the right device is used to install the app, so i think java and android sdks are installed just right
I had that problem before so I just saved my projects to a different file and uninstalled everything ( java, android sdk, eclipse ). When I reinstalled it all I put the android sdk on the root of my c drive as I have a windows machine and then instead of picking where java was installed I let it do its own thing. I dont use a mercurial plug in but your "read only" problem could be related to that. Its possible your downloading files that are "read only" and there for you have no way to alter them. Im guessing since you said youve been programing you already know how to set the build paths and stuff. It might just be where everything is installed or something silly like privilege settings on your machine.
What were you using the mercurial plug in for anyway? just curious :)
Have you included the java lib in your project or? For a couple of weeks ago I sat with an project where i absolutly needed some of the methods, so because android just have some of the java lib I imported the need libs and used that.

exception has been caught while processing the refactoring 'Rename package'

This refactoring function in Eclipse for package names used to work for me fine until... today:
This is the first time I am receiving this weird Refactoring error, and I have no idea what to make of it:
An exception has been caught while
processing the refactoring 'Rename
Package'.
Reason: Problems encountered while
moving resources.
Click 'Undo' to undo all successfully
executed changes of the current
refactoring. Click 'Abort' to abort
the current refactoring.
What could possibly explain this sudden "change of heart" and how do I fix it?
Seems from your snapshot that you are running windows 7, maybe vista. If its not a renaming issue, try running eclipse as administrator. It might be permissions-related, but its just a thought.
I see merit behind what Kurru is saying. Windows is not a case-sensitive operating system, meaning that is sees the words Cat and cat as the same thing. When you rename your package, Eclipse creates new directories/folder to put the package in. If you changed the case of your words and not actually rename it, it could throw this error.
Under Windows this is frequently caused by a file or directory being locked. There can be several reasons for this:
A file is open in a viewing program outside of Eclipse. Windows will not allow the open file to be refactored.
A CMD.EXE is active in one of the directories to be refactored. Windows will not allow the directory to be moved or deleted.
A program is running with open files for items in the workspace. Windows will not allow the items to be refactored.
If this is the behaviour of a freshly started Eclipse on a freshly started machine, it is probably not Windows, but a corrupted workspace or Eclipse distribution, and you should unpack a fresh Eclipse and create a new workspace in which you can import (and copy) the existing projects from the old workspace. I don't think this is the problem, though.
If you're just trying to rename a package to the same name, only with a different case, this error is thrown for me. Very annoying when trying to fix package names to the lowercase convention.
Had some success renaming packages to a step folder, then to the target folder...
ie.
APackage -> apackage FAIL
APackage -> APackage2 -> apackage SUCCESS
Got the same error. It turns out that my ClearCase (version control) plugin was inactive. Simply activated the version control plugin, and the problem was solved.
This can be caused if using characters like underscores in your class names (e.g. My_Class.java). The project will build and run fine. But in Eclipse, if you run Android Tools > Rename Application Package, the rename will fail.
Same refactoring problem occurred to me when I was working in the Ubuntu. The cause is the permission limitations. Eclipse cannot re-factor as it does not have permission. After giving root permission, refactoring worked fine for me.
If it is the problem because of case. I have successfully tried a solution.
This will fail
org.xyz.fileName ---rename---> org.xyz.filename
This will pass
org.xyz.fileName ---rename---> org.abc (rename the structure)
org.abc ---rename---> org.xyz.filename
This will work fine!
I just restart the computer and start STS(Spring Tool Suite 4)
and delete the file/class its works for me.
Check if the folder location is open in the Command prompt. If yes, then close it and try again.

MyEclipse is formatting my Java code when I run an Ant build

When I run an Ant build, MyEclipse (happens for v6.0 and 7.5) formats my code. When I open the file it says it was modified on the file system and when I reload it it is formatted.
The thing that is even stranger is that it is not formatted as specified in the Code Style in my Preferences (seems like Java Sun codding rules).
As far as I could determine, there is nothing called by the Ant build to do the formatting so it MyEclipse doing it? Could it be a plugin or something?
Part of the build also includes Maven tasks so could there be a Maven plugin doing this?
I mention that I searched and deactivated all possible options in the preferences of the IDE trying to find some setting but nothing.
It is very annoying so far and could cause problems since I am working on some older projects with minimal modifications in the code and don't want to have a complete messed up version of a class just because I modified a word or something.
Has someone else encountered this?
P.S. It happens only on my PC. My colleagues don't encounter this issue.
Thank you!
EDIT: I have executed some tests:
I executed the Ant script outside of
eclipse (in command prompt) then
opened the files with notepad. The
files are untouched, no formatting
occurred. If I open eclipse nothing
happens to the files.
I opened eclipse and changed the files on the disk using notepad (added some spaces and saved them). Eclipse says the files are changed on the file system and asks to reload them. I say Yes he opens the files. The files are unchanged. No formatting occurs.
I run Ant from eclipse. Eclipse says files have changed and asks to reload them. I say Yes and when the files are opened they are formatted. WTF??!?!!
Is there a config that says to run some tasks after ant builds or something? I could not find anything.
Did you check the "Save actions"?
Preferences" menu, Java > Editor > Save actions.
One of the possible actions is to format your code when you save. You can have these preferences on a global or per project context.
Although it's strange that the code gets changed when you run your Ant script.
Eclipse can format on save if you choose, and you can elect to have it save automatically any modified files before a build. There is nothing in myeclipse that would cause the code to be formatted on load. I would look through your plugins.
Jalopy has an ANT plugin that will format code

Categories

Resources