Closed nishakm closed 8 months ago
@nishakm can you paste the value of the environment variable JAVA_HOME
(e.g. printenv JAVA_HOME
)?
Actually, looking at the above, it looks like javadoc is in the bin directory - it may not be in the JAVA_HOME
directory which is where the Maven plugin is looking for it.
@nishakm - were you able to get this to work? Should we close this issue?
@goneall I haven't tried since. I'll give it a try after I update my working branch and report back.
I can't get rid of the error. My JAVA_HOME
was not set. I set it to /usr
(which I think is what mvn is looking for: '${env.JAVA_HOME}/bin/javadoc'
) but I get another error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9:jar (attach-javadocs) on project tools-java: MavenReportException: Error while creating archive:
[ERROR] Exit code: 1 - /home/nisha/tools-java/src/main/java/org/spdx/tools/SpdxConverter.java:31: error: cannot access RdfStore
[ERROR] import org.spdx.spdxRdfStore.RdfStore;
[ERROR] ^
[ERROR] bad class file: /home/nisha/.m2/repository/org/spdx/spdx-rdf-store/1.1.9/spdx-rdf-store-1.1.9.jar(org/spdx/spdxRdfStore/RdfStore.class)
[ERROR] class file has wrong version 55.0, should be 52.0
[ERROR] Please remove or make sure it appears in the correct subdirectory of the classpath.
[ERROR]
[ERROR] Command line was: /usr/bin/javadoc @options @packages
[ERROR]
[ERROR] Refer to the generated Javadoc files in '/home/nisha/tools-java/target/apidocs' dir.
@nishakm - you did fix the JavaDocs issue :)
You're now onto a different issue :(
What version of Java are you using? The RDFStore feature requires version 11 or above.
You can run java --version
to find it.
@goneall my java version:
$ java --version
openjdk 11.0.21 2023-10-17
OpenJDK Runtime Environment (build 11.0.21+9-post-Ubuntu-0ubuntu122.04)
OpenJDK 64-Bit Server VM (build 11.0.21+9-post-Ubuntu-0ubuntu122.04, mixed mode, sharing)
In looking more closely at the error message, it looks like JavaDocs is erroring out which is unusual since it already compiled.
My guess is that you have more than one Java version installed and you may have set JAVA_HOME
to a version 8 rather than the default version 11.
Try executing ${env.JAVA_HOME}/bin/java --version
and see what you get.
Looks like my jdk
version is 11 but my javac
version is still 1.8. Let me see if I can resolve this, but it looks like it's my installation's fault and not a code bug. So I will close this issue.
I upgraded my javac
version (not particularly straightforward to do) and that fixed it!
mvn clean install
gives me an error:I do have javadoc installed though:
My java environment: