Possibly :)
# On Unix
java -cp utilities.jar:. mypackage.MyClass
# On Windows
java -cp utilities.jar;. mypackage.MyClass
Basically that's just including . (the current directory) on the classpath as well as the jar file.
Possibly :)
# On Unix
java -cp utilities.jar:. mypackage.MyClass
# On Windows
java -cp utilities.jar;. mypackage.MyClass
Basically that's just including . (the current directory) on the classpath as well as the jar file.
Try this if you're on Windows:
java -cp .;utilities.jar mypackage.MyClass
Or this if you're on Linux:
java -cp .:utilities.jar mypackage.MyClass
The current directory is not in the CLASSPATH by default when you specify a value for -cp.
Videos
Importing has nothing to do with loading classes or setting CLASSPATH.
Try this:
java -cp .;../lib/* Generator
Using the dot '.' as the first entry in the CLASSPATH assumes that the Generator.class file exists in the directory from which you're running java, and /lib is one level up from that directory. Adjust as needed if both of these are not correct.
You should run the program including again the same cp:
java -cp "lib directory where i put all the jars" MainClassOfYourApplication
After you compiled it with:
javac -cp "lib directory where i put all the jars" AvroReader.java
More applied to your example:
First step(compile all the needed java files): javac -cp "path/to/jars/*" AvroReader.java //here you should include all the java files not yet compiled but which you need to run your app
Second step: java -cp "path/to/jars/*" package.subpackage1.subpackage2.Generator