Windows上的SVN Java绑定(JavaHL)配对JAR和本机库二进制文件? [英] Paired JAR and native library binaries for SVN Java bindings (JavaHL) on Windows?

查看:162
本文介绍了Windows上的SVN Java绑定(JavaHL)配对JAR和本机库二进制文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一些直接使用Subversion(SVN)Java绑定(JavaHL)的代码(其中JavaHL包含本机库和瘦Java包装器)。在Linux(Ubuntu 12.04)上这没问题:package libsvn-java 安装本机库和 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ svn-javahl.jar ,所以我只是引用了后者而我离开了。

I'm writing some code that uses the Subversion (SVN) Java bindings (JavaHL) directly (where JavaHL comprises native libraries and a thin Java wrapper). On Linux (Ubuntu 12.04) this is no problem: package libsvn-java installs the native libraries and \usr\share\java\svn-javahl.jar, so i just reference the latter and away I go.

在Windows上,我知道没有这样的干净包装这对(JAR +本地库)在一起。我知道SlikSVN包含一个JavaHL实现,但安装它似乎只是安装本机库(它确实放在PATH上)。是否有任何东西可以提供两者的清洁包装? (如果SlikSVN 打包JAR,那我就没想到了,搜索整个驱动​​器什么也找不到......)

On Windows, I know of no such clean packaging of the pair (JAR + native libraries) together. I was aware that SlikSVN contains a JavaHL implementation, but installing that seems only to install the native libraries (which it does put on the PATH). Is there anything that gives a clean package of the two? (If SlikSVN does package the JAR, it's in no place I expect, and a search of the whole drive finds nothing...)

作为一种解决方法,我手动构建了JAR文件(下面的详细信息可能对人们有用)。但似乎Java包装器和本机库的匹配非常精确:当我从后来的SVN源代码(而不是匹配我的确切SlikSVN SVN版本)构建JAR作为测试时,我在本机中遇到致命错误代码(EXCEPTION_ACCESS_VIOLATION)。也许我不走运但是,如果它非常敏感,我需要为用户可能安装的每个潜在版本的SlikSVN(以及SVN)提供一个JAR库(或限制他们的SlikSVN选择,或者有一些倾向于 - 错误自动构建过程,需要他们安装JDK)。所有不好的选择: - (

As a workaround, I built the JAR file manually (details below which may be useful for people). But it seems that the 'match' of Java wrapper and native libraries is very precise: when I built a JAR from later SVN source code (instead of that matching my exact SlikSVN SVN version) as a test, I got fatal errors in the native code (EXCEPTION_ACCESS_VIOLATION). Perhaps I was unlucky but, if it is pretty sensitive, I'll need to provide a JAR library for every potential version of SlikSVN (and thus SVN) that users might install (or restrict their SlikSVN choices, or have some prone-to-error auto-build process which would need them to install a JDK). All bad options :-(

我有SlikSVN 1.8.10: svn --version 报告版本 1.8.10-SlikSvn-1.8.10-X64

I had SlikSVN 1.8.10: svn --version reports version 1.8.10-SlikSvn-1.8.10-X64.

所以我从标记的SVN版本中获得了Java包装器源代码。(您也可以从
主站点的源下载。)

So I got the Java wrapper source from the tagged SVN release. (You can also get it from the main site's source downloads.)

svn export http://svn.apache.org/repos/asf/subversion/tags/1.8.10/subversion/bindings/javahl/src

将此(没有依赖项)编译到JAR中,并使用它,与SlikSVN本机库一起正常工作。

Compiling this (there are no dependencies) into a JAR, and using that, worked fine with the SlikSVN native libraries.

PS我知道我可以使用SVNKit来避免要做到这一点,但我正是这样做,因为依赖SVNKit出于许可的原因(加上JavaHL API无论如何都很好而且相当高级别,还有其他理由更喜欢使用'官方'原生JavaHL实施ntation)。

P.S. I know that I could use SVNKit to avoid having to do this, but I'm doing this precisely so as not to rely on SVNKit for licensing reasons (plus the JavaHL API is fine and reasonably high-level anyway, and there are other reasons to prefer using the 'official' native JavaHL implementation).

推荐答案

WANdisco二进制文件中应包含JavaHL。

The WANdisco binaries should have JavaHL in them.

http://www.wandisco.com/subversion/download

自从我自己使用它们以来已经有一段时间了(通常不使用Windows)。但是WANdisco有依赖JavaHL的工具,所以我无法想象Windows二进制文件缺少JavaHL。

Been a while since I used them myself (don't typically use Windows). But WANdisco has tools that depend on JavaHL so I can't imagine the Windows binaries are missing JavaHL.

[问题作者编辑以完成详细信息]

您需要安装(Windows)Subversion客户端( SmartSVN),并确保选中该框以将其添加到Windows PATH 。这将'配对'JAR存储在安装目录中(以及本机库)。 ,WANDisco仅提供32位安装(请参阅论坛帖子)所以这不适用于64位Windows。此外,JAR仅包含API的Apache版本,这些版本是为Subversion 1.7添加的。如果您使用旧版 org.tigris.subversion.javahl 软件包API与1.7之前的SVN客户端兼容,则仍需要手动构建JAR。

You need to install the (Windows) Subversion client (not SmartSVN), and make sure you check the box to add it to the Windows PATH. This stores the 'paired' JAR in the install directory (along with the native libraries). However, WANDisco only provide a 32-bit install (see this forum post) so this won't work on 64-bit Windows. In addition, the JAR only includes the Apache versions of the API, which were added for Subversion 1.7. If you're using the legacy org.tigris.subversion.javahl package API for compatibility with pre-1.7 SVN clients, you still need to build the JAR manually.

这篇关于Windows上的SVN Java绑定(JavaHL)配对JAR和本机库二进制文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆