{"id":8599,"date":"2018-05-01T09:30:54","date_gmt":"2018-05-01T02:30:54","guid":{"rendered":"https:\/\/huongdanjava.com\/?p=8599"},"modified":"2024-11-30T14:48:09","modified_gmt":"2024-11-30T07:48:09","slug":"java-console-application-with-spring-boot","status":"publish","type":"post","link":"https:\/\/huongdanjava.com\/java-console-application-with-spring-boot.html","title":{"rendered":"Java console application with Spring Boot"},"content":{"rendered":"<p>By default, when we create a Spring Boot project, it will run as a web application with an embedded web container such as Tomcat, Jetty&#8230; So in case we want to run the Spring Boot project as a normal Java console, how do we do it? In this tutorial, I will guide you on how to create a Java application console with your Spring Boot project.<\/p>\n<p>First of all, you also create a normal Spring Boot project using the Spring Tool Suite IDE or the Spring Initializr Web, but note that in the dependencies section, you do not select anything.<\/p>\n<p>My example is as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8602 size-full\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2018\/05\/java-console-application-with-spring-boot-2.png\" alt=\"Java console application with Spring Boot\" width=\"700\" height=\"468\" \/><\/p>\n<p><strong>To run this example as a Java console application, add an implementation for the CommandLineRunner interface to the main class of the Spring Boot application.<\/strong><\/p>\n<p>In my example SpringBootConsoleApplication class:<\/p>\n<pre class=\"lang:java decode:true \">package com.huongdanjava.springboot;\r\n\r\nimport org.springframework.boot.CommandLineRunner;\r\nimport org.springframework.boot.SpringApplication;\r\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\r\n\r\n@SpringBootApplication\r\npublic class SpringBootConsoleApplication implements CommandLineRunner {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tSpringApplication.run(SpringBootConsoleApplication.class, args);\r\n\t}\r\n}\r\n<\/pre>\n<p>This CommandLineRunner interface has a method that we must implement, which is the run() method. This is also the method that allows us to execute code under the console.<\/p>\n<p>For example, if I want to print a message in the console, I will code as follows:<\/p>\n<pre class=\"lang:java decode:true \">package com.huongdanjava.springboot;\r\n\r\nimport org.springframework.boot.CommandLineRunner;\r\nimport org.springframework.boot.SpringApplication;\r\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\r\n\r\n@SpringBootApplication\r\npublic class SpringBootConsoleApplication implements CommandLineRunner {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tSpringApplication.run(SpringBootConsoleApplication.class, args);\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void run(String... args) throws Exception {\r\n\t\tSystem.out.println(\"Hello from Huong Dan Java\");\r\n\t}\r\n}\r\n<\/pre>\n<p>Result:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8603 size-full\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2018\/05\/java-console-application-with-spring-boot-3.png\" alt=\"Java console application with Spring Boot\" width=\"700\" height=\"701\" \/><\/p>\n<p>Let&#8217;s say we now have a HelloWorld bean with the following content:<\/p>\n<pre class=\"lang:java decode:true \">package com.huongdanjava.springboot;\r\n\r\nimport org.springframework.stereotype.Component;\r\n\r\n@Component\r\npublic class HelloWorld {\r\n\r\n\tpublic void say() {\r\n\t\tSystem.out.println(\"Hello, Khanh\");\r\n\t}\r\n}\r\n<\/pre>\n<p>Then, we can use the HelloWorld bean as follows:<\/p>\n<pre class=\"lang:java decode:true \">package com.huongdanjava.springboot;\r\n\r\nimport org.springframework.beans.factory.annotation.Autowired;\r\nimport org.springframework.boot.CommandLineRunner;\r\nimport org.springframework.boot.SpringApplication;\r\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\r\n\r\n@SpringBootApplication\r\npublic class SpringBootConsoleApplication implements CommandLineRunner {\r\n\t\r\n\t@Autowired\r\n\tprivate HelloWorld helloWorld;\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tSpringApplication.run(SpringBootConsoleApplication.class, args);\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void run(String... args) throws Exception {\r\n\t\thelloWorld.say();\r\n\t}\r\n}\r\n<\/pre>\n<p>Result:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8604 size-full\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2018\/05\/java-console-application-with-spring-boot-4.png\" alt=\"Java console application with Spring Boot\" width=\"700\" height=\"754\" \/><\/p>\n<p><strong>In addition to the above implementation declaration, there is another way that you can also define a Bean for the CommandLinerRunner interface.<\/strong><\/p>\n<p>For example:<\/p>\n<pre class=\"lang:java mark:20-25 decode:true \">package com.huongdanjava.springboot;\r\n\r\nimport org.springframework.beans.factory.annotation.Autowired;\r\nimport org.springframework.boot.CommandLineRunner;\r\nimport org.springframework.boot.SpringApplication;\r\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\r\nimport org.springframework.context.ApplicationContext;\r\nimport org.springframework.context.annotation.Bean;\r\n\r\n@SpringBootApplication\r\npublic class SpringBootConsoleApplication {\r\n\r\n  @Autowired\r\n  private HelloWorld helloWorld;\r\n\r\n  public static void main(String[] args) {\r\n    SpringApplication.run(SpringBootConsoleApplication.class, args);\r\n  }\r\n\r\n  @Bean\r\n  public CommandLineRunner commandLineRunner(ApplicationContext ctx) {\r\n    return args -&gt; {\r\n      helloWorld.say();\r\n    };\r\n  }\r\n}\r\n<\/pre>\n<p>The result will be the same as above!<\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-right kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;right&quot;,&quot;id&quot;:&quot;8599&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;2&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;3&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;4&quot;,&quot;greet&quot;:&quot;&quot;,&quot;legend&quot;:&quot;3\\\/5 - (2 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;Java console application with Spring Boot&quot;,&quot;width&quot;:&quot;82&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 82px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            3\/5 - (2 votes)    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>By default, when we create a Spring Boot project, it will run as a web application with an embedded web container such as Tomcat, Jetty&#8230; So in case we want to run the Spring Boot project as a normal Java console, how do we do&hellip; <a href=\"https:\/\/huongdanjava.com\/java-console-application-with-spring-boot.html\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":1680,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[582],"tags":[],"class_list":["post-8599","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring-boot","clearfix"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Java console application with Spring Boot - Huong Dan Java<\/title>\n<meta name=\"description\" content=\"In this tutorial, I show you how to create a Java console application with Spring Boot.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/huongdanjava.com\/java-console-application-with-spring-boot.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java console application with Spring Boot - Huong Dan Java\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, I show you how to create a Java console application with Spring Boot.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/huongdanjava.com\/java-console-application-with-spring-boot.html\" \/>\n<meta property=\"og:site_name\" content=\"Huong Dan Java\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/nhkhanh2406\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/nhkhanh2406\" \/>\n<meta property=\"article:published_time\" content=\"2018-05-01T02:30:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-30T07:48:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2016\/10\/spring-boot.png\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Khanh Nguyen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/KhanhNguyenJ\" \/>\n<meta name=\"twitter:site\" content=\"@KhanhNguyenJ\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Khanh Nguyen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/java-console-application-with-spring-boot.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/java-console-application-with-spring-boot.html\"},\"author\":{\"name\":\"Khanh Nguyen\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\"},\"headline\":\"Java console application with Spring Boot\",\"datePublished\":\"2018-05-01T02:30:54+00:00\",\"dateModified\":\"2024-11-30T07:48:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/java-console-application-with-spring-boot.html\"},\"wordCount\":242,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\"},\"image\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/java-console-application-with-spring-boot.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2016\\\/10\\\/spring-boot.png\",\"articleSection\":[\"Spring Boot\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/huongdanjava.com\\\/java-console-application-with-spring-boot.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/java-console-application-with-spring-boot.html\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/java-console-application-with-spring-boot.html\",\"name\":\"Java console application with Spring Boot - Huong Dan Java\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/java-console-application-with-spring-boot.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/java-console-application-with-spring-boot.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2016\\\/10\\\/spring-boot.png\",\"datePublished\":\"2018-05-01T02:30:54+00:00\",\"dateModified\":\"2024-11-30T07:48:09+00:00\",\"description\":\"In this tutorial, I show you how to create a Java console application with Spring Boot.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/java-console-application-with-spring-boot.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/huongdanjava.com\\\/java-console-application-with-spring-boot.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/java-console-application-with-spring-boot.html#primaryimage\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2016\\\/10\\\/spring-boot.png\",\"contentUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2016\\\/10\\\/spring-boot.png\",\"width\":300,\"height\":300},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/java-console-application-with-spring-boot.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/huongdanjava.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java console application with Spring Boot\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#website\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/\",\"name\":\"Huong Dan Java\",\"description\":\"Java development tutorials\",\"publisher\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/huongdanjava.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\",\"name\":\"Khanh Nguyen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\",\"contentUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\",\"width\":1267,\"height\":1517,\"caption\":\"Khanh Nguyen\"},\"logo\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\"},\"description\":\"I love Java and everything related to Java.\",\"sameAs\":[\"https:\\\/\\\/huongdanjava.com\",\"https:\\\/\\\/www.facebook.com\\\/nhkhanh2406\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/KhanhNguyenJ\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java console application with Spring Boot - Huong Dan Java","description":"In this tutorial, I show you how to create a Java console application with Spring Boot.","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:\/\/huongdanjava.com\/java-console-application-with-spring-boot.html","og_locale":"en_US","og_type":"article","og_title":"Java console application with Spring Boot - Huong Dan Java","og_description":"In this tutorial, I show you how to create a Java console application with Spring Boot.","og_url":"https:\/\/huongdanjava.com\/java-console-application-with-spring-boot.html","og_site_name":"Huong Dan Java","article_publisher":"https:\/\/www.facebook.com\/nhkhanh2406","article_author":"https:\/\/www.facebook.com\/nhkhanh2406","article_published_time":"2018-05-01T02:30:54+00:00","article_modified_time":"2024-11-30T07:48:09+00:00","og_image":[{"width":300,"height":300,"url":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2016\/10\/spring-boot.png","type":"image\/png"}],"author":"Khanh Nguyen","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/KhanhNguyenJ","twitter_site":"@KhanhNguyenJ","twitter_misc":{"Written by":"Khanh Nguyen","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/huongdanjava.com\/java-console-application-with-spring-boot.html#article","isPartOf":{"@id":"https:\/\/huongdanjava.com\/java-console-application-with-spring-boot.html"},"author":{"name":"Khanh Nguyen","@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d"},"headline":"Java console application with Spring Boot","datePublished":"2018-05-01T02:30:54+00:00","dateModified":"2024-11-30T07:48:09+00:00","mainEntityOfPage":{"@id":"https:\/\/huongdanjava.com\/java-console-application-with-spring-boot.html"},"wordCount":242,"commentCount":0,"publisher":{"@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d"},"image":{"@id":"https:\/\/huongdanjava.com\/java-console-application-with-spring-boot.html#primaryimage"},"thumbnailUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2016\/10\/spring-boot.png","articleSection":["Spring Boot"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/huongdanjava.com\/java-console-application-with-spring-boot.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/huongdanjava.com\/java-console-application-with-spring-boot.html","url":"https:\/\/huongdanjava.com\/java-console-application-with-spring-boot.html","name":"Java console application with Spring Boot - Huong Dan Java","isPartOf":{"@id":"https:\/\/huongdanjava.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/huongdanjava.com\/java-console-application-with-spring-boot.html#primaryimage"},"image":{"@id":"https:\/\/huongdanjava.com\/java-console-application-with-spring-boot.html#primaryimage"},"thumbnailUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2016\/10\/spring-boot.png","datePublished":"2018-05-01T02:30:54+00:00","dateModified":"2024-11-30T07:48:09+00:00","description":"In this tutorial, I show you how to create a Java console application with Spring Boot.","breadcrumb":{"@id":"https:\/\/huongdanjava.com\/java-console-application-with-spring-boot.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/huongdanjava.com\/java-console-application-with-spring-boot.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/huongdanjava.com\/java-console-application-with-spring-boot.html#primaryimage","url":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2016\/10\/spring-boot.png","contentUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2016\/10\/spring-boot.png","width":300,"height":300},{"@type":"BreadcrumbList","@id":"https:\/\/huongdanjava.com\/java-console-application-with-spring-boot.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/huongdanjava.com\/"},{"@type":"ListItem","position":2,"name":"Java console application with Spring Boot"}]},{"@type":"WebSite","@id":"https:\/\/huongdanjava.com\/#website","url":"https:\/\/huongdanjava.com\/","name":"Huong Dan Java","description":"Java development tutorials","publisher":{"@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/huongdanjava.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d","name":"Khanh Nguyen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg","url":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg","contentUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg","width":1267,"height":1517,"caption":"Khanh Nguyen"},"logo":{"@id":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg"},"description":"I love Java and everything related to Java.","sameAs":["https:\/\/huongdanjava.com","https:\/\/www.facebook.com\/nhkhanh2406","https:\/\/x.com\/https:\/\/twitter.com\/KhanhNguyenJ"]}]}},"_links":{"self":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts\/8599","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/comments?post=8599"}],"version-history":[{"count":7,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts\/8599\/revisions"}],"predecessor-version":[{"id":23636,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts\/8599\/revisions\/23636"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/media\/1680"}],"wp:attachment":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/media?parent=8599"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/categories?post=8599"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/tags?post=8599"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}