个人工具

“UbuntuHelp:EclipseSubversion”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/EclipseSubversion}}
 
{{From|https://help.ubuntu.com/community/EclipseSubversion}}
 
{{Languages|UbuntuHelp:EclipseSubversion}}
 
{{Languages|UbuntuHelp:EclipseSubversion}}
 +
 +
 +
== Introduction ==
 +
 +
Subclipse is an Eclipse plugin that provides project integration with Subversion repositories.  Using Subclipse you can checkout, browse, and share code from any Subversion repository.
 +
 
See : SubVersion
 
See : SubVersion
  
See : EclipseIDE
+
See : [http://subclipse.tigris.org Official Subclipse Home Page]
 +
 
 +
See : [[UbuntuHelp:EclipseIDE]]
  
 
The [http://wiki.ubuntu.org.cn/EclipseSubversion Chinese translation] of thie article.
 
The [http://wiki.ubuntu.org.cn/EclipseSubversion Chinese translation] of thie article.
第11行: 第19行:
 
First of all, install the <code><nowiki>subversion</nowiki></code> package (see InstallingSoftware)
 
First of all, install the <code><nowiki>subversion</nowiki></code> package (see InstallingSoftware)
  
=== Subclipse (TOFIX) ===
+
== Installing Subclipse ==
  
Subclipse is an Subversion client, working like the integrated CVS client. See the [http://subclipse.tigris.org official subclipse home page] for up to date informations.
+
To install Subclipse:
  
* In Eclipse, go into the menus : Help -> Software Updates -> Find and Install...
+
* Open Eclipse, go into the menus : Help -> Software Updates -> Find and Install...
 
* Search for new features to install
 
* Search for new features to install
 
* Add a new Remote Site with URL: <code><nowiki> http://subclipse.tigris.org/update </nowiki></code>
 
* Add a new Remote Site with URL: <code><nowiki> http://subclipse.tigris.org/update </nowiki></code>
* Next, next, next
+
* Next, next, next selecting ''subclipse'' and accepting the license.  Then click the ''"install all"'' button when ready.
 
* Restart Eclipse
 
* Restart Eclipse
  
Now Subclipse needs a subversion java binding, named javahl, that is not installed with the subversion package.
 
 
=== libsvn-javahl for Ubuntu ===
 
 
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?
 
 
=== Subversion and 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 [http://mywiki.brosch.cc/cgi-bin/myWiki/view/Debian/HowToInstallSvnUp 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 : <code><nowiki> apt-get source subversion </nowiki></code>
 
* extract the sources : <code><nowiki> tar xzf subversion_1.0.9.orig.tar.gz </nowiki></code>
 
* go in the folder and extract again : <code><nowiki> tar zxvf subversion_1.0.9.tar.gz </nowiki></code>
 
* go in the folder and run : <code><nowiki> ./autogen.sh </nowiki></code>
 
* run : <code><nowiki> ./configure --prefix=/usr </nowiki></code>
 
* run : <code><nowiki> make </nowiki></code>
 
 
* go in subfolder : <code><nowiki> subversion/bindings/java/javahl </nowiki></code>
 
* run again : <code><nowiki> ./autogen.sh </nowiki></code>
 
* run (not sure if it's right) : <code><nowiki> ./configure --prefix=/usr --with-jdk=/usr/lib/j2sdk1.5-sun </nowiki></code>
 
* run : <code><nowiki> make </nowiki></code>
 
This is where it doesn't work, here is the output :
 
<pre><nowiki>
 
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
 
</nowiki></pre>
 
 
==== 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.
 
* <code><nowiki> apt-get build-dep subversion </nowiki></code> get the packages you need to build subversion
 
* <code><nowiki> apt-get source subversion </nowiki></code> get the sources
 
* <code><nowiki> cd subversion-1.0.9/ </nowiki></code> cd into the directory (apt-get should have created this for you)
 
* <code><nowiki> dpkg-buildpackage </nowiki></code> build the package...  this takes a LONG TIME, since they have so many tests to verify the build worked correctly
 
* <code><nowiki> cd build-tree/subversion-1.0.9/subversion/bindings/java/javahl </nowiki></code> This is where the javahl bindings are
 
* <code><nowiki> ./autogen.sh </nowiki></code> I used automake-1.8!  apt-get that if you want your build to be as close to mine as possible!
 
* <code><nowiki> ./configure --prefix=/usr/local/svnjavahl --with-jdk=/usr/lib/j2sdk1.5-sun </nowiki></code> 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.
 
* <code><nowiki> make </nowiki></code>  Build it.
 
* <code><nowiki> make install </nowiki></code> 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):
 
<pre><nowiki>Unhandled event loop exception
 
Reason:
 
ctNative</nowiki></pre>
 
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.
 
 
-----
 
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.
 
 
-----
 
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.
 
 
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 :)
 
 
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...
 
 
=== working subversion with javahl ===
 
 
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:
 
 
1. <code><nowiki> apt-get source subversion </nowiki></code>
 
 
2. <code><nowiki> cd subversion-1.1.1 </nowiki></code>
 
 
3. edit debian/rules (f.e.: <code><nowiki> gedit debian/rules </nowiki></code>)
 
 
AND change:
 
<pre><nowiki>
 
ENABLE_JAVAHL=no
 
</nowiki></pre>
 
to:
 
<pre><nowiki>
 
ENABLE_JAVAHL=yes
 
</nowiki></pre>
 
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:
 
<pre><nowiki>
 
confflags += --enable-javahl --without-jikes --with-jdk=/usr/lib/sun-j2sdk1.5.0
 
</nowiki></pre>
 
 
4. <code><nowiki> sudo dpkg-buildpackage </nowiki></code>
 
 
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.
 
 
5. <code><nowiki> cd debian/libsvn-javahl/usr/ </nowiki></code>
 
  
6. <code><nowiki> sudo cp -a * /usr </nowiki></code>
+
=== Configuring a Subversion Repository ===
I know, it's ugly way, but i haven't time to study how to build proper deb package
+
  
7. <code><nowiki> sudo ldconfig </nowiki></code>
+
To configure Subclipse to connect to a repository open the '''SVN Repository Exploring''' perspective:
  
8. launch eclipse with: <code><nowiki> $PATH_TO_YOUR_ECLIPSE_DIRECTORY/eclipse -vmargs -Djava.library.path=/usr/lib </nowiki></code>
+
* Click on Window -> Open Perspective -> Other
 +
* Highlight SVN Repository Exploring -> click Ok
  
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
+
You should now have the '''SVN Repository''' view open in the right hand column. Now we can add our Subversion repository url:
  
9. install subversion plugin in Eclipse normally, like described in the beginning of that Wiki page
+
* Right click in the SVN Repository column -> New -> Repository Location
 +
* Enter the url of your repository -> click Ok
  
10. restart eclipse: everything should work, you should be able to chose javahl in preferences->team->svn :)
 
  
 +
== Using Subclipse ==
  
-----
+
Once you've configured your repository you can check out code into a new Eclipse project.  You can also create new project from Subversion repositories by:
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!
+
* Clicking on File -> New -> Project
 +
* Expand the SVN folder -> Checkout Projects from SVN
  
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:
+
You can upload your code into a Subversion repository by:
  
<pre><nowiki>
+
* Right click the project -> Team -> Share Project
checking whether we are using the GNU C++ compiler... no
+
* Highlight SVN -> Next
checking whether g++ accepts -g... no
+
* Select a Repository you've already configured and click Next, or choose ''create a new repository location''  and click Next.
checking how to run the C++ preprocessor... /lib/cpp
+
* Choose the folder you want to upload to and click Finish.
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
+
See `config.log' for more details.
+
make: *** [debian/stamp-configure] Error 1
+
</nowiki></pre>
+
  
To solve the error <code><nowiki>C++ preprocessor "/lib/cpp" fails sanity check</nowiki></code> while compiling Subversion, you need to download  GCC, CPP and G++ by installing the following packages
+
Once you've shared your project or checked one out you can access most common svn functions by right clicking the project and selecting an item from the '''Team''' menu.
<pre><nowiki>
+
gcc cpp g++</nowiki></pre> (see 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).
+
'''Note:''' Old content about javahl to this page: SubversionAndJavahl. I believe the content is rather old, so if you use javahl please feel free to update the page.
On my computer I have installed:
+
** Unbuntu 5.04
+
** JDK 1.5.0_3
+
** Eclipse 3.0.2
+
** subversion package
+
** subclipse plugin
+
** JavaSVN plugin
+
  
and Subversion works fine for me.
 
  
[[category:CategoryDocumentation]] [[category:CategoryCleanup]]
+
'''Note:''' this guide has been tested on Ubuntu 7.06 (Feisty Fawn) and Ubuntu 7.10 (Gutsy Gibbon)
 +
----
 +
[[category:CategoryDocumentation]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年11月22日 (四) 12:26的版本


Introduction

Subclipse is an Eclipse plugin that provides project integration with Subversion repositories. Using Subclipse you can checkout, browse, and share code from any Subversion repository.

See : SubVersion

See : Official Subclipse Home Page

See : UbuntuHelp:EclipseIDE

The Chinese translation of thie article.

Subversion support

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

Installing Subclipse

To install Subclipse:

  • Open 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 selecting subclipse and accepting the license. Then click the "install all" button when ready.
  • Restart Eclipse


Configuring a Subversion Repository

To configure Subclipse to connect to a repository open the SVN Repository Exploring perspective:

  • Click on Window -> Open Perspective -> Other
  • Highlight SVN Repository Exploring -> click Ok

You should now have the SVN Repository view open in the right hand column. Now we can add our Subversion repository url:

  • Right click in the SVN Repository column -> New -> Repository Location
  • Enter the url of your repository -> click Ok


Using Subclipse

Once you've configured your repository you can check out code into a new Eclipse project. You can also create new project from Subversion repositories by:

  • Clicking on File -> New -> Project
  • Expand the SVN folder -> Checkout Projects from SVN

You can upload your code into a Subversion repository by:

  • Right click the project -> Team -> Share Project
  • Highlight SVN -> Next
  • Select a Repository you've already configured and click Next, or choose create a new repository location and click Next.
  • Choose the folder you want to upload to and click Finish.

Once you've shared your project or checked one out you can access most common svn functions by right clicking the project and selecting an item from the Team menu.


Note: Old content about javahl to this page: SubversionAndJavahl. I believe the content is rather old, so if you use javahl please feel free to update the page.


Note: this guide has been tested on Ubuntu 7.06 (Feisty Fawn) and Ubuntu 7.10 (Gutsy Gibbon)