Eclipse IDE/Fixing Issues with SVN and Subclipse

From RHLUG Wiki
Revision as of 21:17, 23 January 2018 by AlphaCubed (talk | contribs) (Add tutorial page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

List of issues

Subclipse crashes upon loading Rose-Hulman/authenticated SVN repositories

This tutorial assumes you have Eclipse, Subclipse and svn (usually called subversion depending on Linux distribution) installed as a package on your Linux computer.

In Eclipse, sometimes the Subclipse plugin causes issues. Currently, the Subversive plugin is not working in Oxygen, so you will want to use Subclipse since it has been updated and is the only SVN plugin that currently works in Oxygen.

The JavaHL libraries work fine on Windows, but on Linux, connecting to an authenticated repository (one with a username/password) crashes when loading the directories. This is an issue with the JavaHL library, not SVN or the Subclipse plugin itself.

The error, for reference, is:

While loading class "org.tigris.subversion.subclipse.ui.dialogs.UnsupportedPasswordStoresDialog", thread "Thread[main,6,main]" timed out waiting (5000ms) for thread "Thread[Worker-3,5,main]" to finish starting bundle "org.tigris.subversion.subclipse.ui_4.2.3.201707071932 [527]". To avoid deadlock, thread "Thread[main,6,main]" is proceeding but "org.tigris.subversion.subclipse.ui.dialogs.UnsupportedPasswordStoresDialog" may not be fully initialized.

Method 1 (using Eclipse Preferences)

Go to Eclipse and open your workspace. Click on Window > Preferences. Go to Team > SVN.

In SVN Interface > Client, change Client from JavaHL (JNI) to SVNKit (Pure Java).

Now try re-authenticating in your SVN repository. When you see "Enter Username and Password", do not have Eclipse remember the password! It will cause issues when checking out. The issue is with Eclipse's password manager communicating with the Subclipse plugin. (see the error above for some information).

You will have to enter your password on each rerun of Eclipse. It's annoying but it works reliably.

If checking out causes issues, try selecting a specific revision number in the Checkout dialog. (Click on Revision > Select... and click the most recent number (don't worry about the stars that appear next to them). Click OK then in the Checkout dialog, click "Finish".

Source: https://stackoverflow.com/questions/9303293/subclipse-and-javahl-installation-headache

Method 2 (using the command line)

Open a terminal. Move to the Documents directory using cd ~/Documents/

Checkout the subversion repository you want using svn checkout http://svn.csse.rose-hulman.edu/repos/(whatever location your svn repo is located at) (note the use of http:// in the command)

Type in your username and password and a new folder should be in your documents directory. Check using the command ls.

Then go open Eclipse and open your workspace.

Go to File > Import and go to General > Existing Projects into Workspace. In "Select Root Directory", choose the Documents directory where you checked out using SVN. The IDE will search for valid folders with Java files in them. A checked box should show up with the folder you checked out. Uncheck all other folders.

Click Next and open your folder. Note that the SVN commit indicators are inaccurate (the star meaning changed files and the yellow cylinder meaning up-to-date)! You will need to use the terminal to commit your files to SVN also. To refresh the SVN status in Eclipse, commit your work in the terminal then reopen the IDE. The files in the .svn folder in your folder you checked out (located in your workspace should be changed (which is how Eclipse reads them.) The Subclipse plugin does this automatically.

To commit your work, first add all new files from your local directory so they can be marked as versioned/committed (SVN/general VCS or version control system behavior). cd to your workspace directory and then your project's directory (with specific Java files in it). Then type:

svn add --force * --auto-props --parents --depth infinity -q

Source: https://stackoverflow.com/questions/1071857/how-do-i-svn-add-all-unversioned-files-to-svn

Finally, to commit, type:

svn commit -m 'your commit message, eg added a feature'

And you're done.