Syntax questions

Id like to know what these syntaxes mean: javadoc -d doc Hello.java jar -cf hello.jar Hello.class java -cp hello.jar Hello
16 Replies
JavaBot
JavaBot4w ago
This post has been reserved for your question.
Hey @userexit! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st4w ago
javadoc -d doc Hello.java means create the Javadoc HTML documentation of Hello.java and put it in a doc directory jar -cf hello.jar Hello.class means "create a JAR file named hello.jar with the Hello class" java -cp hello.jar Hello means "Run a Java application where you can load classes from hello.jar and run the Hello class"
userexit
userexitOP4w ago
what is a maven archetype ?
dan1st
dan1st4w ago
a template for a Maven project If you run mvn archetype:generate, Maven will create a new Maven project using an archetype
userexit
userexitOP4w ago
so using a template
dan1st
dan1st4w ago
pretty much yes
userexit
userexitOP4w ago
groupId: bigsnake artifactId: bigger version: snapshotname package: bigsnake what are tehse ?
dan1st
dan1st4w ago
these are configurations used by the template the group id is pretty much specifying what/who the project belongs to
userexit
userexitOP4w ago
do they mean anything important ?
dan1st
dan1st4w ago
the artifact ID is the project id (pretty much the project name) which should be unique in combination with the group id the version is the version of the project and the package is which package you want to use
userexit
userexitOP4w ago
oh okay and once i do mvn package to compile into a jar how do i execute a certain class from it if i have specified those values there groupId: bigsnake artifactId: bigger version: snapshotname package: bigsnake the group id ?
dan1st
dan1st4w ago
Do you have any dependencies? ?
userexit
userexitOP4w ago
some yea why would that mateR ?
dan1st
dan1st4w ago
The JAR generated by mvn package doesn't include dependencies so if you run it, you would also need to tell it where he dependencies are the easiest way is to run mvn dependency:copy-dependencies. That will copy all dependencies to a subfolder inside target
userexit
userexitOP4w ago
nice ty
JavaBot
JavaBot4w ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Want results from more Discord servers?
Add your server