{"id":3156,"date":"2016-02-14T03:31:41","date_gmt":"2016-02-14T03:31:41","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=3156"},"modified":"2016-02-14T03:31:41","modified_gmt":"2016-02-14T03:31:41","slug":"fixing-scaladoc-error-cannot-load-the-doclet-class","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/fixing-scaladoc-error-cannot-load-the-doclet-class\/","title":{"rendered":"Fixing scaladoc error &#8220;Cannot load the doclet class&#8221;"},"content":{"rendered":"<p>When running scaladoc with a custom generator, you can get the following error message:<\/p>\n<pre>\nerror: Cannot load the doclet class com.garysieling.MicroformatScalaDoc \n(specified with -doc-generator): java.lang.ClassNotFoundException: \ncom\/garysieling\/MicroformatScalaDoc. \n\nLeaving the default settings will generate the html version of scaladoc.\n<\/pre>\n<p>Unfortunately there are seven or eight different classpath arguments to scaladoc, which makes it tricky to execute. The key argument is &#8220;-toolcp&#8221;.<\/p>\n<p>If you&#8217;re writing a custom doclet, you need to depend on the build output of your project &#8211; with sbt this will be in the target\/scala-2.11\/classes:<\/p>\n<pre lang=\"bash\">\nexport CLASSPATH=.\/target\/scala-2.11\/classes\n\necho $CLASSPATH\n\nscaladoc -verbose \\\n         -doc-generator com.garysieling.CustomScalaDoc \\ \n         -toolcp $CLASSPATH \\\n         src\/main\/scala\/com\/garysieling\/microformat.scala\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>When running scaladoc with a custom generator, you can get the following error message: error: Cannot load the doclet class com.garysieling.MicroformatScalaDoc (specified with -doc-generator): java.lang.ClassNotFoundException: com\/garysieling\/MicroformatScalaDoc. Leaving the default settings will generate the html version of scaladoc. Unfortunately there are seven or eight different classpath arguments to scaladoc, which makes it tricky to execute. The &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.garysieling.com\/blog\/fixing-scaladoc-error-cannot-load-the-doclet-class\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Fixing scaladoc error &#8220;Cannot load the doclet class&#8221;&#8221;<\/span><\/a><\/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":[480,483],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/3156"}],"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=3156"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/3156\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=3156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=3156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=3156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}