This question already has answers here:
How do I load optional task sshexec into Ant in a no-configuration manner?
(2 answers)
Closed 6 years ago.
How to include jsch-0.1.53.jar file in build.xml (to execute ant sshexec and scp) other than passing as command line argument - lib jsch-0.1.53.jar?
The easiest way, if you have the possibility, is copy it into your ant lib installation
Related
This question already has answers here:
How do I run a class in a WAR from the command line?
(11 answers)
Closed 5 years ago.
I am web-development noob and use vaadin 8 for an application and gradle to build the war-file. How can I run the apllication file from command line?
I tried this without success:
java -cp root.war my.namespace.RootServlet
The class is not found.
That will only work if you have an embedded servlet container inside the WAR, that is defined as main class in your manifest file. See the following answer to a similar question:
https://stackoverflow.com/a/3804844/8819761
This question already has answers here:
Is Maven ready for JDK9?
(6 answers)
Closed 5 years ago.
In Java 9, you can create a JAR file with
jar --create --file=mlib/com.greetings.jar --main-class=com.greetings.Main -C mods/com.greetings .
Which has the side effect of adding the MainClass attribute to the module-info.class file in the .jar file.
Do any of the plugins support this yet, or do I need to invoke the Java 9 'jar' command directly?
Is this the right forum to be asking these questions, or is there a better place?
Cheers, Eric
The 'module main class' is actually an attribute of the module-info.class file. It's called ModuleMainClass and set by the Java 9's jar command. The current version (3.0.2) of maven-jar-plugin only writes the file when you specify the manifest.mainClass
This question already has answers here:
Use of the MANIFEST.MF file in Java
(2 answers)
Closed 6 years ago.
I have a basic question about the manifest file: when is this file created?
Is it created in the .class file when we compile a java file? Or should we create the manifest file from the command line after the .class file is created?
Update: you can find the answer here: Use of the MANIFEST.MF file in Java
The manifest file has nothing to do with the compilation/running process of a class.
If you configured your project correctly in your IDE (depending on the IDE), it will be generated during the build project process.
If you are working using the command prompt and notepad, you can always create it manually.
This question already has answers here:
create directory when needed in maven
(3 answers)
Closed 7 years ago.
I have JUnit-tests within my Maven project that save an image to a folder within the target directory. I want Maven to create this folder during the build phase if it doesn't already exist. I thought it might be possible to achieve this by adding a directory within the pom.xml but can't find any documentation about it.
Do I need to use a plugin for that?
You can simply create new file with new File("target", "<directory>/<file>"). then file.mkDirs(), It will create directory in target directory.
This question already has answers here:
Package not found; javac
(2 answers)
Including jars in classpath on commandline (javac or apt)
(5 answers)
Closed 8 years ago.
I am compiling java files from terminal. But It gives error for external jar files. where can I put external jars. so, it can be used at compile time from terminal?
You can pput it in every directiory and then add it to the classpath:
javac -cp <path_to_jar_including_filename> <class_to_compile>