Lucene - Core
  1. Lucene - Core
  2. LUCENE-6174

Improve "ant eclipse" to select right JRE for building

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.4, 6.0
    • Component/s: general/build
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Whenever I run "ant eclipse" the setting choosing the right JVM is lost and has to be reassigned in the project properties.

      In fact the classpath generator writes a new classpath file (as it should), but this onl ycontains the "default" entry:

      <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
      

      Instead it should preserve something like:

      <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_25"/>
      

      We can either path this by a Ant property via command line or user can do this with "lucene/build.properties" or per user. An alternative would be to generate the name "jdk1.8.0_25" by guessing from ANT's "java.home". If this name does not exist in eclipse it would produce an error and user would need to add the correct JDK.

      I currently have the problem that my Eclipse uses Java 7 by default and whenever I rebuild the eclipse project, the change to Java 8 in trunk is gone.

      When this is fixed, I could easily/automatically have the "right" JDK used by eclipse for trunk (Java 8) and branch_5x (Java 7).

      1. capture-2.png
        48 kB
        Dawid Weiss
      2. LUCENE-6174.patch
        0.8 kB
        Dawid Weiss

        Activity

        Hide
        Dawid Weiss added a comment -

        I think this can be hardcoded in dot.classpath.xsl (to be 1.7 in branch_5x and 1.8 in trunk).

        This declaration declares an "execution environment" which one can then define in Eclipse settings to be any available 1.8-compatible JVM:

          <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
        
        Show
        Dawid Weiss added a comment - I think this can be hardcoded in dot.classpath.xsl (to be 1.7 in branch_5x and 1.8 in trunk). This declaration declares an "execution environment" which one can then define in Eclipse settings to be any available 1.8-compatible JVM: <classpathentry kind= "con" path= "org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8" />
        Hide
        Dawid Weiss added a comment -

        Let me know if you'd like me to add it, Uwe Schindler, I can take care of this.

        Show
        Dawid Weiss added a comment - Let me know if you'd like me to add it, Uwe Schindler , I can take care of this.
        Hide
        Uwe Schindler added a comment -

        If this works, I am fine with that. I tried this out locally and the names were more complicated (because it used the "name" I used locally.
        But using those standards should be fine. So go ahead, I can try this!

        Show
        Uwe Schindler added a comment - If this works, I am fine with that. I tried this out locally and the names were more complicated (because it used the "name" I used locally. But using those standards should be fine. So go ahead, I can try this!
        Hide
        Uwe Schindler added a comment -

        Looks fine! Go ahead. I did not find out that there is some "generic" selector in the GUI that selects those types with generic name!

        Show
        Uwe Schindler added a comment - Looks fine! Go ahead. I did not find out that there is some "generic" selector in the GUI that selects those types with generic name!
        Hide
        Dawid Weiss added a comment -

        Yep, this is a generic "jvm type" selector. Which is nice because then you can select which JVM you're using at runtime (for all projects). I'll attach a screenshot with the info where it is in Eclipse.

        Show
        Dawid Weiss added a comment - Yep, this is a generic "jvm type" selector. Which is nice because then you can select which JVM you're using at runtime (for all projects). I'll attach a screenshot with the info where it is in Eclipse.
        Hide
        Uwe Schindler added a comment -

        +1 to commit

        Show
        Uwe Schindler added a comment - +1 to commit
        Hide
        ASF subversion and git services added a comment -

        Commit 1695438 from Dawid Weiss in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1695438 ]

        LUCENE-6174: Improve 'ant eclipse' to select right JRE for building.

        Show
        ASF subversion and git services added a comment - Commit 1695438 from Dawid Weiss in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1695438 ] LUCENE-6174 : Improve 'ant eclipse' to select right JRE for building.
        Hide
        ASF subversion and git services added a comment -

        Commit 1695442 from Dawid Weiss in branch 'dev/trunk'
        [ https://svn.apache.org/r1695442 ]

        LUCENE-6174: Improve 'ant eclipse' to select right JRE for building.

        Show
        ASF subversion and git services added a comment - Commit 1695442 from Dawid Weiss in branch 'dev/trunk' [ https://svn.apache.org/r1695442 ] LUCENE-6174 : Improve 'ant eclipse' to select right JRE for building.

          People

          • Assignee:
            Dawid Weiss
            Reporter:
            Uwe Schindler
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development