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

Show parent comments

3

u/tonywestonuk Sep 12 '15

I posted it here first - I had a message telling me to post it to JavaHelp. Sort your own life out!

0

u/NimChimspky Sep 12 '15 edited Sep 12 '15

ok a tad strong on my part.

But its a bit weird, why do you feel the need to go around telling people how great java ee is ?

Most people have used it and form an opinion.

I don't like it, or spring btw. For many many different reasons. But hey it pays the bills.

-1

u/tonywestonuk Sep 12 '15

Why.... Because I have to use spring.... To pay the bills, as you say. And I hate it with a passion as every spring program I have worked on, even the spring-boot ones, end up as a huge spaghetti mess, with property files containing many database connection strings for live or dev, etc. Its complexity hell. I want to shout out from the treetops this is crap - LOOK OVER THERE AT JAVAEE- The grass is greener!!, and hopefully if I can get one other developer in the world to see what Java EE has to offer, rather than going to Spring Boot, or Golang, or Python, or PHP, etc, then it is worth it.

2

u/dorkquemada Sep 12 '15

So don't work with Spring then and specialize in Java EE. Nobody is holding a gun to your head I'd hope :)

I specialized in Java EE before because I liked it better and tend to work projects that fit my strengths, rather than showing up, hating it and probably not doing the best job I could.

Besides, a lot of the recent good stuff in Java EE was made possible by innovation done by Spring and others :)

1

u/tonywestonuk Sep 12 '15

Nobody is holding a gun to your head I'd hope :)

only the bank manager holding my mortgage deeds..... :-/ - Trust me I want to take my career this way this way.