title: Making JARs from Java Classes and Implementing via GWT
body: <p>I created the following generic class (and a number of custom widgets) and want to do two things:</p>
  
  <p>1) externalize to a JAR for portability</p>
  
  <p>2) import and use that JAR in my GWT project</p>
  
  <p>How might I go about doing so? Do other items (i.e. dependencies) need to be included when I right-click->export on the class(es) in Eclipse?</p>
  
  <pre><code>import java.io.Serializable;
  import com.google.gwt.user.client.ui.HasValue;
  
  public class MinMaxAvg&lt;T&gt; extends HasValueConcrete&lt;MinMax&lt;T&gt;&gt; implements HasValue&lt;MinMax&lt;T&gt;&gt;, Serializable {
  
      private static final long serialVersionUID = -54806010801403294L;
      private T min;
      private T max;
      private T avg;
  
      public MinMaxAvg() {
          super();
      }
  
      public MinMaxAvg(T min, T max, T avg) {
          super();
          this.min = min;
          this.max = max;
          this.avg = avg;
      }
  
      public MinMaxAvg(MinMaxAvg&lt;T&gt; rhs) {
          super();
          if (rhs != null) {
              this.min = rhs.min;
              this.max = rhs.max;
              this.avg = rhs.avg;
          }
      }
  
      public T getMin() {
          return min;
      }
  
      public void setMin(T min) {
          this.min = min;
      }
  
      public T getMax() {
          return max;
      }
  
      public void setMax(T max) {
          this.max = max;
      }
  
      public T getAvg() {
          return avg;
      }
  
      public void setAvg(T avg) {
          this.avg = avg;
      }
  
      public boolean hasMin() {
          return min != null;
      }
  
      public boolean hasMax() {
          return max != null;
      }
  
      public boolean hasAvg() {
          return avg != null;
      }
  
      @Override
      public MinMax&lt;T&gt; getValue() {
          return new MinMax&lt;T&gt;(min, max);
      }
  
      @Override
      public void setValue(MinMax&lt;T&gt; value) {
          min = value.getMin();
          max = value.getMax();
      }
  
      @Override
      public int hashCode() {
          final int prime = 31;
          int result = 1;
          result = prime * result + ((avg == null) ? 0 : avg.hashCode());
          result = prime * result + ((max == null) ? 0 : max.hashCode());
          result = prime * result + ((min == null) ? 0 : min.hashCode());
          return result;
      }
  
      @Override
      public boolean equals(Object obj) {
          if (this == obj)
              return true;
          if (obj == null)
              return false;
          if (getClass() != obj.getClass())
              return false;
          @SuppressWarnings("unchecked")
          MinMaxAvg&lt;T&gt; other = (MinMaxAvg&lt;T&gt;) obj;
          if (avg == null) {
              if (other.avg != null)
                  return false;
          } else if (!avg.equals(other.avg))
              return false;
          if (max == null) {
              if (other.max != null)
                  return false;
          } else if (!max.equals(other.max))
              return false;
          if (min == null) {
              if (other.min != null)
                  return false;
          } else if (!min.equals(other.min))
              return false;
          return true;
      }
  
      @Override
      public String toString() {
          StringBuilder builder = new StringBuilder();
          builder.append("MinMaxAvg [min=");
          builder.append(min);
          builder.append(", max=");
          builder.append(max);
          builder.append(", avg=");
          builder.append(avg);
          builder.append("]");
          return builder.toString();
      }
  }
  </code></pre>