Reputation: 181
I have configured my eclipse with EGit as well as JGit. When I try to create a GIT repository using EGit support from eclipse, I was not able to do it. Nothing happens, when I click create Git repository link from the Eclipse.
And I had written java code to create a GIT repository using GIT.open(...) method and ran it. In this case, I have got an error as like below,
java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jgit.util.FS
at org.eclipse.jgit.api.Git.open(Git.java:99)
Upvotes: 0
Views: 1039
Reputation: 181
Finally, it works after a long analysis. NoClassDefFoundError is a specific and might be occurred during the loading of a class to initialize it.
While loading the class org.eclipse.jgit.util.FS, the JRE runtime classpath may not have the reference for it. So initialization of this class gets failed.
The simple solution for this problem is to update the JRE which can resolve the referenced class org.eclipse.jgit.util.FS.
Upvotes: 0
Reputation: 11
1 - create a new repository at GitHub
2 - On the next screen you can see the URLs you may use to access your fresh new repository: click SSH to choose the SSH protocol. It can be used for read and write access.
3 - Open the Eclipse Preferences. Navigate to and expand the Network Connections option and select SSH. Ensure that your SSH2 home is configured correctly (usually this is ~/.ssh) and contains your SSH2 keys if you don't have SSH keys yet you may generate them on the second tab of this dialog (Key Management). Use a good pass phrase to protect your private key, for more details see "working with key passphrases". upload your public SSH key to your GitHub account settings.
4 - Click Team > Remote > Push... and copy and paste the SSH URL of your new GitHub repository. Note: many HTTP proxies are configured to block HTTP URLs containing a user name, since disclosing a user name in an HTTP URL is considered a security risk. In that case remove the user name from the HTTP URL and only provide it in the user field. It will be sent as an HTTP header.
5 - Click Next and on first connection accept GitHub's host key.
6 - Enter your SSH key's passphrase and click OK.
7 - On the next wizard page click Add all branches spec to map your local branch names to the same branch names in the destination repository (on a one-to-one basis).
8 - Click Next. The push confirmation dialog will show a preview of the changes that will be pushed to the destination repository.
9 - Click Finish to confirm that you want to push these changes.
reference: http://wiki.eclipse.org/EGit/User_Guide#Create_Repository_at_GitHub
Upvotes: 1