Processing JavaDoc index.html

Hi all,

I’m trying to generate a structured overview of my code in Processing (similar to a JavaDoc I believe). I added some doc comments, after which I do: ‘file --> export application --> windows’, from the PDE. According to this reference:

https://processing.org/reference/doccomment.html

This should then create an index.html file, with the comments in it. This is the file I use to test with:

void setup(){
    size(100,100);
}

void draw(){
    exit();
}

/**
This is a description for function T1
@param t temperature
@param tp previous temperature
*/
float calculateT1 (float t, float tp){
    return t + tp;
}

However, the index.html file is not generated. Am I missing something here? Thanks in advance.

Kind regards,
Thomas

1 Like

I tried and apparently the PDE doesn’t create any documentation. Maybe it used to work in the past?

But it worked doing this:

  1. I exported the sketch using the PDE. This created a bunch of folders including java files.

  2. I run this command in the root of those folders:

    javadoc -d docs ./application.linux32/source/*java

Match the linux32 part with whatever folder it was created when exporting. That creates a docs/ folder with the documentation coming from the javadoc annotations.

Idea and other IDEs have integrated javadoc I think, so no need for command line work.

3 Likes

Thank you @hamoid for your quick response. Unfortunately, this does not work for me. I’m on Windows 10, installed Java and added the JAVA_HOME system variable to my path (am I missing any other?). I get the following error:

javadoc : The term 'javadoc' is not recognized as the name of a cmdlet, function, script file, or operable program. Che
ck the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ javadoc -d docs ./application.windows64/source/*java
+ ~~~~~~~
    + CategoryInfo          : ObjectNotFound: (javadoc:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

What else can I try? Also, I did not understand the difference between Java jre and jdk? Thanks in advance

1 Like

I just checked on my Win 10.

javadoc is not part of the jre folder. (Java runtime environment)

https://www.oracle.com/technetwork/java/javase/documentation/javadoc-137458.html

It’s only part of the Java 2 SDK. This contains JRE and compiler and debugger (160 MB I think)

https://www.oracle.com/technetwork/java/javase/install-140406.html

PATH

also when you have javadoc, make sure windows knows the path of it:

(example from another program)

https://docs.telerik.com/teststudio/features/test-runners/add-path-environment-variables

3 Likes

I installed Java JDK from here:
https://www.oracle.com/technetwork/java/javase/downloads/jdk13-downloads-5672538.html
and javadoc is now recognised from the terminal. However, if I run this:

javadoc -d .\application.windows64\source\*java

from the folder where my .pde file is located, I get the following error:

javadoc: error - No modules, packages or classes specified.
1 error

Thank you all for helping me.

Thomas

maybe that’s a spelling error

try ..............*.java

with dot please

also check out

1 Like

I just downloaded https://en.wikipedia.org/wiki/Doxygen

which works and has a graphical GUI

2 Likes

Unfortunately, running javadoc -d .\application.windows64\source\*.java gives this error:

javadoc: error - No modules, packages or classes specified.
1 error

check out https://stackoverflow.com/questions/9993117/how-to-compile-javadoc-from-sources-in-simplest-way

If you want to do inside Idea: https://www.jetbrains.com/help/idea/working-with-code-documentation.html#

I downloaded doxygen from here:
http://www.doxygen.nl/download.html
Everything was straightforward from there on.
Strange that this functionality is not included in the Processing IDE :thinking:

Thank you so much.

1 Like

Great, it works now.

Happy to hear that

I was interested in a tool that points me to
architectural errors.

And shows which class is using which other class (network of dependencies / hierarchy) in a graphical way

An architectural error would be when

  • there would be a circle dependency between two classes or
  • a class would access an array of the same class on sketch level

@Thomas thanks for reporting this.

I’m seeing the same thing on MacOS 10.12 – Processing 3.4 and 3.5.

I have opened an issue in the docs here:

As per the issue, it looks like that documentation was long out of date – creating a documentation index.html hasn’t been a PDE feature for a long time:

that dates back to applet export. It should just be removed

I submitted a pull request to fix it up with mention of javadoc, Doxygen, and IDEs as alternatives.

2 Likes