1 2 Previous Next 15 Replies Latest reply on Oct 11, 2013 8:06 PM by MGelbana

    GlassFish Tools does not provide a Server Runtime for Java Build Path

    user11111682

      The server can be added in the Servers view and starting and stopping works nicely.

       

      However, adding the server runtime to the classpath of a project like this does not work:

       

      1. Right click on project > Properties
      2. Select Java Build Path
      3. Select the Libraries tab
      4. Click Add Library...
      5. Choose Server Runtime

       

      Actual: The resulting selection dialog is empty.

      Expected: The dialog lists a GlassFish 3.1 runtime.

       

      As a result, the classpath does not contain the Java EE and JPA APIs, resulting in compile errors. This used to work with earlier versions of the plugin (e.g. the one from http://download.java.net/glassfish/eclipse/indigo).

       

      The problem exists at least in the following configurations:

       

      • Eclipse 4.3 RC3 with GlassFish Tools 6.0.2.201306071627 and a GlassFish 3.1.2.2 server
      • Eclipse 4.2.2 with GlassFish Tools 5.2.2.201305291930 and a GlassFish 3.1.2.2 server

       

      An ugly workaround (until this is fixed) is to manually add the following (possibly more) jars via Add External Jars...:

       

      glassfish/lib/javaee.jar
      glassfish/modules/org.eclipse.persistence.core.jar
      glassfish/modules/org.eclipse.persistence.jpa.jar
      glassfish/modules/org.eclipse.persistence.asm.jar
      glassfish/modules/org.eclipse.persistence.antlr.jar
      

       

      The problem with the above is that it adds absolute paths to .classpath and therefore can not be committed to the repository.

        1 2 Previous Next