Set folder for classpath [duplicate]

If you are using Java 6 or higher you can use wildcards of this form: java -classpath “.;c:\mylibs\*;c:\extlibs\*” MyApp If you would like to add all subdirectories: lib\a\, lib\b\, lib\c\, there is no mechanism for this in except: java -classpath “.;c:\lib\a\*;c:\lib\b\*;c:\lib\c\*” MyApp There is nothing like lib\*\* or lib\** wildcard for the kind of job … Read more

How to create jar file with package structure?

You need to start creating the JAR at the root of the files. So, for instance: jar cvf program.jar -C path/to/classes . That assumes that path/to/classes contains the com directory. FYI, these days it is relatively uncommon for most people to use the jar command directly, as they will use a build tool such as … Read more

Difference between the maven-assembly-plugin, maven-jar-plugin and maven-shade-plugin?

maven-jar-plugin: This plugin provides the capability to build and sign JARs. But it just compiles the java files under src/main/java and src/main/resources/. It doesn’t include the dependencies JAR files. maven-assembly-plugin: This plugin extracts all dependency JARs into raw classes and groups them together. It can also be used to build an executable JAR by specifying … Read more

Create jfreechart-1.5.3 JAR from source code

As illustrated here, you can clone the repository, check out the branch with the desired tag and use maven to build the release JARs. See also Migration from JFreeChart 1.0.x $ git clone https://github.com/jfree/jfreechart.git jfreechart $ pushd jfreechart $ git fetch –tags $ git tag –list … v1.5.3 $ git checkout v1.5.3 Note: switching to … Read more

Run a scala code jar appear NoSuchMethodError:scala.Predef$.refArrayOps

Most probably you’re compiling your code locally with Scala 2.12 but at the server it’s running with Scala 2.13 or 2.11. Try to recompile your code with the version of Scala at the server. Scala 2.11, 2.12, 2.13 are binary incompatible. The signature of refArrayOps is different (in binary incompatible way) in Scala 2.13 def … Read more