{"id":26913,"date":"2015-09-09T11:00:42","date_gmt":"2015-09-09T08:00:42","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=26913"},"modified":"2019-03-29T14:31:49","modified_gmt":"2019-03-29T12:31:49","slug":"groovy-console-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/","title":{"rendered":"Groovy Console Example"},"content":{"rendered":"<h2>1. Introduction<\/h2>\n<p>In this tutorial, I will show you how to use Groovy Console to run your Groovy scripts and also give you some details about Groovy Console itself. Actually, there are several ways to run Groovy scripts. You can run it on your favourite IDE, you can run it from command line, or you can use Groovy Console to run your scripts.<\/p>\n<p>Groovy Console is a Swing GUI for perform several operations to your Groovy scripts. You may want to use Groovy Console to write and run Groovy scripts instead of IDE or command line. Let&#8217;s see features together.<br \/>\n&nbsp;<br \/>\n&nbsp;\n<\/p>\n<h2>2. Action Buttons<\/h2>\n<p>In Groovy Console, there are lots of actions that you can see below.<\/p>\n<p><figure id=\"attachment_26968\" aria-describedby=\"caption-attachment-26968\" style=\"width: 860px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_2_final.jpg\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_2_final.jpg\" alt=\"Action Buttons\" width=\"860\" height=\"630\" class=\"size-full wp-image-26968\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_2_final.jpg 860w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_2_final-300x220.jpg 300w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><figcaption id=\"caption-attachment-26968\" class=\"wp-caption-text\">Action Buttons<\/figcaption><\/figure><\/p>\n<p>Most of them are the actions that you may already know, but you can have a look at below to refresh your knowledge.<\/p>\n<ul>\n<li><code>Action 1<\/code> is for creating new script to write your code in a fresh area<\/li>\n<li><code>Action 2<\/code> is for <strong>Opening<\/strong> file<\/li>\n<li><code>Action 3<\/code> is for <strong>Saving<\/strong> your code as project<\/li>\n<li><code>Action 4<\/code> and <code>Action 5<\/code> are for <strong>Undo<\/strong> and <strong>Redo<\/strong> respectively<\/li>\n<li><code>Action 6, 7, 8<\/code> are for <strong>Cut<\/strong>, <strong>Copy<\/strong>, <strong>Paste<\/strong> respectively<\/li>\n<li><code>Action 9<\/code> is for looking up something with in your code<\/li>\n<li><code>Action 10<\/code> is for <strong>Replacing<\/strong> text with another text within your code<\/li>\n<li>In Groovy Console, your executing actions are kept historically. You can go forward and backward along running history with <code>Action 11<\/code> and <code>Action 12<\/code><\/li>\n<li><code>Action 13<\/code> is for <strong>Running<\/strong> your current script<\/li>\n<li><code>Action 14<\/code> is for <strong>Interrupting<\/strong> current running script<\/li>\n<\/ul>\n<h2>3. Quick Start<\/h2>\n<p>I assume you have already installed Groovy on your computer and added <code>GROOVY_HOME\/bin<\/code> to your <code>PATH<\/code> to run groovy binaries. You can open Groovy console by executing <code>groovyconsole<\/code> command. You will see Groovy Console GUI like following.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p><figure id=\"attachment_26966\" aria-describedby=\"caption-attachment-26966\" style=\"width: 860px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_1_final.jpg\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_1_final.jpg\" alt=\"Groovy Console Start\" width=\"860\" height=\"628\" class=\"size-full wp-image-26966\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_1_final.jpg 860w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_1_final-300x219.jpg 300w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><figcaption id=\"caption-attachment-26966\" class=\"wp-caption-text\">Groovy Console Start<\/figcaption><\/figure><\/p>\n<p>There are two area in the GUI: Input Area, Output Area. You can write your code in Input Area and click Run button at the top right of the GUI (or Ctrl + Enter), and see result in Output Area as below.<\/p>\n<p><figure id=\"attachment_26969\" aria-describedby=\"caption-attachment-26969\" style=\"width: 860px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_3_final.jpg\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_3_final.jpg\" alt=\"Groovy Console Input and Output Area\" width=\"860\" height=\"629\" class=\"size-full wp-image-26969\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_3_final.jpg 860w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_3_final-300x219.jpg 300w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><figcaption id=\"caption-attachment-26969\" class=\"wp-caption-text\">Groovy Console Input and Output Area<\/figcaption><\/figure><\/p>\n<p>As you can see, there are only codes in the output area, because results are printed in the command line console where you started Groovy Console from. If you want to see results also in the output area, you need to enable <b>Capture Standard Output<\/b> like below.<\/p>\n<p><figure id=\"attachment_26971\" aria-describedby=\"caption-attachment-26971\" style=\"width: 860px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_5_final.jpg\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_5_final.jpg\" alt=\"Enable Output Capture\" width=\"860\" height=\"656\" class=\"size-full wp-image-26971\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_5_final.jpg 860w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_5_final-300x229.jpg 300w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><figcaption id=\"caption-attachment-26971\" class=\"wp-caption-text\">Enable Output Capture<\/figcaption><\/figure><\/p>\n<p>You can also open Groovy script file by using <b>File &gt; Open<\/b> menu and the script will loaded in the input area. Then you can run loaded script.<\/p>\n<h2>4. Run Selection<\/h2>\n<p>Additionally, you can run only selected portion of the code in Input Area. If you select a section in the Input Area and click <strong>Run Selection (or Ctrl + Shift + R)<\/strong> in the <strong>Script<\/strong> menu, only the selected code will be executed as below.<\/p>\n<p><figure id=\"attachment_26976\" aria-describedby=\"caption-attachment-26976\" style=\"width: 860px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_6_final.jpg\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_6_final.jpg\" alt=\"Run Selection\" width=\"860\" height=\"654\" class=\"size-full wp-image-26976\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_6_final.jpg 860w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_6_final-300x228.jpg 300w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><figcaption id=\"caption-attachment-26976\" class=\"wp-caption-text\">Run Selection<\/figcaption><\/figure>[ulp id=&#8217;kHqyxwGNoyzYAfPN&#8217;]<\/p>\n<h2>5. Interruption<\/h2>\n<p>You can interrupt current running script in Groovy Console after enabling interruption by selecting <strong>Script &gt; Allow Interruption<\/strong> menu. What I mean by interruption here is interrupting current thread in running script. For example, in order to interrupt following script.<\/p>\n<pre class=\"brush:groovy\">try {\n    while(1) {\n        println \"something\"\n        Thread.currentThread().sleep(500)\n    }\n} catch(InterruptedException ex) {\n    println \"Interrupted from Groovy Console\"\n}\n<\/pre>\n<p>You can first Run script and then you can click <strong>Interrupt<\/strong> button on the right side of the <strong>Run<\/strong> button. You will see an output like below.<\/p>\n<p><figure id=\"attachment_26979\" aria-describedby=\"caption-attachment-26979\" style=\"width: 860px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_7_final.jpg\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_7_final.jpg\" alt=\"Interruption\" width=\"860\" height=\"611\" class=\"size-full wp-image-26979\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_7_final.jpg 860w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_7_final-300x213.jpg 300w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><figcaption id=\"caption-attachment-26979\" class=\"wp-caption-text\">Interruption<\/figcaption><\/figure><\/p>\n<h2>6. Embedding Console<\/h2>\n<p>If you want to use Groovy Console within your Java or Groovy application, you can easily embed Groovy Console by using following example.<\/p>\n<pre class=\"brush:groovy\">package main.java.javacodegeeks.groovyconsole\n\nimport groovy.ui.Console;\n\nclass GroovyConsole {\n\n\tstatic main(args) {\n\t\tConsole console = new Console();\n\t\tconsole.setVariable(\"name\", \"John\");\n\t\tconsole.setVariable(\"surname\", \"Doe\");\n\t\tconsole.run();\n\t}\n\t\n}\n<\/pre>\n<p>When you execute above script, you will see Groovy Console opened and variables <code>name<\/code> and <code>surname<\/code> will be predefined. And you will be able to use that variables. You can see an example below.<\/p>\n<p><figure id=\"attachment_26970\" aria-describedby=\"caption-attachment-26970\" style=\"width: 860px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_4_final.jpg\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_4_final.jpg\" alt=\"Groovy Console Embed Example\" width=\"860\" height=\"624\" class=\"size-full wp-image-26970\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_4_final.jpg 860w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/gc_4_final-300x218.jpg 300w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><figcaption id=\"caption-attachment-26970\" class=\"wp-caption-text\">Groovy Console Embed Example<\/figcaption><\/figure><\/p>\n<p>As you can see, we are able to use <code>$name<\/code> and <code>$surname<\/code> even if we did not explicitly defined them.<\/p>\n<h2>7. Conclusion<\/h2>\n<p>Groovy Console is an alternative to Groovy Sh or your favourite IDE. You can quickly write your code and execute to see what is going on with entire Groovy code. Also, you can embed Groovy Console to your application to define some variables to console and run it with that variables.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of the project here: <a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/GroovyConsoleExample.zip\"><strong>GroovyConsoleExample<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>1. Introduction In this tutorial, I will show you how to use Groovy Console to run your Groovy scripts and also give you some details about Groovy Console itself. Actually, there are several ways to run Groovy scripts. You can run it on your favourite IDE, you can run it from command line, or you &hellip;<\/p>\n","protected":false},"author":56,"featured_media":24987,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1216],"tags":[1200],"class_list":["post-26913","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-groovy","tag-groovyconsole"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Groovy Console Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"1. Introduction In this tutorial, I will show you how to use Groovy Console to run your Groovy scripts and also give you some details about Groovy Console\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Groovy Console Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"1. Introduction In this tutorial, I will show you how to use Groovy Console to run your Groovy scripts and also give you some details about Groovy Console\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2015-09-09T08:00:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-03-29T12:31:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/07\/groovy-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=\"Huseyin Babal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@huseyinbabal\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Huseyin Babal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/\"},\"author\":{\"name\":\"Huseyin Babal\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/a64b2fa737b82194b7dfc39117f4a237\"},\"headline\":\"Groovy Console Example\",\"datePublished\":\"2015-09-09T08:00:42+00:00\",\"dateModified\":\"2019-03-29T12:31:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/\"},\"wordCount\":709,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/07\/groovy-logo.jpg\",\"keywords\":[\"groovyconsole\"],\"articleSection\":[\"Groovy\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/\",\"name\":\"Groovy Console Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/07\/groovy-logo.jpg\",\"datePublished\":\"2015-09-09T08:00:42+00:00\",\"dateModified\":\"2019-03-29T12:31:49+00:00\",\"description\":\"1. Introduction In this tutorial, I will show you how to use Groovy Console to run your Groovy scripts and also give you some details about Groovy Console\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/07\/groovy-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/07\/groovy-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JVM Languages\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/jvm-languages\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Groovy\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/jvm-languages\/groovy\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Groovy Console Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/a64b2fa737b82194b7dfc39117f4a237\",\"name\":\"Huseyin Babal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/07\/Huseyin-Babal-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/07\/Huseyin-Babal-96x96.jpg\",\"caption\":\"Huseyin Babal\"},\"description\":\"Huseyin Babal has deep experience in Full Stack Development since 2007. He is mainly developing applications with JAVA, Spring, PHP, NodeJS, AngularJS. He is also interested in DevOps Engineering since 2013 and using AWS, Heroku for Cloud deployment and playing with Docker and Consul for implementing infinite scalable systems. He likes to share his experience in public conferences and perform advanced workshops about Full Stack Development and Devops. He is the author of NodeJS in Action course in Udemy.\",\"sameAs\":[\"http:\/\/huseyinbabal.net\",\"https:\/\/www.linkedin.com\/in\/huseyinbabal\",\"https:\/\/x.com\/huseyinbabal\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/huseyin-babal\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Groovy Console Example - Java Code Geeks","description":"1. Introduction In this tutorial, I will show you how to use Groovy Console to run your Groovy scripts and also give you some details about Groovy Console","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:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/","og_locale":"en_US","og_type":"article","og_title":"Groovy Console Example - Java Code Geeks","og_description":"1. Introduction In this tutorial, I will show you how to use Groovy Console to run your Groovy scripts and also give you some details about Groovy Console","og_url":"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2015-09-09T08:00:42+00:00","article_modified_time":"2019-03-29T12:31:49+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/07\/groovy-logo.jpg","type":"image\/jpeg"}],"author":"Huseyin Babal","twitter_card":"summary_large_image","twitter_creator":"@huseyinbabal","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Huseyin Babal","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/"},"author":{"name":"Huseyin Babal","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/a64b2fa737b82194b7dfc39117f4a237"},"headline":"Groovy Console Example","datePublished":"2015-09-09T08:00:42+00:00","dateModified":"2019-03-29T12:31:49+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/"},"wordCount":709,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/07\/groovy-logo.jpg","keywords":["groovyconsole"],"articleSection":["Groovy"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/","url":"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/","name":"Groovy Console Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/07\/groovy-logo.jpg","datePublished":"2015-09-09T08:00:42+00:00","dateModified":"2019-03-29T12:31:49+00:00","description":"1. Introduction In this tutorial, I will show you how to use Groovy Console to run your Groovy scripts and also give you some details about Groovy Console","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/07\/groovy-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/07\/groovy-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/groovy-console-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"JVM Languages","item":"https:\/\/examples.javacodegeeks.com\/category\/jvm-languages\/"},{"@type":"ListItem","position":3,"name":"Groovy","item":"https:\/\/examples.javacodegeeks.com\/category\/jvm-languages\/groovy\/"},{"@type":"ListItem","position":4,"name":"Groovy Console Example"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/a64b2fa737b82194b7dfc39117f4a237","name":"Huseyin Babal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/07\/Huseyin-Babal-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/07\/Huseyin-Babal-96x96.jpg","caption":"Huseyin Babal"},"description":"Huseyin Babal has deep experience in Full Stack Development since 2007. He is mainly developing applications with JAVA, Spring, PHP, NodeJS, AngularJS. He is also interested in DevOps Engineering since 2013 and using AWS, Heroku for Cloud deployment and playing with Docker and Consul for implementing infinite scalable systems. He likes to share his experience in public conferences and perform advanced workshops about Full Stack Development and Devops. He is the author of NodeJS in Action course in Udemy.","sameAs":["http:\/\/huseyinbabal.net","https:\/\/www.linkedin.com\/in\/huseyinbabal","https:\/\/x.com\/huseyinbabal"],"url":"https:\/\/examples.javacodegeeks.com\/author\/huseyin-babal\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/26913","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/56"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=26913"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/26913\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/24987"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=26913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=26913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=26913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}