Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Locking Jar Files(Eclipse is locking jar files which exist in one of my projects.)
Locking Jar Files [message #502508] Tue, 08 December 2009 15:25 Go to next message
Kyle Pinette is currently offline Kyle PinetteFriend
Messages: 5
Registered: July 2009
Junior Member
Eclipse Version 3.5.1 (Java EE version)
Plugins: Subversive, Groovy Eclipse
OS: Windows 7 (64-bit)

My problem is that I have a references project which contains jar files which are referenced by my other project. What is happening is Eclipse is locking some of the jar files. So, if I do an SVN switch, I get errors about the process being locked by another process. I did not have this problem prior to switching to Windows. I was on Ubuntu 64-bit before I switched. I have done a a few hours of googling / researching, and I've turned up nothing.

Does anyone have any ideas?
Re: Locking Jar Files [message #502519 is a reply to message #502508] Tue, 08 December 2009 16:32 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
Install Process Explorer from SysInternals. With this, you can determine which processes have a particular file open. You can at least verify your suspicions. If you know exactly which process has the file open, you may be able to find a focused solution.

After you've installed it, click the binoculars for the "Find Handle or DLL" operation. Enter a substring of the file name in question, and it will show the processes that have the file open.
Re: Locking Jar Files [message #502570 is a reply to message #502519] Tue, 08 December 2009 20:33 Go to previous messageGo to next message
Kyle Pinette is currently offline Kyle PinetteFriend
Messages: 5
Registered: July 2009
Junior Member
I already did this and Eclipse itself has the files open...
Re: Locking Jar Files [message #502578 is a reply to message #502508] Tue, 08 December 2009 21:19 Go to previous messageGo to next message
Walter Harley is currently offline Walter HarleyFriend
Messages: 847
Registered: July 2009
Senior Member
Kyle Pinette wrote:
> Eclipse Version 3.5.1 (Java EE version)
> Plugins: Subversive, Groovy Eclipse
> OS: Windows 7 (64-bit)
>
> My problem is that I have a references project which contains jar files
> which are referenced by my other project. What is happening is Eclipse
> is locking some of the jar files. So, if I do an SVN switch, I get
> errors about the process being locked by another process. I did not
> have this problem prior to switching to Windows. I was on Ubuntu 64-bit
> before I switched. I have done a a few hours of googling / researching,
> and I've turned up nothing.
>
> Does anyone have any ideas?


What are the files that are being locked?

Generally Eclipse does not lock jar files if all they contain is classes that
are being compiled against. However, if classes or other resources in the jar
are being loaded and used by Eclipse itself - for instance, if the jar file
contains a Java annotation processor, or a JDBC driver or the like - then the
jar file will be locked and there's not typically any way around that.

This is one of the differences between Windows and Linux, and it affects all
applications that load files.
Re: Locking Jar Files [message #502685 is a reply to message #502578] Wed, 09 December 2009 12:27 Go to previous messageGo to next message
Kyle Pinette is currently offline Kyle PinetteFriend
Messages: 5
Registered: July 2009
Junior Member
I understand that windows is really terrible when it comes to locking files. It is strange though because the jars in this project are only used as references for compilation. It is really a pain though, because I end up having to shut down eclipse, delete the project, and then re-pull it from SVN. The project is quite large too (50MB), and because it contains the reference jars, I then have to clean all other projects before they will build.
Re: Locking Jar Files [message #502881 is a reply to message #502685] Thu, 10 December 2009 07:43 Go to previous messageGo to next message
Walter Harley is currently offline Walter HarleyFriend
Messages: 847
Registered: July 2009
Senior Member
Kyle Pinette wrote:
> I understand that windows is really terrible when it comes to locking
> files. It is strange though because the jars in this project are only
> used as references for compilation. It is really a pain though, because
> I end up having to shut down eclipse, delete the project, and then
> re-pull it from SVN. The project is quite large too (50MB), and because
> it contains the reference jars, I then have to clean all other projects
> before they will build.

Definitely sounds painful.

You're sure that the jars only contain classes being compiled against, not
anything that's being executed? Are these third-party jars (that I could find
on the web somewhere) or jars that you build yourself?
Re: Locking Jar Files [message #502908 is a reply to message #502685] Thu, 10 December 2009 09:46 Go to previous messageGo to next message
Steffen Zschaler is currently offline Steffen ZschalerFriend
Messages: 266
Registered: July 2009
Senior Member
Why do you have to delete everything, though? Closing eclipse should
release any locks held by it. If things go really weird, I usually find
that Windows forgets about file locks when I restart it.

Steffen

Kyle Pinette wrote:
> I understand that windows is really terrible when it comes to locking
> files. It is strange though because the jars in this project are only
> used as references for compilation. It is really a pain though,
> because I end up having to shut down eclipse, delete the project, and
> then re-pull it from SVN. The project is quite large too (50MB), and
> because it contains the reference jars, I then have to clean all other
> projects before they will build.
Re: Locking Jar Files [message #503067 is a reply to message #502908] Thu, 10 December 2009 18:32 Go to previous messageGo to next message
Kyle Pinette is currently offline Kyle PinetteFriend
Messages: 5
Registered: July 2009
Junior Member
I have to delete the files because they have been partially switched...

Regardless...restarting eclipse every time I switch between branches is kind of a pain. I am just trying to see if there is a way to fix this problem. I can't believe that every person that uses eclipse on windows has to do this...it's making me want to switch back to linux lol.
Re: Locking Jar Files [message #503113 is a reply to message #503067] Thu, 10 December 2009 22:30 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
I've used Eclipse on Windows for many years, and I've never seen this particular problem. I think if you were to describe your project and what you are doing with it in real detail, instead of the vague descriptions you've given so far, there might be a chance of solving this problem.
Re: Locking Jar Files [message #503118 is a reply to message #503113] Thu, 10 December 2009 22:51 Go to previous messageGo to next message
Walter Harley is currently offline Walter HarleyFriend
Messages: 847
Registered: July 2009
Senior Member
David M. Karr wrote:
> I've used Eclipse on Windows for many years, and I've never seen this
> particular problem. I think if you were to describe your project and
> what you are doing with it in real detail, instead of the vague
> descriptions you've given so far, there might be a chance of solving
> this problem.


Or, describe what you're trying to do with SVN switch. Perhaps there's another
way of doing it. (Keep in mind that folks on this newsgroup, myself included,
may not be very knowledgeable about SVN, so what seems obvious to you is less so
to us...)
Re: Locking Jar Files [message #503154 is a reply to message #503067] Fri, 11 December 2009 08:28 Go to previous messageGo to next message
Mauro Molinari is currently offline Mauro MolinariFriend
Messages: 285
Registered: July 2009
Senior Member
Kyle Pinette ha scritto:
> problem. I can't believe that every person that uses eclipse on windows
> has to do this...it's making me want to switch back to linux lol.

I have been working with Eclipse+CVS under Windows (2000, XP, XP x64)
for many years and I have never encountered such a problem.

Mauro.
Re: Locking Jar Files [message #503274 is a reply to message #503118] Fri, 11 December 2009 16:28 Go to previous messageGo to next message
Kyle Pinette is currently offline Kyle PinetteFriend
Messages: 5
Registered: July 2009
Junior Member
Any sort of operation in SVN that modifies the files in the references project is causing problems. Even doing a merge now throws this error...which is a real problem.
Re: Locking Jar Files [message #1703677 is a reply to message #503274] Tue, 04 August 2015 08:16 Go to previous messageGo to next message
Michael Clavier is currently offline Michael ClavierFriend
Messages: 1
Registered: August 2015
Junior Member
I would like to restart this discussion.
Same problem here but using git instead of svn and basing on Eclipse Mars 4.5.0m Build id: 20150621-1200 on windows.
Quiet a time I thought the problem might come from using MyEclipse - sorry, MyEclipse - but after changing to 'native' eclipse the problem persists.
So whenever another developer changes a self created jar file which has to be rebuild from time to time EGit's 'pull' or 'merge' will fail as the file is locked.

After closing eclipse the repository has to be reset (git reset --hard) and remove the jar files new version, then git pull/merge will work fine.

Anyone having the same problem or better than the problem itself: a solution?

Thank you,

Michael
Re: Locking Jar Files [message #1712904 is a reply to message #1703677] Thu, 29 October 2015 09:24 Go to previous message
Mattias Andersson is currently offline Mattias AnderssonFriend
Messages: 2
Registered: January 2015
Junior Member
Hi Michael,

I see the exact same problem. I posted to Egit/Jgit forum about my problems:

https://www.eclipse.org/forums/index.php?t=msg&th=1071629&goto=1712892&#msg_1712892

Br,
/Mattias


Michael Clavier wrote on Tue, 04 August 2015 08:16
I would like to restart this discussion.
Same problem here but using git instead of svn and basing on Eclipse Mars 4.5.0m Build id: 20150621-1200 on windows.
Quiet a time I thought the problem might come from using MyEclipse - sorry, MyEclipse - but after changing to 'native' eclipse the problem persists.
So whenever another developer changes a self created jar file which has to be rebuild from time to time EGit's 'pull' or 'merge' will fail as the file is locked.

After closing eclipse the repository has to be reset (git reset --hard) and remove the jar files new version, then git pull/merge will work fine.

Anyone having the same problem or better than the problem itself: a solution?

Thank you,

Michael

Previous Topic:How to get Eclipse to run with Java Update
Next Topic:How to use indexes created by org.eclipse.jdt.core.index.JavaIndexer
Goto Forum:
  


Current Time: Thu Apr 25 08:22:47 GMT 2024

Powered by FUDForum. Page generated in 0.04491 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top