Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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

user11111682Jun 20 2013 — edited Oct 11 2013

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.

This post has been answered by Kosta-Oracle on Jul 1 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 8 2013
Added on Jun 20 2013
15 comments
28,039 views