0

I would like to use org.glassfish.api.embedded in my Java application so that I can add a web interface to it. I'm using Netbeans and I have set up a Maven Java Application project.

I'm pretty new to Java. I cannot figure out how to add GlassFish to my project. I tried to add various dependencies, but none of them had org.glassfish.api.embedded in them.

How can I add org.glassfish.api.embedded to my Java application in Netbeans?

1 Answer 1

0

From: http://glassfish.java.net/downloads/3.1.2-final.html

<dependency>
    <groupdId>org.glassfish.main.extras</groupdId>
    <artifactId>glassfish-embedded-all</artifactId>
    <version>3.1.2</version>
</dependency>   

GlassFish Server 3.1.2 in a single JAR, useful for embedded use. Contains the full platform implementation (67 MB).

Or:

<dependency>
    <groupdId>org.glassfish.main.extras</groupdId>
    <artifactId>glassfish-embedded-web</artifactId>
    <version>3.1.2</version>
</dependency>   

GlassFish Server 3.1.2 in a single JAR, useful for embedded use. Contains the Web Profile implementation (40 MB).

It should be available via Maven Central, so you don't have to configure any repository.

The only downside: the jars are quite big (40MB resp. 67MB).

6
  • I'm downloading the jar now. It being big isn't a problem.
    – user1203803
    Jun 4, 2012 at 22:18
  • It might become an issue if you plan to create a Swing or JavaFX application and distribute it with Java WebStart. Then your users will have to download this jar as well.
    – Puce
    Jun 4, 2012 at 22:20
  • I'm writing bug-tracking software (as an installable server), so it won't be an issue.
    – user1203803
    Jun 4, 2012 at 22:23
  • The glassfish-embedded-all jar doesn't seem to have org.glassfish.api.embedded, but it does have org.glassfish.embeddable. Can I use that for running a web server inside of my application?
    – user1203803
    Jun 4, 2012 at 22:29
  • In this case I recommend to build your application with Java EE and deploy it to a GlassFish server instance, rather than trying to embed GlassFish.
    – Puce
    Jun 4, 2012 at 22:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.