r/java • • Sep 12 '15

JavaEE / TomEE - Hello World

Assuming that you already have the Java SDK installed, these are the steps to get a hello world program running in TomEE.

  1. Download / unpack Tomee.

    wget http://mirror.catn.com/pub/apache/tomee/tomee-1.7.2/apache-tomee-1.7.2-jaxrs.tar.gz tar -xvf apache-tomee-1.7.2-jaxrs.tar.gz

  2. Create folders to store your app.

    mkdir -p apache-tomee-jaxrs-1.7.2/webapps/helloworld/WEB-INF/classes cd apache-tomee-jaxrs-1.7.2/webapps/helloworld/WEB-INF/classes

  3. Create the HelloWorld.java

    vi HelloWorld.java

    import javax.ws.rs.*;

    @Path("/") public class HelloWorld {

     @GET
         public String home(){
         return "Hello World";
     }

    }

  4. Compile it.

    javac -classpath "../../../../lib/*" *.java

  5. Start the server.

    sh ../../../../bin/startup.sh

  6. Navigate to page http://localhost:8080/helloworld

0 Upvotes

24 comments sorted by

View all comments

1

u/tonywestonuk Sep 12 '15

This post is currently rating between 0 and 1 score, (50% / 52%)

I think It has 10 votes up, and 10 votes down..... Thats pretty split down the middle!!

I just posted a 'hello world' for Java TomEE, showing how easy it is to get going. It works. I tested it did before I posted it. And this was enough to be voted down 10 times! Why would people in a java forum, probably many java evangelists, want to vote this down.... what harm is it causing.

The very first reply to this was:

Do you really want to play this dumb game?

Thats nice!

Why so much hostility?

5

u/avoidhugeships Sep 13 '15 edited Sep 13 '15

There is often a lot of hostility towards Java EE here but I am not sure why. Don't let it bother you too much. It gets tiresome correcting the same misrepresentations over and over again. Right now its all about spring boot, last year it was Spring Roo which you would not even know existed anymore reading here.

I have been stuck in Spring shops and its no fun for me either. It's not awefull, it just takes more work to get things done and is more complicated to maintain. I used to say that about Java EE but Spring has fallen behind in my opinion.