Project lost when pushing to github from Eclipse - java

I have a Java project I was working on using Eclipse.
Eveything was fine until I decided to push it to a github repository.
I did all the steps and then an error message popped up saying Problem occured when pushing to upstream or something like that.
I went back to check out the project and it was not accessible from the Package Explorer anymore.
I went to the workspace folder and the project was gone and nothing in the trash bin either.
I also checked the github repo and it is still empty.
Is there anyway to get my project back ? It would really suck to do everything all over again.

You can restore deleted resources from local history, according to eclipse official site:
http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-87b.htm

Related

Access denied to java executable on target file while building project with IntelliJ

I have a multi-module project on IntelliJ Idea (version 2021.1.3).
If I try to compile my module using command line (e.g. mvn clean install), the compilation goes fine.
However, if I try to Build the project via IntelliJ (which is a preliminary action to debug a unit test, with the IDE configured the same way than the command line - meaning same JDK, same Maven home, same Maven settings and local repository), then I get the following error coming from the O.S. (I guess that because the message I receive is in French, which is the language of my O.S.):
(Sorry I'm obscuring paths for privacy reasons, but I guarantee you is not relevant).
And the console error is:
java: D:\<path>\target\classes\<path>\rest-services.json (Accès refusé)
Where "accès refusé" is French for Access denied.
Note: unfortunately I cannot really include any debugging issue neither to provide a way to make the issue reproducible on someone else's side. The only purpose of this question is to find (if it exists) THE answer from someone who went across the same issue and found a way to solve it, so that when in the future someone looks for the same keyword - me included if I have this same problem in one year and will have by then forgot what I did to workaround it - will find a specific answer that can spare them 3 hours walking in the darkness.
So, this file gets copied from src/main/resources folder inside target over the build, but then the build itself tries to access it and apparently IntelliJ gets access refused by that.
The attempts I did based on similar threads I found around:
I updated my IntelliJ Idea to the latest release
I removed the file manually from the folder and relaunched the build (the file gets copied again and then access denied again)
I completely cleaned and re-build by project with Maven before trying again
I have run IntelliJ Idea with admin rights
I have File / Invalidate Caches / Invalidate Caches and Restart multiple times on IntelliJ
I have restarted my laptop
I have checked with Windows Process Explorer and the file is not locked by anyone
I have deleted and rebuilt the test configurations of IntelliJ
None of the above worked.
Finally, I ended up being able to make it work by checking-out the guilty file in the source code into my VCS, so that the read-only flag was cleared and the O.S. ended up giving IntelliJ the right to read it.
But this is not a "solution", just a workaround, and it may happen the same with a file on which I have no ability to do so (for example a self-generated file) - plus it's strange, there are many files with read-only flag being copied from source to target (including into the same folder where I had this issue), but yet this was the only file which was causing the problem.
Does anyone ever crossed such issue and if so, how did you solve it?

Eclipse (Oxygen) Stops Responding When Accessing EGit?

I can't seem to access eGit or use any related features in Eclipse Oxygen.
I have tried everything, and even wiped the meta, pool, and eclipse information to a complete re-install but still end up with the same issue.
For your information, I have 2 versions of Eclipse installed, Java and Java EE (if that might be a problem). I also have GitHub for Windows installed.
Some symptoms (i.e. when Eclipse stops responding):
Opening eGit perspective (it is possible if I don't have any projects in explorer, and open it from start after deleting metadata folder). Then it works until I open git projects.
Importing git & eclipse projects. Auto share git projects does not complete (or takes a long time - I stop it after 5-10 minutes).
Importing git project as Git Project (from import screen).
Importing git project from eGit perspective.
Edit: Additional symptoms:
Clone external git repository.
Load got project without git autoshare, and share project...then no response.
Accessing Team->Git->Configuration in Preferences.
Attempt to share new project.
Edit: I have now discovered (after installing previous Eclipse Neon version) that EGit still fails to work. Which may mean there is something deeper wrong with my setup/system. I hope I don't have to reinstall Windows on my system with a clean wipe. :(
I have tried just about everything. Any suggestions are greatly appreciated.
EDIT: As suggested, here is another fix to a similar (or same?) issue:
Eclipse not respond when try to configure GIT
As I was working on my project, an exclamation point popped up. Attempting to resolve this issue, I came across this solution from here:
Right click on your project -> Close Project. it will Close your project and all opened file(s) of the project
Right click on your project -> Open Project. it will Open your project and rebuild your project, Hopefully it will fix red exclamation mark
This not only fixed my project, but finally granted me access to eGit features in Eclipse.

Cannot convert project... Premature end of file error in Intellij IDE

I am using Intellij IDEA as an IDE for running Java programs. Dues to power fluctuation computer got restarted. Now when I launch the IDE after reboot i am getting the error Cannot convert project: /home/aniket/IdeaProjects/JavaDemoCodes/.idea/workspace.xml: Error on line -1: Premature end of file.
Has anyone encountered this situation before? What can I do to view my project back again?
I also had this after a power failure, I simply deleted the workspace.xml file from the projects .idea folder, restarted IntelliJ and it seemed to be OK apart from loosing which files were open.
Cheers,
Nick
I had this exact error when my laptop bluescreened. I solved it by:
Exit IntelliJ IDEA
Rename .idea folder
Start IntelliJ IDEA
Create new project from existing sources
Exit IntelliJ IDEA
Copy all files from old .idea folder to newly created one.
Restart IntelliJ IDEA
Finally solved the problem. Hers is the solution. First of all I had two Intellij IDEA projects open in two separate windows.
One was the project which had corresponding subversion repository. This was a file-based format project. Files that define a project are .iws, .ipr and .iml. .iws is the one corresponding to the workspace configuration. I just reverted back this file with svn revert project.iws and I could launch my project again.
But the problem in second project JavaDemoCodes still persisted as it was custom project I created and it looks by default we get a directory-based format project instead of file-based format project. This has all its configurations in /home/aniket/.IdeaIC12 directory. As many of you suggested i searched for workspace.xml here but could not find it. I tried find . -name *.xml but i still could not find it(Also as the error suggests there is no file /home/aniket/IdeaProjects/JavaDemoCodes/.idea/workspace.xml ).Finally I did import project from my first project(the one with svn repo) it detected my JavaDemoCodes project as Intellij IDEA project and let me open it in new window.
Not sure if this is the perfect answer but it solved my problem and yes as someone suggested I deleted .iws file from my 1st svn repo based project and tried to restart but was of no help. New .iws file was created but it still gave me the same error.
I have experienced this same problem. It happens to me when I have IntelliJ open and for whatever reason (usually problems with having multiple VPN connections open), my computer freezes and I have to do a forced re-boot.
My solution is to use Windows 7 restore. I'll go to the folder it is complaining about, right click on it, and do a restore. If I'm lucky, I have a restore point only a few days old.
For me, rebuilding my configuration on several projects from scratch is too time consuming. Using a restore point from a few days or even a week makes more sense.
Good luck.
I solved it just by creating a new project, then starting it and then reopening the old project..

How to properly delete Java packages under SVN control?

I hava a Java project and am using Eclipse (Indigo) with the Subversive SVN plugin. I have successfully setup a remote SVN server that I'm using for the project repo.
I recently decided that I no longer needed a package that had a few unused classes in it. So I did the following:
I deleted the package and all of its contents from inside Package Explorer
I then right-clicked my project's root directory, and went to Team >> Synchronize with Repository
I found the newly-deleted package showing up in the list of changes under the Synchronize SVN panel, right-clicked the package, and select "Commit". My thinking here was, "I've deleted the package locally, now I want to commit those deletion-changes to the server."
The changes were not committed, I got an error message (which I failed to look at...) and now this is what I see back in Package Explorer (the net.appuzi.domain.loads.http package is the one I deleted):
Now, if I go back into Team >> Synchronize with Repository, I see the package like so:
If I select both Java sources and try to "Override and Commit" them, I get the following error:
Some of selected resources were not committed.
svn: Commit failed (details follow):
svn: '/<path-to-my-project>/MyProject/src/main/java/net/appuzi/domain/loads/http/HttpMethod.java' is not under version control
So my immediate question is: how to "synch" my local working copy and the repo so that this deleted package no longer exists in either one (on the server-side I'm committing to trunk/).
Besides that immediate problem, which is my current blocker, I guess the next logical question is: what are the proper procedures for deleting packages that are under version control in SVN.?" Thanks in advance!
Try making sure that your local files are the same as the remote files before trying to delete. That way the only change being detected is the deletion of the entire files, and Eclipse won't get confused about conflicts. Just update or revert as necessary and then try deleting again.
Try this:
delete the packages.
right click on your project inside the project explorer.
go to "Team" and click on "Update to HEAD.
again go to "Team" and click on "commit...".
Good Luck
I had similar issue earlier, all I did was committing parent folder. In you case "src". Get those files back and delete them again, and this time commit the parent folder.
Hope this helps.
Just delete the folder using Svn repository exploring, then update the project.
I had a similar issue where the package got deleted from the SVN repository but still showed up in the Synchronize View in Eclipse. I have the subversion plugin installed in my Eclipse. To resolve my issue, I disconnected the project from SVN (Right Click on Project --> Team --> Disconnect...) while opting to check the option "Also delete the SVN meta information from the file system."
Once disconnected, I reconnect the project to SVN, synchronized with the repository once more and the deleted package/files were no longer visible in the Synchronize view.

Eclipse My project no longer shows up under Package Explore

I have a project called card server2. It disappeared from my package Explore and I can no longer work on it. The files are still there. I try to use import to get it back. But there was a message saying project already existed in workspace.
his happen after I imported a project called chat server, which is working fine.
I was thinking about creating a new workspace and importing the project into this, but then I would have one work space with all my projects and one for just that project.
any ideas would be great!
You can reimport your project after moving it to another location ;)
Cut and paste the project from your workspace to another location and import it back. It should work fine.
navigate to window-show view-others-java-project explorer. if it already open close it and re-open it and you will find it .Hope that help.

Categories