个人工具

EclipseSubversion

来自Ubuntu中文

跳转至: 导航, 搜索

UbuntuChinaTemplate


原文出处:https://help.ubuntu.com/community/EclipseSubversion

原文作者:UbuntuWiki

授权许可:

翻译人员:nkzealot MillenniumDark

校对人员:MillenniumDark

贡献者:

适用版本: 文章状态:完成


See : SubVersion

See : EclipseIDE

参考:SubVersion

参考:EclipseIDE

Subversion support

Subversion支持

First of all, install the subversion package (see InstallingSoftware)

首先,安装subversion程序包(参看InstallingSoftware

Subclipse (TOFIX)

Subclipse is an Subversion client, working like the integrated CVS client. See the official sublipse home page for up to date informations.

  • In Eclipse, go into the menus : Help -> Software Updates -> Find and Install...
  • Search for new features to install
  • Add a new Remote Site with URL: http://subclipse.tigris.org/update
  • Next, next, next
  • Restart Eclipse

Now Subclipse needs a subversion java binding, named javahl, that is not installed with the subversion package.

Subclipse是一个可以像整合了的CVS客户端一样工作的Subversion客户端。参考sublipse的官方主页可以得到最新的信息。

  • 在Eclipse中,选择如下菜单:Help -> Software Updates -> Find and Install...
  • 寻找并安装新特征
  • 添加一个新的远程URL:http://subclipse.tigris.org/update
  • 一直点三次“继续”
  • 重新启动Eclipse

现在Subclipse需要一个叫做javahl的subversion的java 榜定, named javahl。它并不在subversion的安装包中。

libsvn-javahl for Ubuntu

适用Ubuntu的libsvn-javahl

I followed the instructions on this site to compile my own libsvn-javahl (which is available at http://schuerrer.org/uploads/libsvn-javahl_1.1.1-2ubuntu3_i386.deb) and afterwards only had to make a symbolic link from /usr/lib/libsvnjavahl-1.so to /usr/lib/j2sdk1.5-sun/jre/lib/i386/client/libsvnjavahl-1.so. Then I replaced /opt/eclipse/plugins/org.tigris.subversion.subclipse.core_0.9.31/svnjavahl.jar with /usr/share/java/svn-javahl.jar and I'm still getting a JFace error. Maybe Subclipse 0.9.31 doesn't work witch Eclipse 3.1M7?

我按照如下网址的说明来编译我自己的libsvn-javahl (你可以在这里找到 http://schuerrer.org/uploads/libsvn-javahl_1.1.1-2ubuntu3_i386.deb ),随后只需要建立一个从/usr/lib/libsvnjavahl-1.so到/usr/lib/j2sdk1.5-sun/jre/lib/i386/client/libsvnjavahl-1.so的符号链接。接着我把/opt/eclipse/plugins/org.tigris.subversion.subclipse.core_0.9.31/svnjavahl.jar替换成 /usr/share/java/svn-javahl.jar,但是我还是得到了一个JFace错误。会不会是Subclipse 0.9.31不能与 Eclipse 3.1M7一同工作?

Subversion and Javahl

Subversion同Javahl

Javahl is the subversion <-> java library.

This installation method doesn't work, but here is my output. I hope somebody will be able to complete it and make it work.

I tried to follow the first part of this Howto install SvnUp, but javac doesn't find the sources. I have Java 1.5 installed. Anyone ?

  • Go in your build directory, I use ~/builds
  • download subversion sources : apt-get source subversion
  • extract the sources : tar xzf subversion_1.0.9.orig.tar.gz
  • go in the folder and extract again : tar zxvf subversion_1.0.9.tar.gz
  • go in the folder and run : ./autogen.sh
  • run : ./configure --prefix=/usr
  • run : make
  • go in subfolder : subversion/bindings/java/javahl
  • run again : ./autogen.sh
  • run (not sure if it's right) : ./configure --prefix=/usr --with-jdk=/usr/lib/j2sdk1.5-sun
  • run : make

This is where it doesn't work, here is the output :

Javahl是subversion <-> java库文件

这个安装方法不成功,这里有我的结果。我希望有人能够完成它,使之能够正常工作。

我试图按照这个Howto install SvnUp的第一部分来安装,但是javac报告说找不到源文件。我已经安装了Java 1.5。有人知道为什么吗?

  • 进入你的build文件夹,我使用 ~/builds
  • 下载subversion源文件:apt-get source subversion
  • 把源文件解压缩:tar xzf subversion_1.0.9.orig.tar.gz
  • 进入解压缩后的文件夹并且再次解压缩:tar zxvf subversion_1.0.9.tar.gz
  • 进入得到的文件夹并且运行:./autogen.sh
  • 运行: ./configure --prefix=/usr
  • 运行: make
  • 进入子目录:subversion/bindings/java/javahl
  • 再次运行: ./autogen.sh
  • 运行(不能确定正确与否): ./configure --prefix=/usr --with-jdk=/usr/lib/j2sdk1.5-sun
  • 运行: make

到这里就不正常了,输出在这里:

Making all in src
make[1]: Entering directory `/home/zimba/builds/subversion-1.0.9/subversion-1.0.9/subversion/bindings/java/javahl/src'
CLASSPATH=../cls:./../cls:$CLASSPATH /usr/lib/j2sdk1.5-sun/bin/javac -d ../cls
javac: no source files
Usage: javac <options> <source files>
where possible options include:
-g                         Generate all debugging info
-g:none                    Generate no debugging info
-g:{lines,vars,source}     Generate only some debugging info
-nowarn                    Generate no warnings
-verbose                   Output messages about what the compiler is doing
-deprecation               Output source locations where deprecated APIs are used
-classpath <path>          Specify where to find user class files
-cp <path>                 Specify where to find user class files
-sourcepath <path>         Specify where to find input source files
-bootclasspath <path>      Override location of bootstrap class files
-extdirs <dirs>            Override location of installed extensions
-endorseddirs <dirs>       Override location of endorsed standards path
-d <directory>             Specify where to place generated class files
-encoding <encoding>       Specify character encoding used by source files
-source <release>          Provide source compatibility with specified release
-target <release>          Generate class files for specific VM version
-version                   Version information
-help                      Print a synopsis of standard options
-X                         Print a synopsis of nonstandard options
-J<flag>                   Pass <flag> directly to the runtime system

make[1]: *** [class.stamp] Error 2
make[1]: Leaving directory `/home/zimba/builds/subversion-1.0.9/subversion-1.0.9/subversion/bindings/java/javahl/src'
make: *** [all-recursive] Error 1

How I did it

我怎么解决它的

Okay, this is NOT Ubuntu Linux (I'm using debian unstable) so forgive me if this doesn't work for you. Here are the steps I used:

  • Go into your build directory.
  • apt-get build-dep subversion get the packages you need to build subversion
  • apt-get source subversion get the sources
  • cd subversion-1.0.9/ cd into the directory (apt-get should have created this for you)
  • dpkg-buildpackage build the package... this takes a LONG TIME, since they have so many tests to verify the build worked correctly
  • cd build-tree/subversion-1.0.9/subversion/bindings/java/javahl This is where the javahl bindings are
  • ./autogen.sh I used automake-1.8! apt-get that if you want your build to be as close to mine as possible!
  • ./configure --prefix=/usr/local/svnjavahl --with-jdk=/usr/lib/j2sdk1.5-sun You can obviously specify your own prefix and jdk. I specified that one because I don't like locally-installed libraries intermingling with the debian-installed libraries.
  • make Build it.
  • make install Install it.

(Note that I installed it to a non-standard location. If you want to use the library from that location, you need to add /usr/local/svnjavahl/lib to your LD_LIBRARY_PATH environment variable.)

I can confirm that this version works by running a small test program. I can NOT, however, get it to work in eclipse. When I try, I get this error (once for each project that uses subversion):

Unhandled event loop exception
Reason:
ctNative

So, for now I'm just leaving the Subclipse plugin to use the command line. It's slow, but at least it actually does something.

好吧,我用的不是Ubuntu Linux(我用的是Debian的不稳定版),所以如果下面的方法对你没用,请原谅我。下面是我的几个步骤:

  • 进入你的build文件夹。
  • apt-get build-dep subversion

取得你需要用来编译subversion的包

  • apt-get source subversion

获取源文件

  • cd subversion-1.0.9/

进入这个目录(apt-get应该已经为你建立了这个目录)

  • dpkg-buildpackage

编译安装包……这要花很长时间,因为其中有很多的测试用来确保程序能够正常地工作

  • cd build-tree/subversion-1.0.9/subversion/bindings/java/javahl

这是javahl的所在文件夹

  • ./autogen.sh

我使用了automake-1.8!如果你想你的编译结果尽可能地与我的相似的话你可以用apt-get来下载它!

  • ./configure --prefix=/usr/local/svnjavahl --with-jdk=/usr/lib/j2sdk1.5-sun

很显然你可以自己指定你的安装目录和jdk版本。我指定这一个因为我不喜欢本地安装的库文件和debian安装的库搅和在一起。

  • make

编译

  • make install

安装

(注意我把它安装到了一个非常规的地方。如果你想要从这个地方使用库文件,你需要将/usr/local/svnjavahl/lib加入到你的LD_LIBRARY_PATH环境变量。)

通过运行一个小的测试程序,我能够确定这个版本能够很好地运行。但是,我不能,让它和eclipse一起工作。每当我试图这样的时候,我便得到这样的错误(每个使用subversion的project一次):

Unhandled event loop exception Reason: ctNative

所以,现在我仅仅将Subclipse插件用在命令行上。这样确实比较慢,但至少能够用。



If I understand well, the problem you've got is because Subclipse is built against some particular version of javahl and subversion (see http://subclipse.tigris.org/) Current version should work better with subversion 1.1+ Thanks a lot for your help, I hope we'll soon have something working well.

如果我理解得没错的话,你的问题出在因为Subclipse是在某个特定的版本的javahl和subversion的基础上编译的(参考 [1])。现在的版本应该在subversion 1.1+下工作得更好。很感谢你的帮助,我希望很快我们就能让它工作起来。


Hmm, I managed to build a subversion 1.1.1 w/ javahl library (using the packages out of debian 'experimental') but I still got the same problem. Sad. Thanks for the tip on that, though, but it seems like I'm having bigger problems.

嗯,我成功地编译了一个subversion 1.1.1 w/ javahl库(用的是实验版的debian中的包),但我还是得到了一样的问题。真令人伤心。很感谢你的建议,但是,好像我有了更大的问题。

From EmilWilmanski Mon Dec 13 11:29:57 +0000 2004 From: Emil Wilmanski Date: Mon, 13 Dec 2004 11:29:57 +0000 Subject: I done it... Message-ID: <[email protected]>

Big thanx for your article... I need javahl to eclipse plugin... How I do this: We nead new version of subversion (1.1.1 from experimental source) edit subversion-1.1.1/debian/rules line 39 add "--enable-javahl" (to add configure option to confflags, dont forget "\" at the end of prev. line) compile all using dpkg-buildpackage after it cd subversion-1.1.1/build-tree/subversion-1.1.1 make javahl I do this without problems... in subversion-1.1.1/subversion/bindings/java/javahl/native/.lib we have javahl libs :)

很感谢你的文章……我需要eclipse插件的javahl……我怎么做的:我们需要新版本的subversion(版本1.1.1,在实验源中),编辑subversion-1.1.1/debian/rules第39行,添加"--enable-javahl"(如果想要给cofflags加上选项,不要忘了在前一行末加上"\")。用dpkg-buildpackage编译,然后转换目录cd subversion-1.1.1/build-tree/subversion-1.1.1,编译make javahl。我这样做没有得到任何错误信息……在subversion-1.1.1/subversion/bindings/java/javahl/native/.lib,我们有javahl库

From DagSverreSeljebotn Tue Jan 11 08:36:12 +0000 2005 From: Dag Sverre Seljebotn Date: Tue, 11 Jan 2005 08:36:12 +0000 Subject: Native Java Message-ID: <20050111083612+0000@https://www.ubuntulinux.org>

I've had success with the Pure Java Subversion Client - http://tmate.org/svn/

Some small glitches, to import a project through the svn view do: - Right-click, import it. - It will (may?) fail. Go back to svn view, find the rep that was now opened for that project, and reenter login information. - It will now succed, but a manual refresh of the project might be necesarry for any files to appear. Then reopen the project to hide the .svn-folders...

我使用了一个纯粹的Java Subversion客户端,然后成功了 http://tmate.org/svn/

在从svn view中导入project的时候有一些小的毛病:右键,导入,它会(可能会)异常中止。回到svn view,找到对这个project开放的rep,重新键入登陆密码。结果会成功登陆,但是你需要手动刷新才能看见文件。然后再打开project来隐藏.svn系列文件夹……

working subversion with javahl

能与 javahl 一同工作的subversion

From MaciejFreudenheim Sun Mar 13 02:03:35 +0000 2005 From: Maciej Freudenheim Date: Sun, 13 Mar 2005 02:03:35 +0000 Subject: Everything works (using native javahl)! Message-ID: <20050313020335+0000@https://www.ubuntulinux.org>

OK, everything works now perfectly, here is what I did:

好了,现在所有的东西都可以完美地运行了,下面是我怎么做的:

  • apt-get source subversion
  • cd subversion-1.1.1
  • edit debian/rules (f.e.: gedit debian/rules )

编辑debian/rules (例如: gedit debian/rules ) AND change: 在文件的开头,将如下行ENABLE_JAVAHL=no to: 改为:ENABLE_JAVAHL=yes at the beginning of the file.


ALSO search string "with-jdk" which is somewhere below, and make sure it points to your JDK.In my situation, it is: 同样,也要在下面搜索字符串"with-jdk",保证它指向你的JDK。对于我来说,它是:confflags += --enable-javahl --without-jikes --with-jdk=/usr/lib/sun-j2sdk1.5.0

  • sudo dpkg-buildpackage

If it stops complaining about missing dependencies just install them with sudo apt-get install and relaunch dpkg-buildpackage :)It takes long time to finish. 如果它停下来提示,说没有安装某个依赖包,那就这样安装那些包:sudo apt-get install and relaunch dpkg-buildpackage 。这一步会花很多时间。

  • cd debian/libsvn-javahl/usr/
  • sudo cp -a * /usr

I know, it's ugly way, but i haven't time to study how to build proper deb package 我知道这样做不好,但是我没有时间来研究怎么编译deb包比较好。

  • sudo ldconfig
  • launch eclipse with: 运行 $PATH_TO_YOUR_ECLIPSE_DIRECTORY/eclipse -vmargs -Djava.library.path=/usr/lib

It's important to set that java.library.path property to /usr/lib, without it Eclipse wouldn't find libsvnjavahl*.so we just installed into /usr/lib

  • install subversion plugin in Eclipse normally, like described in the beginning of that Wiki page

用正常的方法在Eclipse中安装subversion插件,就同Wiki网页的开始所描述的一样。

  • restart eclipse: everything should work, you should be able to chose javahl in preferences->team->svn :)

重新启动eclipse:所有的东西应该都可以正常工作,你应该可以在preferences->team->svn 。



From JojoPaderes Mon May 9 03:51:33 +0100 2005 From: Jojo Paderes Date: Mon, 09 May 2005 03:51:33 +0100 Subject: Problem compiling Subversion with Javahl Message-ID: <20050509035133+0100@https://www.ubuntulinux.org>

Thanks Maciej for the nice article!

I'm following the steps for compiling Subversion with Javahl support but got stuck at step #4 which is building the Debian package using dpkg-buildpackage command. I encountered an error while building the package using dpkg-buildpackage command:

感谢Maciej好文章!

我正按照步骤编译带有Javahl的Subversion,但是在第4步卡住了。就是用dpkg-buildpackage命令编译Debian包的那一步。我碰到了一个这样的错误提示:

checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking how to run the C++ preprocessor... /lib/cpp
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
make: *** [debian/stamp-configure] Error 1

To solve the error C++ preprocessor "/lib/cpp" fails sanity check while compiling Subversion, you need to download GCC, CPP and G++ by installing the following packages

gcc cpp g++
(see InstallingSoftware).

想要解决编译Subversion时的C++ preprocessor "/lib/cpp" fails sanity check,你需要用apt-get下载安装GCC,CPP和G++ (参见 InstallingSoftware)

From KrzysztofLangner Fri May 13 22:15:43 +0100 2005 From: Krzysztof Langner Date: Fri, 13 May 2005 22:15:43 +0100 Subject: javahl and JavaSVN Message-ID: <[email protected]>

Instead of using javahl It is possible to install JavaSVN from http://tmate.org/svn/. (JavaSVN is a pure java Subversion (SVN) client library). On my computer I have installed:

除了用javahl,从 http://tmate.org/svn/ 安装JavaSVN也是可以的。 (JavaSVN是一个纯粹的Java Subversion (SVN)客户端库文件)。在我的电脑上,我安装了:

    • Unbuntu 5.04
    • JDK 1.5.0_3
    • Eclipse 3.0.2
    • subversion package
    • subclipse plugin
    • JavaSVN plugin

and Subversion works fine for me.

Subversion在我的机器上运行得很好。