{"id":3450,"date":"2016-03-17T00:30:04","date_gmt":"2016-03-17T00:30:04","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=3450"},"modified":"2016-03-17T00:30:04","modified_gmt":"2016-03-17T00:30:04","slug":"fixing-sbt-error-java-lang-runtimeexception-no-main-class-detected","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/fixing-sbt-error-java-lang-runtimeexception-no-main-class-detected\/","title":{"rendered":"Fixing sbt error: java.lang.RuntimeException: No main class detected."},"content":{"rendered":"<p>If you set up a scala project and try to build with sbt, you can get this error:<\/p>\n<p class=\"p1\"><span class=\"s1\">java.lang.RuntimeException: No main class detected.<\/span><\/p>\n<p>This is caused by setting up the project incorrectly, like so:<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/172.104.26.128\/wp-content\/uploads\/2016\/03\/Screen-Shot-2016-03-16-at-8.27.07-PM.png\" alt=\"Intellij Project\" width=\"313\" height=\"212\" class=\"aligncenter size-full wp-image-3452\" srcset=\"https:\/\/www.garysieling.com\/blog\/wp-content\/uploads\/2016\/03\/Screen-Shot-2016-03-16-at-8.27.07-PM.png 313w, https:\/\/www.garysieling.com\/blog\/wp-content\/uploads\/2016\/03\/Screen-Shot-2016-03-16-at-8.27.07-PM-300x203.png 300w\" sizes=\"(max-width: 313px) 100vw, 313px\" \/><\/p>\n<p>To fix this, move your main class into src\/main\/scala (this structure comes from the standard maven project structure):<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/172.104.26.128\/wp-content\/uploads\/2016\/03\/Screen-Shot-2016-03-16-at-8.37.12-PM.png\" alt=\"Intellij Idea: correct project structure for a scala project\" width=\"313\" height=\"232\" class=\"aligncenter size-full wp-image-3453\" srcset=\"https:\/\/www.garysieling.com\/blog\/wp-content\/uploads\/2016\/03\/Screen-Shot-2016-03-16-at-8.37.12-PM.png 313w, https:\/\/www.garysieling.com\/blog\/wp-content\/uploads\/2016\/03\/Screen-Shot-2016-03-16-at-8.37.12-PM-300x222.png 300w\" sizes=\"(max-width: 313px) 100vw, 313px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you set up a scala project and try to build with sbt, you can get this error: java.lang.RuntimeException: No main class detected. This is caused by setting up the project incorrectly, like so: To fix this, move your main class into src\/main\/scala (this structure comes from the standard maven project structure):<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[9],"tags":[284,290,300,362,479,480],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/3450"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=3450"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/3450\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=3450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=3450"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=3450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}