{"id":12868,"date":"2013-05-17T01:00:57","date_gmt":"2013-05-16T22:00:57","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=12868"},"modified":"2013-05-16T10:26:05","modified_gmt":"2013-05-16T07:26:05","slug":"heroku-and-java-from-newbie-to-beginner-part-1","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2013\/05\/heroku-and-java-from-newbie-to-beginner-part-1.html","title":{"rendered":"Heroku and Java &#8211; From Newbie to Beginner, Part 1"},"content":{"rendered":"<p>Recently I\u2019ve heard that <a href=\"http:\/\/www.heroku.com\">Heroku<\/a> allows deployment of Java applications in it\u2019s Cedar stack. Having no real software idea I decided I\u2019ll give it a try and just configure SOMETHING to work on Heroku.<\/p>\n<p>I have some kind of crush on ReST (I still want to learn it and practice it) so I\u2019ve decided my first application will be a simple hello world using <a href=\"http:\/\/jersey.java.net\">Jersey<\/a> (JAX-RS implementation). So I started a <a href=\"https:\/\/github.com\/pbuda\/recaps\">project<\/a> on GitHub and started setting up Heroku CLI.<\/p>\n<h2>Setting up Heroku CLI<\/h2>\n<p>Heroku is now easy to set up. I remember when it required Ruby env and my first<br \/>\n&nbsp;<br \/>\nencounter with Ruby was not so great (there was no installer of any sort so it was all manual \u2013 and I\u2019m lazy) so I gave up on Heroku back then. But now installing it is a breeze \u2013 simply go to <a href=\"https:\/\/toolbelt.herokuapp.com\">Heroku Toolbelt<\/a> and download version for your platform. I have now set it up both on Linux Mint and Windows 7 and it works great.<\/p>\n<h2>Setting up project for Heroku<\/h2>\n<p>My project is called <a href=\"\/\/github.com\/pbuda\/recaps\">recaps<\/a> \u2013 it\u2019s supposed to be yet another ticket management system. But that\u2019s irrelevant for now. The most important thing is that in order for Heroku to discover that our application is a Java application pom.xml file must be present. That\u2019s because Heroku uses <a href=\"http:\/\/maven.apache.org\">Maven 3<\/a> to build Java applications.<\/p>\n<p>So to actually begin any work with Heroku you need a simple pom.xml file. In my case I\u2019ve added a separate module for the application, so my main pom looks like this:<\/p>\n<pre class=\" brush:xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\"\r\n         xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n         xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\"&gt;\r\n    &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\r\n\r\n    &lt;groupId&gt;com.github.pbuda.recaps&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;recaps&lt;\/artifactId&gt;\r\n    &lt;packaging&gt;pom&lt;\/packaging&gt;\r\n    &lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt;\r\n\r\n    &lt;inceptionYear&gt;2012&lt;\/inceptionYear&gt;\r\n\r\n    &lt;developers&gt;\r\n        &lt;developer&gt;\r\n            &lt;name&gt;Piotr Buda&lt;\/name&gt;\r\n            &lt;email&gt;pibuda@gmail.com&lt;\/email&gt;\r\n            &lt;timezone&gt;+1&lt;\/timezone&gt;\r\n        &lt;\/developer&gt;\r\n    &lt;\/developers&gt;\r\n\r\n    &lt;licenses&gt;\r\n        &lt;license&gt;\r\n            &lt;name&gt;Apache License, version 2.0&lt;\/name&gt;\r\n            &lt;url&gt;http:\/\/www.apache.org\/licenses\/LICENSE-2.0.html&lt;\/url&gt;\r\n        &lt;\/license&gt;\r\n    &lt;\/licenses&gt;\r\n\r\n    &lt;modules&gt;\r\n        &lt;module&gt;webmodule&lt;\/module&gt;\r\n    &lt;\/modules&gt;\r\n\r\n    &lt;build&gt;\r\n        &lt;pluginManagement&gt;\r\n            &lt;plugins&gt;\r\n                &lt;plugin&gt;\r\n                    &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt;\r\n                    &lt;artifactId&gt;maven-compiler-plugin&lt;\/artifactId&gt;\r\n                    &lt;configuration&gt;\r\n                        &lt;source&gt;1.6&lt;\/source&gt;\r\n                        &lt;target&gt;1.6&lt;\/target&gt;\r\n                    &lt;\/configuration&gt;\r\n                &lt;\/plugin&gt;\r\n            &lt;\/plugins&gt;\r\n        &lt;\/pluginManagement&gt;\r\n    &lt;\/build&gt;\r\n\r\n&lt;\/project&gt;<\/pre>\n<\/figure>\n<p>Then there is the web module, just for the sake of splitting projects:<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\" brush:xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\"\r\n         xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n         xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\"&gt;\r\n    &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\r\n\r\n    &lt;parent&gt;\r\n        &lt;groupId&gt;com.github.pbuda.recaps&lt;\/groupId&gt;\r\n        &lt;artifactId&gt;recaps&lt;\/artifactId&gt;\r\n        &lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt;\r\n    &lt;\/parent&gt;\r\n\r\n    &lt;artifactId&gt;webmodule&lt;\/artifactId&gt;\r\n\r\n    &lt;build&gt;\r\n        &lt;plugins&gt;\r\n            &lt;plugin&gt;\r\n                &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt;\r\n                &lt;artifactId&gt;maven-dependency-plugin&lt;\/artifactId&gt;\r\n                &lt;version&gt;2.4&lt;\/version&gt;\r\n                &lt;executions&gt;\r\n                    &lt;execution&gt;\r\n                        &lt;id&gt;copy-dependencies&lt;\/id&gt;\r\n                        &lt;phase&gt;package&lt;\/phase&gt;\r\n                        &lt;goals&gt;\r\n                            &lt;goal&gt;copy-dependencies&lt;\/goal&gt;\r\n                        &lt;\/goals&gt;\r\n                    &lt;\/execution&gt;\r\n                &lt;\/executions&gt;\r\n            &lt;\/plugin&gt;\r\n            &lt;plugin&gt;\r\n                &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt;\r\n                &lt;artifactId&gt;maven-compiler-plugin&lt;\/artifactId&gt;\r\n            &lt;\/plugin&gt;\r\n        &lt;\/plugins&gt;\r\n    &lt;\/build&gt;\r\n    &lt;dependencies&gt;\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;com.sun.jersey&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;jersey-server&lt;\/artifactId&gt;\r\n            &lt;version&gt;1.12&lt;\/version&gt;\r\n        &lt;\/dependency&gt;\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;com.sun.jersey&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;jersey-core&lt;\/artifactId&gt;\r\n            &lt;version&gt;1.12&lt;\/version&gt;\r\n        &lt;\/dependency&gt;\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;com.sun.jersey&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;jersey-grizzly2&lt;\/artifactId&gt;\r\n            &lt;version&gt;1.12&lt;\/version&gt;\r\n        &lt;\/dependency&gt;\r\n    &lt;\/dependencies&gt;\r\n\r\n&lt;\/project&gt;<\/pre>\n<\/figure>\n<p>My first attempt at running my sample project concentrated on setting up Jersey. After checking out docs I decided I\u2019ll use Grizzly2 HTTP server just because it\u2019s very easy to set up. I\u2019ve basically pasted the docs tutorial into main Main class. There were some necessary differences, because for example port of the server is dynamically assigned by Heroku. So after very few changes, the resulting Main class looks like this:<\/p>\n<pre class=\" brush:java\">\/**\r\n * Copyright 2012 Piotr Buda\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *     http:\/\/www.apache.org\/licenses\/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n *\/\r\n\r\npackage com.github.pbuda.recaps;\r\n\r\nimport com.sun.jersey.api.container.grizzly2.GrizzlyServerFactory;\r\nimport com.sun.jersey.api.core.PackagesResourceConfig;\r\nimport com.sun.jersey.api.core.ResourceConfig;\r\nimport org.glassfish.grizzly.http.server.HttpServer;\r\n\r\nimport javax.ws.rs.core.UriBuilder;\r\nimport java.io.IOException;\r\nimport java.net.URI;\r\n\r\n\/**\r\n * Created by IntelliJ IDEA.\r\n * User: pbu\r\n * Date: 28.02.12\r\n * Time: 21:01\r\n * To change this template use File | Settings | File Templates.\r\n *\/\r\npublic class Main {\r\n    private static URI getBaseURI(String hostname, int port) {\r\n        return UriBuilder.fromUri(\"http:\/\/0.0.0.0\/\").port(port).build();\r\n    }\r\n\r\n    protected static HttpServer startServer(URI uri) throws IOException {\r\n        System.out.println(\"Starting grizzly...\");\r\n        ResourceConfig rc = new PackagesResourceConfig(\"com.github.pbuda.recaps\");\r\n        return GrizzlyServerFactory.createHttpServer(uri, rc);\r\n    }\r\n\r\n    public static void main(String[] args) throws IOException {\r\n        URI uri = getBaseURI(System.getenv(\"HOSTNAME\"), Integer.valueOf(System.getenv(\"PORT\")));\r\n        HttpServer httpServer = startServer(uri);\r\n        System.out.println(String.format(\"Jersey app started with WADL available at \"\r\n                + \"%sapplication.wadl\\nTry out %shelloworld\\nHit enter to stop it...\",\r\n                uri, uri));\r\n        while(true) {\r\n            System.in.read();\r\n        }\r\n    }\r\n}<\/pre>\n<\/figure>\n<p>That starts up the server and registers some resources with it.<\/p>\n<h2>Some Grizzly tricks<\/h2>\n<p>Firstly, the GrizzlyServerFactory.createHttpServer method accepts an URI which has to begin witch schema name \u2013 in this case <a href=\"http:\/\/.\">http:\/\/.<\/a> Then it has to specify host name, which at first I set up to the application name on herokuapp.com. This didn\u2019t work, but Heroku told me nicely about it: there is a notification in logs that server should bind to 0.0.0.0, so I changed the URI to <a href=\"http:\/\/0.0.0.0.\">http:\/\/0.0.0.0.<\/a><\/p>\n<p>Secondly, the Jersey example waited for a key press to terminate the server. Unfortunately Heroku printed a message which was then passed to the application somehow and the server was terminated. To resolve this, I wrapped the System.in.read() in an endless while loop.<\/p>\n<p>This of course is not the best solution, but it worked, or so it seemed. After a few hours I checked the logs of the application and they said that the application went from up to down. So I\u2019ve decided to switch from Grizzly to Jetty, but that\u2019s out of topic for this post.<\/p>\n<p>Before pushing all this to Heroku I also added a Procfile:<\/p>\n<pre class=\" brush:java\">web:    java -cp webmodule\/target\/classes:webmodule\/target\/dependency\/* com.github.pbuda.recaps.Main<\/pre>\n<\/figure>\n<p>After pushing to Heroku the application was build and started, and request to <a href=\"http:\/\/growing-dawn-9158.herokuapp.com\/helloworld\">http:\/\/growing-dawn-9158.herokuapp.com\/helloworld<\/a> produced some output (in this case a simple \u2018Message\u2019 message). Job well done.<\/p>\n<h2>Mistakes I\u2019ve made and learnt from<\/h2>\n<p>Firstly, I forgot to add the Maven Dependency plugin, but I resolved that one before pushing to Heroku. Without it configured I couldn\u2019t add dependencies to classpath, which in turn produced ClassNotFound exceptions. It didn\u2019t occur to me at first it was required, but then I looked at Heroku example and fixed it easily.<\/p>\n<p>Secondly, I didn\u2019t know that web dynos time out. After successful deployment I was sure the application was running, but because of time out, logs said the application went down. Because I wasn\u2019t aware of the fact that web dynos time out I suspected that Grizzly was simply interrupted somehow so I\u2019ve decided to move to Jetty. But it happened to Jetty implementation too, so I started digging and I found relevant information.<\/p>\n<h2>Summary<\/h2>\n<p>I think that Heroku is great. It\u2019s free Java hosting, something that is NOT popular and yet they did it and it works quite nicely. I once tried Google App Engine, but the experience wasn\u2019t great (mind you it was some long time ago) so I\u2019ve decided to give Heroku a chance and because it was actually quite simple to set up the application I think I\u2019ll stick to it for a while and play with the platform \u2013 look at all those plugins<br \/>\n&nbsp;<\/p>\n<div style=\"border: 1px solid #D8D8D8; background: #FAFAFA; width: 100%; padding-left: 5px;\"><b><i>Reference: <\/i><\/b><a href=\"http:\/\/piotrbuda.eu\/2012\/02\/heroku-and-java-from-newbie-to-beginner-part-1.html\">Heroku and Java &#8211; From Newbie to Beginner, Part 1<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\">JCG partner<\/a> Piotr Buda at the <a href=\"http:\/\/piotrbuda.eu\/\">Software Ramblings<\/a> blog.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Recently I\u2019ve heard that Heroku allows deployment of Java applications in it\u2019s Cedar stack. Having no real software idea I decided I\u2019ll give it a try and just configure SOMETHING to work on Heroku. I have some kind of crush on ReST (I still want to learn it and practice it) so I\u2019ve decided my &hellip;<\/p>\n","protected":false},"author":432,"featured_media":134,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[210,222],"class_list":["post-12868","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-cloud","tag-heroku"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Heroku and Java - From Newbie to Beginner, Part 1<\/title>\n<meta name=\"description\" content=\"Recently I\u2019ve heard that Heroku allows deployment of Java applications in it\u2019s Cedar stack. Having no real software idea I decided I\u2019ll give it a try and\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2013\/05\/heroku-and-java-from-newbie-to-beginner-part-1.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Heroku and Java - From Newbie to Beginner, Part 1\" \/>\n<meta property=\"og:description\" content=\"Recently I\u2019ve heard that Heroku allows deployment of Java applications in it\u2019s Cedar stack. Having no real software idea I decided I\u2019ll give it a try and\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2013\/05\/heroku-and-java-from-newbie-to-beginner-part-1.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:author\" content=\"http:\/\/www.facebook.com\/piotr.buda\" \/>\n<meta property=\"article:published_time\" content=\"2013-05-16T22:00:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/heroku-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Piotr Buda\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@http:\/\/twitter.com\/#!\/piotrbuda\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Piotr Buda\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/heroku-and-java-from-newbie-to-beginner-part-1.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/heroku-and-java-from-newbie-to-beginner-part-1.html\"},\"author\":{\"name\":\"Piotr Buda\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/fc5d484f59d645fb307c366571ba6867\"},\"headline\":\"Heroku and Java &#8211; From Newbie to Beginner, Part 1\",\"datePublished\":\"2013-05-16T22:00:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/heroku-and-java-from-newbie-to-beginner-part-1.html\"},\"wordCount\":836,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/heroku-and-java-from-newbie-to-beginner-part-1.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/heroku-logo.jpg\",\"keywords\":[\"Cloud\",\"Heroku\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/heroku-and-java-from-newbie-to-beginner-part-1.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/heroku-and-java-from-newbie-to-beginner-part-1.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/heroku-and-java-from-newbie-to-beginner-part-1.html\",\"name\":\"Heroku and Java - From Newbie to Beginner, Part 1\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/heroku-and-java-from-newbie-to-beginner-part-1.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/heroku-and-java-from-newbie-to-beginner-part-1.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/heroku-logo.jpg\",\"datePublished\":\"2013-05-16T22:00:57+00:00\",\"description\":\"Recently I\u2019ve heard that Heroku allows deployment of Java applications in it\u2019s Cedar stack. Having no real software idea I decided I\u2019ll give it a try and\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/heroku-and-java-from-newbie-to-beginner-part-1.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/heroku-and-java-from-newbie-to-beginner-part-1.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/heroku-and-java-from-newbie-to-beginner-part-1.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/heroku-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/heroku-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/heroku-and-java-from-newbie-to-beginner-part-1.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Heroku and Java &#8211; From Newbie to Beginner, Part 1\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/fc5d484f59d645fb307c366571ba6867\",\"name\":\"Piotr Buda\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4e0d884fb082b07a03a46aa53e7f8a2ad01fe907890b5c2d9dbcba067b316035?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4e0d884fb082b07a03a46aa53e7f8a2ad01fe907890b5c2d9dbcba067b316035?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4e0d884fb082b07a03a46aa53e7f8a2ad01fe907890b5c2d9dbcba067b316035?s=96&d=mm&r=g\",\"caption\":\"Piotr Buda\"},\"sameAs\":[\"http:\\\/\\\/piotrbuda.eu\\\/\",\"http:\\\/\\\/www.facebook.com\\\/piotr.buda\",\"http:\\\/\\\/pl.linkedin.com\\\/in\\\/piotrbuda\",\"https:\\\/\\\/x.com\\\/http:\\\/\\\/twitter.com\\\/#!\\\/piotrbuda\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/piotr-buda\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Heroku and Java - From Newbie to Beginner, Part 1","description":"Recently I\u2019ve heard that Heroku allows deployment of Java applications in it\u2019s Cedar stack. Having no real software idea I decided I\u2019ll give it a try and","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2013\/05\/heroku-and-java-from-newbie-to-beginner-part-1.html","og_locale":"en_US","og_type":"article","og_title":"Heroku and Java - From Newbie to Beginner, Part 1","og_description":"Recently I\u2019ve heard that Heroku allows deployment of Java applications in it\u2019s Cedar stack. Having no real software idea I decided I\u2019ll give it a try and","og_url":"https:\/\/www.javacodegeeks.com\/2013\/05\/heroku-and-java-from-newbie-to-beginner-part-1.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_author":"http:\/\/www.facebook.com\/piotr.buda","article_published_time":"2013-05-16T22:00:57+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/heroku-logo.jpg","type":"image\/jpeg"}],"author":"Piotr Buda","twitter_card":"summary_large_image","twitter_creator":"@http:\/\/twitter.com\/#!\/piotrbuda","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Piotr Buda","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/heroku-and-java-from-newbie-to-beginner-part-1.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/heroku-and-java-from-newbie-to-beginner-part-1.html"},"author":{"name":"Piotr Buda","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/fc5d484f59d645fb307c366571ba6867"},"headline":"Heroku and Java &#8211; From Newbie to Beginner, Part 1","datePublished":"2013-05-16T22:00:57+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/heroku-and-java-from-newbie-to-beginner-part-1.html"},"wordCount":836,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/heroku-and-java-from-newbie-to-beginner-part-1.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/heroku-logo.jpg","keywords":["Cloud","Heroku"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2013\/05\/heroku-and-java-from-newbie-to-beginner-part-1.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/heroku-and-java-from-newbie-to-beginner-part-1.html","url":"https:\/\/www.javacodegeeks.com\/2013\/05\/heroku-and-java-from-newbie-to-beginner-part-1.html","name":"Heroku and Java - From Newbie to Beginner, Part 1","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/heroku-and-java-from-newbie-to-beginner-part-1.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/heroku-and-java-from-newbie-to-beginner-part-1.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/heroku-logo.jpg","datePublished":"2013-05-16T22:00:57+00:00","description":"Recently I\u2019ve heard that Heroku allows deployment of Java applications in it\u2019s Cedar stack. Having no real software idea I decided I\u2019ll give it a try and","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/heroku-and-java-from-newbie-to-beginner-part-1.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2013\/05\/heroku-and-java-from-newbie-to-beginner-part-1.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/heroku-and-java-from-newbie-to-beginner-part-1.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/heroku-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/heroku-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/heroku-and-java-from-newbie-to-beginner-part-1.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Heroku and Java &#8211; From Newbie to Beginner, Part 1"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/fc5d484f59d645fb307c366571ba6867","name":"Piotr Buda","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4e0d884fb082b07a03a46aa53e7f8a2ad01fe907890b5c2d9dbcba067b316035?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4e0d884fb082b07a03a46aa53e7f8a2ad01fe907890b5c2d9dbcba067b316035?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4e0d884fb082b07a03a46aa53e7f8a2ad01fe907890b5c2d9dbcba067b316035?s=96&d=mm&r=g","caption":"Piotr Buda"},"sameAs":["http:\/\/piotrbuda.eu\/","http:\/\/www.facebook.com\/piotr.buda","http:\/\/pl.linkedin.com\/in\/piotrbuda","https:\/\/x.com\/http:\/\/twitter.com\/#!\/piotrbuda"],"url":"https:\/\/www.javacodegeeks.com\/author\/piotr-buda"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/12868","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/432"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=12868"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/12868\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/134"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=12868"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=12868"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=12868"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}