NetBeans, Subversion, and remote ssh server
By marina on Mar 15, 2010
Here are a few tips on using Subversion with NetBeans. In my case the Subversion was setup on a system that with ssh tunnel, so we'll go over authentication settings as well. My development environment is Mac OS X 10.5.8 with NetBeans 6.8. The remote system is running Solaris 10 x64.
1. We'll start with SSH related details to enable permission to the ssh server. First, let's create a PKI key-pair and then upload the public key to
the remote svn server. You can follow this instructions, and here is the output on Mac:
marina1s-macbook-pro-2:~ userx$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/userx/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/userx/.ssh/id_rsa.
Your public key has been saved in /Users/userx/.ssh/id_rsa.pub.
The key fingerprint is:
The key's randomart image is:
2. Now copy the public key of the generated pair to the remote location:
scp .ssh/id_rsa.pub user@server:
You can check the success of this operation by validating the files on the remote system.
3. In the NetBeans, select your project and in the right-mouse-click
drop down menu select Versioning → Subversion. You will then be
prompted to enter details of the Subverion repository URL, i.e. svn+ssh url, and the account info for the SSH tunnel. Enter the corresponding values such as:
ssh -l svnuser -i /Users/userx/.ssh/id_rsa
4. Locale Error
After passing credentials, and submitting the Next button you may run into this error. With NetBeans IDE, there is a limitation (or a bug) that relates to the Subversion Locale error:
cannot set LC_CTYPE locale
environment variable LANG is en_US.UTF-8
please check that your locale name is correct
After I tried a few workarounds mentioned online and the error message still persisted, I manually installed the latest version of Subversion 1.6 from here and changed the PATH as the default location of the Subversion library is under /usr/bin. You can change the PATH within the NetBeans IDE by navigating to NetBeans -> Preferences (Options for other OSs), selecting Miscellaneous, and Versioning.
You may also check Manage Connection Settings that should capture your url and account settings that you specified in the previous step.
5. Now you should be able to proceed with importing, checking in and out your source code. You can find more details on using Subversion with NetBeeans from this article. It's important to note that you cannot create a brand new repository from within the IDE. You need to create the repository on the remote server prior to importing your code.