# Developing a new library: error while creating javadoc and some general question

**URL:** <https://discourse.processing.org/t/developing-a-new-library-error-while-creating-javadoc-and-some-general-question/13863>\
**Category:** Development\
**Created:** [September 7, 2019, 11:31am UTC](https://discourse.processing.org/t/developing-a-new-library-error-while-creating-javadoc-and-some-general-question/13863 "2019-09-07T11:31:43Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![fedpep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/fedpep/32/52_2.png) [@fedpep](https://discourse.processing.org/u/fedpep)\
**Post date:** [September 7, 2019, 11:31am UTC](https://discourse.processing.org/t/developing-a-new-library-error-while-creating-javadoc-and-some-general-question/13863/1 "2019-09-07T11:31:44Z")

</div>

Hi, I’m working on a library for processing for the first time. I followed the guidelines on Github and downloaded the template.

Everything works correctly but I have an issue because when I run ant in eclipse it doesn’t create javadoc and I got this error

```auto
 [javadoc] Generating Javadoc
  [javadoc] Javadoc execution
  [javadoc] Loading source file /Users/federicopepe/GitHub/nice-color-palettes/tmp/NiceColorPalettes/src/nice/palettes/ColorPalette.java...
  [javadoc] Constructing Javadoc information...
  [javadoc] 1 error
  [javadoc] javadoc: error - An internal exception has occurred. 
  [javadoc] (java.lang.NoClassDefFoundError: com/sun/tools/doclets/Taglet)
  [javadoc] Please file a bug against the javadoc tool via the Java bug reporting page
  [javadoc] (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com)
  [javadoc] for duplicates. Include error messages and the following diagnostic in your report. Thank you.
  [javadoc] java.lang.NoClassDefFoundError: com/sun/tools/doclets/Taglet
  [javadoc] at java.base/java.lang.ClassLoader.defineClass1(Native Method)
  [javadoc] at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
  [javadoc] at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
  [javadoc] at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:550)
  [javadoc] at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:458)
  [javadoc] at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:452)
  [javadoc] at java.base/java.security.AccessController.doPrivileged(Native Method)
  [javadoc] at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:451)
  [javadoc] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
  [javadoc] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
  [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.taglets.TagletManager.addCustomTag(TagletManager.java:229)
  [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.initTagletManager(BaseConfiguration.java:837)
  [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.finishOptionSettings0(BaseConfiguration.java:777)
  [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlConfiguration.finishOptionSettings0(HtmlConfiguration.java:861)
  [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.setOptions(BaseConfiguration.java:798)
  [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:200)
  [javadoc] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.run(AbstractDoclet.java:114)
  [javadoc] at jdk.javadoc/jdk.javadoc.doclet.StandardDoclet.run(StandardDoclet.java:72)
  [javadoc] at jdk.javadoc/jdk.javadoc.internal.tool.Start.parseAndExecute(Start.java:582)
  [javadoc] at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:431)
  [javadoc] at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:344)
  [javadoc] at jdk.javadoc/jdk.javadoc.internal.tool.Main.execute(Main.java:63)
  [javadoc] at jdk.javadoc/jdk.javadoc.internal.tool.Main.main(Main.java:52)
  [javadoc] Caused by: java.lang.ClassNotFoundException: com.sun.tools.doclets.Taglet
  [javadoc] at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
  [javadoc] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
  [javadoc] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
  [javadoc] ... 23 more

```

I also saw there’s an issue posted on GitHub but couldn’t find the solution.

Beside that I would like to know if there are some rules/suggestion/standards about naming methods, parameters etc in my library. I hope my library will be used by many people and I want it to be simple and straightforward.

Thanks

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [September 8, 2019, 12:50am UTC](https://discourse.processing.org/t/developing-a-new-library-error-while-creating-javadoc-and-some-general-question/13863/2 "2019-09-08T00:50:54Z")

</div>

> [@fedpep](#):
>
> there’s an issue posted on GitHub but couldn’t find the solution.

> <https://github.com/processing/processing-library-template/issues/19>
>
> When I run the Processing template targeting Java SE-1.8, the 
> 
> \> \[javadoc\] Co…nstructing Javadoc information...
> \> \[javadoc\] Standard Doclet version 10.0.1
> \> \[javadoc\] Building tree for all the packages and classes...
> \> \[javadoc\] javadoc: error - Error - Exception java.lang.ClassNotFoundException thrown while trying to register Taglet ExampleTaglet...
> 
> In the Processing Library template there is a file
> 
> resources \> code \> ExampleTaglet.java
> 
> It begins with
> 
> import com.sun.tools.doclets.Taglet;
> 
> I think that in Java 8+ that would instead would be:
> 
> import java.jdk.Taglet;
> 
> ...I'm not sure if there are other changes that would need to be made.
> 
> I am not familiar with doclets and Taglets -- looking over the code, it isn't clear to me why ExampleTaglet would actually be used -- although is referenced in Ant's build.xml:
> 
> \<taglet name="ExampleTaglet" path="resources/code" /\>
> 
> Anyway, when it fails the documentation as a whole fails to build.
> 
> Assuming this is a problem for others, it seems like either ExampleTaglet should be fixed or it should be removed from build.xml to not block javadoc generation.
> 
> My solution was to remove the above \<taglet\> line from build.xml.

Here are two possible solutions:

1. remove this line from build.xml.

2. make sure that the Eclipse project is using Java 8 – not just targeting 8 but using a built-in Java 10 or 11. Under Your project \> Properties \> Java Build Path \> Libraries, confirm that you see JavaSE 1.8

---

<div class="post-metadata">

**Author:** ![fedpep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/fedpep/32/52_2.png) [@fedpep](https://discourse.processing.org/u/fedpep)\
**Post date:** [September 8, 2019, 10:52am UTC](https://discourse.processing.org/t/developing-a-new-library-error-while-creating-javadoc-and-some-general-question/13863/3 "2019-09-08T10:52:20Z")

</div>

Hi @jeremydouglass, I was not using JavaSE 1.8.

Now I changed it in the Java Build Path as shown in the screenshot but the error persist while generating the javadoc

 ![52](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/7/767f19520557499ae686eb0226430a0c5dd26165.png)

Then I deleted the line from build.xml and it seems to work.

---

<div class="post-metadata">

**Author:** ![fedpep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/fedpep/32/52_2.png) [@fedpep](https://discourse.processing.org/u/fedpep)\
**Post date:** [September 10, 2019, 4:33pm UTC](https://discourse.processing.org/t/developing-a-new-library-error-while-creating-javadoc-and-some-general-question/13863/4 "2019-09-10T16:33:54Z")

</div>

Any hint on rules/standards to follow?

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [September 10, 2019, 5:40pm UTC](https://discourse.processing.org/t/developing-a-new-library-error-while-creating-javadoc-and-some-general-question/13863/5 "2019-09-10T17:40:46Z")

</div>

What do you mean? I’m not sure that I understand this question.

---

<div class="post-metadata">

**Author:** ![fedpep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/fedpep/32/52_2.png) [@fedpep](https://discourse.processing.org/u/fedpep)\
**Post date:** [September 11, 2019, 10:11am UTC](https://discourse.processing.org/t/developing-a-new-library-error-while-creating-javadoc-and-some-general-question/13863/6 "2019-09-11T10:11:17Z")

</div>

@jeremydouglass as I said this is the first time I’m developing a Library for Processing. Since the Library is something that I’m creating from scratch it reflects the way I usually write code (and I am a self-taught programmer) so I was wondering if there are some kind of standards on naming variables or methods for example: if I got a a method that returns a random value how should I call it? getValueRandom, getRandomValue etc?

Probably I should just worry less, write my library, write a good documentation and just let the people use it and send suggestion on GitHub 😃

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [September 11, 2019, 3:58pm UTC](https://discourse.processing.org/t/developing-a-new-library-error-while-creating-javadoc-and-some-general-question/13863/7 "2019-09-11T15:58:05Z")

</div>

Good question.

Yes, just do it and get feedback --don’t get bogged down.

That said, I would suggest models. Look at 2-3 Processing libraries that you like and appreciate and browse their documentation and source code, looking at how they do everything – what do you like and not like about what they did? You will discover than many libraries are quite different from each other – there isn’t one standard approach.

Also, keep in mind that good bundled examples are going to matter even more than good javadoc – that is what most of your users will look at first, and they will assume that the example set has reasonable coverage of what your library can do. If they don’t find ready examples to run and then adapt, they may move on.

For naming, keep in mind that your library co-exists with the Processing API – so you often want to either align it or disambiguate it. For example, if you were writing a kaleidoscope library that creates a Kaleidoscope ks object, you might decide that ks.tint() will tint it (just like the Processing canvas), but that ks.random() looks like returning a random number – and instead you want to call that ks.randomLayout() to distinguish it. Often writing non-trivial example sketches helps work these namespace issues out, because you will better notice things that are confusing or unclear and might be renamed when you class methods are being mixed in with normal sketch functions.

---

<div class="post-metadata">

**Author:** ![fedpep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/fedpep/32/52_2.png) [@fedpep](https://discourse.processing.org/u/fedpep)\
**Post date:** [September 13, 2019, 1:39pm UTC](https://discourse.processing.org/t/developing-a-new-library-error-while-creating-javadoc-and-some-general-question/13863/8 "2019-09-13T13:39:35Z")

</div>

Thanks! I just released the first beta of the library: [https://github.com/federico-pepe/nice-color-palettes](https://github.com/federico-pepe/nice-color-palettes) 🙂

I will use it in a workshop tomorrow so I’ll have a feedback from some users.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [September 13, 2019, 2:35pm UTC](https://discourse.processing.org/t/developing-a-new-library-error-while-creating-javadoc-and-some-general-question/13863/9 "2019-09-13T14:35:37Z")

</div>

Very nice! It looks really good. Thanks so much for sharing this! Have you looked at other color libraries?

Minor suggestions:

1. Add an explicit getPalleteCount() so that you can know how many are available.

2. Drop the random “seed” println log line. If you do anything in a loop with this function it could spam the console and slow the sketch–and anyone who needs to know their random index can just create their own, then they know it, e.g.

```auto
int rindex = (int)random(getPalleteCount()-1);
int[] rpallete = getPallete(rindex);

```

Finally, this is a question of style, but I would personally suggest dropping the fail-to-random design for getPallete(i). Just have it fail. If someone doesn’t care what they get, they can use getPallete(). If they do care and use getPallete(i), they should get an error to debug – or that could optionally be handled with `try`. This also gets away from potentially printing tons of console warnings in a loop.

---

<div class="post-metadata">

**Author:** ![fedpep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/fedpep/32/52_2.png) [@fedpep](https://discourse.processing.org/u/fedpep)\
**Post date:** [September 13, 2019, 3:10pm UTC](https://discourse.processing.org/t/developing-a-new-library-error-while-creating-javadoc-and-some-general-question/13863/10 "2019-09-13T15:10:19Z")

</div>

Thanks for this feedback. This is exactly what I needed.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [September 13, 2019, 4:41pm UTC](https://discourse.processing.org/t/developing-a-new-library-error-while-creating-javadoc-and-some-general-question/13863/11 "2019-09-13T16:41:02Z")

</div>

A suggestion – your github repo forked the template-- that’s a problem, because now your library appears to be one of 380+ forks contributing to the template, and it isn’t.

If instead you click on the green “Use this template” button on the original template repo then you get all the benefits of github – people can fork you and contribute to you, etc. You will have to move your commits onto the new template-fork, but it is a much nicer setup.

---

<div class="post-metadata">

**Author:** ![fedpep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/fedpep/32/52_2.png) [@fedpep](https://discourse.processing.org/u/fedpep)\
**Post date:** [September 13, 2019, 5:48pm UTC](https://discourse.processing.org/t/developing-a-new-library-error-while-creating-javadoc-and-some-general-question/13863/12 "2019-09-13T17:48:52Z")

</div>

I just deleted the old repo and created a new one. Everything should be alright. Thanks for this tip as well 🙂
