Tagged: eclipse Toggle Comment Threads | Горячие клавиши

  • manandbytes 20:05 on April 17, 2011 Постоянная ссылка |
    Tags: debian, eclipse, harmony,   

    Installing Apache Harmony on Debian 

    What’s Apache Harmony? It’s an open source Java SE implementation with an unclear future. But, please, don’t ask me ‘Why installing it?’ Because developers are curious creatures 😉

    I don’t like to install a software distributed as a tar.gz archives. If it is possible, I’ll use my distribution’s native packages. It turned out that Apache Harmony project provides prebuilt packages for Debian/Ubuntu. So you have to download packages one by one and just install with dpkg --install harmony-5.0-jre_0.0r991518-1_i386.deb.

    There is nothing wrong if you’re interested in a one-time installation but there are manual actions required when (and if) Harmony project provides updates:

    • you have to be notified somehow about the fact that a new version is available;
    • you have to download a number of packages one by one;
    • you may have to (semi)manually resolve missing dependencies.

    As my motto says,

    less work for humans, more work for machines. just as it should be

    so let my machines do some more work 😉

    Make packages’ location known to APT

    Add these two lines to /etc/apt/sources.list:

    deb http://mirrors.ibiblio.org/pub/mirrors/apache/harmony/milestones/6.0/debian/i386/ ./
    deb http://mirrors.ibiblio.org/pub/mirrors/apache/harmony/milestones/5.0/debian/i386/ ./
    

    and update the list of available packages with aptitude update.

    For most Apache projects, all links on the download page point to the best mirror site based on your location, and Harmony’s Project Downloads page is no different. It suggested http://apache.vc.ukrtel.net/ as the best mirror site for my current location and, unfortunately, files mirrored to /harmony/milestones/6.0/M3/debian/i386. Chances are that the next milestone builds will be stored in other directory like /harmony/milestones/6.0/M4/debian/i386 and I have to touch sources.list. I think that layout provided by mirrors.ibiblio.org doesn’t have these drawbacks but only time will tell.

    Install them

    Installation is as simple as running aptitude install harmony-5.0-hdk harmony-6.0-hdk.

    Check what’s installed

    Let’s check what we have for main two executables, update-alternatives --display java:

    java - manual mode
      link currently points to /usr/lib/jvm/java-6-sun/jre/bin/java
    /usr/bin/gij-4.4 - priority 1044
    /usr/bin/gij-4.5 - priority 1045
    /usr/bin/java-harmony - priority 30
      slave java.1.gz: /usr/share/man/man1/java-harmony.1.gz
    /usr/bin/java-harmony-6.0 - priority 30
      slave java.1.gz: /usr/share/man/man1/java-harmony-6.0.1.gz
    /usr/lib/jvm/java-1.5.0-sun/jre/bin/java - priority 53
      slave java.1.gz: /usr/lib/jvm/java-1.5.0-sun/jre/man/man1/java.1.gz
    /usr/lib/jvm/java-6-openjdk/jre/bin/java - priority 1061
      slave java.1.gz: /usr/lib/jvm/java-6-openjdk/jre/man/man1/java.1.gz
    /usr/lib/jvm/java-6-sun/jre/bin/java - priority 63
      slave java.1.gz: /usr/lib/jvm/java-6-sun/jre/man/man1/java.1.gz
    Current 'best' version is '/usr/lib/jvm/java-6-openjdk/jre/bin/java'.
    

    and update-alternatives --display javac:

    javac - manual mode
      link currently points to /usr/lib/jvm/java-6-openjdk/bin/javac
    /usr/bin/ecj - priority 143
      slave javac.1.gz: /usr/share/man/man1/ecj.1.gz
    /usr/bin/gcj-wrapper-4.5 - priority 1045
    /usr/bin/javac-harmony - priority 30
      slave javac.1.gz: /usr/share/man/man1/javac-harmony.1.gz
    /usr/bin/javac-harmony-6.0 - priority 30
      slave javac.1.gz: /usr/share/man/man1/javac-harmony-6.0.1.gz
    /usr/lib/jvm/java-1.5.0-sun/bin/javac - priority 53
      slave javac.1.gz: /usr/lib/jvm/java-1.5.0-sun/man/man1/javac.1.gz
    /usr/lib/jvm/java-6-openjdk/bin/javac - priority 1061
      slave javac.1.gz: /usr/lib/jvm/java-6-openjdk/man/man1/javac.1.gz
    /usr/lib/jvm/java-6-sun/bin/javac - priority 63
      slave javac.1.gz: /usr/lib/jvm/java-6-sun/man/man1/javac.1.gz
    Current 'best' version is '/usr/lib/jvm/java-6-openjdk/bin/javac'.
    

    What about more deatiled verson information? /usr/bin/java-harmony -version reports:

    Apache Harmony Launcher : (c) Copyright 1991, 2010 The Apache Software Foundation or its licensors, as applicable.
    java version "1.5.0"
    Apache Harmony (1.5.0)
    DRLVM (1.5.0-r991518)
    pre-alpha : not complete or compatible
    svn = r991518, (Sep  7 2010), Linux/ia32/gcc 4.3.2, release build
    http://harmony.apache.org
    

    and /usr/bin/java-harmony-6.0 -version:

    Apache Harmony Launcher : (c) Copyright 1991, 2010 The Apache Software Foundation or its licensors, as applicable.
    java version "1.6.0"
    Apache Harmony (1.6.0)
    DRLVM (1.6.0-r991881)
    pre-alpha : not complete or compatible
    svn = r991881, (Sep  8 2010), Linux/ia32/gcc 4.3.2, release build
    http://harmony.apache.org
    

    Surprises

    • No alternatives for java-harmony nor javac-harmony
      What is the Debian alternatives system:

      The Debian alternatives system creates a way for several programs that fullfill the same or similar functions to be listed as alternative implementations that are installed simultaneously but with one particular implementation designated as the default.

      It’s a minor issue, though.

    • Both Harmony 5 and 6 use the same Java compiler
      /usr/bin/javac-harmony -version and /usr/bin/javac-harmony-6.0 -version report exactly the same version of the compiler:

      Eclipse Java Compiler 0.972_R35x, 3.5.1 release, Copyright IBM Corp 2000, 2009. All rights reserved.

      It seems to me as a quite serious issue, but what roadblocks to expect when cross-compiling and using different versions of compilers is a topic for another post.

    Summary

    I don’t have enough time to play with, so there are not so much to say, except: Apache Harmony installs, works in some cases, and may be uninstalled with ease.

    Реклама
     
  • manandbytes 20:16 on November 1, 2009 Постоянная ссылка |
    Tags: eclipse, ,   

    Lessons learned contributing to EGit project 

    Now it’s possible to share a project using Git provider from any place in the workspace with only a keyboard. My contribution was finally accepted and there are some lessons I’ve learned:

    • Be careful with sources had been used on the way. You may be asked under what terms you received this material.
    • Your contribution may be accepted not with all speed. Don’t expect rapid feedback on your bugs, patches, e-mails etc.
    • Holes may be present in a contributor’s guide. Do you like nitpicking? Sometimes you may be forced to resubmit your patch due to a trivial style nit.
    • When users download your sources, they must always just build. Always. Build. Without a single failing unit test. Programs with failing unit tests are difficult to contribute to, because you cannot easily determine if any change you made improved the program or not.
    • Always open is a fundamental rule of open source, so internal conversations should be avoided at any cost. Unfortunately, right now you can’t reply to a comment posted via Gerrit using your e-mail client’s feature «reply to mailing list» so that it will be posted to the comment thread in Gerrit. I hope an incoming email gateway would be implemented in Google Gerrit, sooner or later.
    • Conversations must be conducted as close to the code as possible. Tools like git format-patch, git am and Google Gerrit make this a no-brainer task.
    • «Release early, release often» sounds as an easy goal but there is still no update site with a latest pre-build version(s) of EGit.
     
  • manandbytes 00:20 on October 8, 2009 Постоянная ссылка |
    Tags: eclipse, ,   

    Emaclipse? 

    I use Emacs and Eclipse for several years but just recently realized that the Quick Access feature in Eclipse and M-x in Emacs are the same and it would be better to use the same keyboard shortcut for both. So what should I choose: Ctrl+3 or M-x?

     
  • manandbytes 20:45 on September 24, 2009 Постоянная ссылка |
    Tags: eclipse, ,   

    Share project using Git without touching your mouse: Eclipse Command Framework and Quick Access 

    I’ve just imported M2Eclipse with its almost 60 plugins into my workspace. And later I want to share one of currently open projects in the midst of my current workflow using Git provider. What should I do?

    Well, in most cases it is about reaching out for my mouse, moving it, pointing it to something and clicking. I’ve to switch to Package Explorer or Projects view to achieve my task. When using Package Explorer I found myself buried under several levels of folders to where my currently edited file is located because Package Explorer is a ‘good citizen’ who obeys Eclipse User Interface Guidelines and supports the ‘Link with Editor’ feature. But what if the target project is not in the active working set? Or not active in Mylyn’s context? Yes, there are even more extra clicks ahead. I have to admit that Projects view behaves much better in this case.

    Ok, I’ve finally selected the project I want to share and am able to use its context menu. Task completed but I feel myself a bit tired 😉 The main problem with this obvious way of doing things is that I’m forced to interrupt my current task and to lose focus finding my mouse and switching between different views etc.

    Are there any other ways? Are you one of those developers who try to get as much done as possible without lifting your fingers from the keyboard like me? Keep reading.

    Back in 2007 Eclipse 3.3 introduced a new feature called Quick Access. With Quick Access, UI elements such as commands, views, wizards, preference pages etc. can be quickly listed, filtered through, selected and executed without even knowing the keyboard shortcuts to be pressed. It’s the first part of the solution. The second one is Platform Command Framework.

    The combination of Quick Access and Command Framework allows us to implement solutions for tasks like the ones I described quite easily. My implementation was inspired by Eclipse Tips: Keyboard accessibility thru Command Framework, one of awesome articles about using Command Framework by Prakash G.R.

    With this enhancement it is possible to share a single project using Git provider from almost any place in the workspace with only a keyboard:

      share-with-git

  • activating Quick Access (which is bound to Ctrl+3 by default) and typing SWG (which means ‘share with Git’) will provide you with a list of all currently open projects not connected to any provider
  • after selecting a project share it using Configure Git Repository dialog
 
  • manandbytes 15:14 on December 23, 2008 Постоянная ссылка |
    Tags: eclipse,   

    How to import eclipse.org’s CVS into git with git-cvsimport 

    In order to be able to update a local git repository later with changes from the foreign remote repository (which is Eclipse.org’s CVS repository in my case) I have to store CVS metadata somewhere. The first place which pops up in my mind is .git/config and git-svn uses this approach for storing SVN metadata:

    mn@tabernacle:~/src/git-mirrors/josm$ cat .git/config 
    [core]
            repositoryformatversion = 0
            filemode = true
            bare = false
            logallrefupdates = true
    [svn-remote "svn"]
            url = http://josm.openstreetmap.de/svn
            fetch = trunk:refs/remotes/trunk
            branches = branches/*:refs/remotes/*
            tags = tags/*:refs/remotes/tags/*
    


    And this metadata may be retrieved at any time in a standard way using git config command:
    mn@tabernacle:~/src/git-mirrors/josm$ git config --get svn-remote.svn.url
    http://josm.openstreetmap.de/svn

    But for git-cvsimport I’m out of luck. Fortunately there is another solution:

    • create a working directory containing copies of the source files from original CVS repository using cvs checkout command
    • import a CVS module into Git repository using git cvsimport command

    So, lets start with importing org.eclipse.jdt.ui project:

    cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse co org.eclipse.jdt.ui
    cd org.eclipse.jdt.ui
    git cvsimport
    


    And a full history of org.eclipse.jdt.ui project since 2001 at my fingertips:

    Author: cvs   2001-05-02 20:50:00
    Committer: cvs   2001-05-02 20:50:00
    Child:  c43be3ba3c0e24ae62dda72232e0d191bcc6e05b (*** empty log message ***)
    Branches: JDK_1_5, NewSearchIntegration, Pioneering_5_0, R2_1_maintenance, content_assist_participants, editorWork, linkedPositions_rework, master, origin, pre_3_3_work
    Follows: 
    Precedes: v0_102+



    *** empty log message ***

    git cvsimport uses cvsps for generating a patchset information from a CVS repository. A patchset is a set of changes made to a collection of files and all committed at the same time (using a single cvs commit command). And it works, as I can see with git log d27f355 --max-count=3 --name-only:

    commit d27f355593d46d301291e9f84ce263d8c19e42b2
    Author: mkeller 
    Date:   Thu Dec 11 12:46:55 2008 +0000
        239347: Drag and drop any none java file doesn't refactor
    core refactoring/org/eclipse/jdt/internal/corext/refactoring/JDTRefactoringDescriptorComment.java
    core refactoring/org/eclipse/jdt/internal/corext/refactoring/RefactoringCoreMessages.java
    core refactoring/org/eclipse/jdt/internal/corext/refactoring/refactoring.properties
    core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameCompilationUnitProcessor.java
    core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameFieldProcessor.java
    core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameJavaProjectProcessor.java
    core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameLocalVariableProcessor.java
    core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameMethodProcessor.java
    core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenamePackageProcessor.java
    core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameTypeParameterProcessor.java
    core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameTypeProcessor.java
    core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/IReorgPolicy.java
    core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/JavaMoveProcessor.java
    core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/ReorgPolicyFactory.java
    core refactoring/org/eclipse/jdt/internal/corext/refactoring/tagging/IReferenceUpdating.java
    ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/RenameInputWizardPage.java
    ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/ReorgMoveWizard.java
    
    commit 8ee13e0e34d9ab201abdfc0722a25cd8614dc796
    Author: dmegert 
    Date:   Thu Dec 11 10:32:36 2008 +0000
    
        Require com.ibm.icu until Bidi is part of icu.base.
    
    .settings/org.eclipse.pde.prefs
    META-INF/MANIFEST.MF
    
    commit 4769cf70021ece07bce67cdc3563b0928dd50d87
    Author: dmegert 
    Date:   Wed Dec 10 09:10:57 2008 +0000
    
        Fixed bug 258238: Typo in Delete Working Set dialog: space before '?'
    
    ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/ReorgMessages.properties
    


    It took me about a one day and 1G(?) of data transfer (but who counts all these bytes in our days?) for a full import and now I can work on stuff offline. And Git is really disk-space-friendly. Only 54M of disk space is been used for 19000+ commits which had been made to org.eclipse.jdt.ui project since 2001.

    And to update my local git repository with changes from the remote CVS I can just run git cvsimport from the project’s working directory:

    Fetching ui/org/eclipse/jdt/internal/ui/workingsets/ConfigureWorkingSetAssignementAction.java   v 1.19
    Update ui/org/eclipse/jdt/internal/ui/workingsets/ConfigureWorkingSetAssignementAction.java: 25116 bytes
    Tree ID bad5edfd1a0dac40fa3a2c865cd2a3e4401380bb
    Parent ID fcf05781ae88bf413904aca54a9c4ee745c7f3cb
    Committed patch 19257 (origin +0000 2008-12-15 10:23:40)
    Commit ID 1e13114d7f01024110c0495de0350d8cfb43d1d6
    DONE.
    Updating fcf0578..1e13114
    Fast forward
     .../ConfigureWorkingSetAssignementAction.java      |   37 +++++++++++++++++++-
     1 files changed, 36 insertions(+), 1 deletions(-)
    

     
  • c
    Compose new post
    j
    Next post/Next comment
    k
    Previous post/Previous comment
    r
    Ответить
    e
    Редактировать
    o
    Show/Hide comments
    t
    Перейти наверх
    l
    Go to login
    h
    Show/Hide help
    shift + esc
    Отмена