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
⌛
This post has been reserved for your question.
Hey @userexit! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose 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.
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"what is a maven archetype ?
a template for a Maven project
If you run
mvn archetype:generate
, Maven will create a new Maven project using an archetypeso using a template
pretty much yes
groupId: bigsnake
artifactId: bigger
version: snapshotname
package: bigsnake
what are tehse ?
these are configurations used by the template
the group id is pretty much specifying what/who the project belongs to
do they mean anything important ?
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
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 ?
Do you have any dependencies?
?
some yea
why would that mateR ?
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
nice
ty
💤
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.