Skip to content

Instantly share code, notes, and snippets.

@miss-invincible
Created May 22, 2017 20:08
Show Gist options
  • Save miss-invincible/f4160b34b003dcacb3ba3b30cef9a6b6 to your computer and use it in GitHub Desktop.
Save miss-invincible/f4160b34b003dcacb3ba3b30cef9a6b6 to your computer and use it in GitHub Desktop.
Open a command prompt.
Go to the directory where you have your .java files
Create a directory "build"
Run java compilation from the command line
javac -d ./build *.java
#if there are multiple files to be jarred or
javac -d ./build file_name.java
#for jarring a single file
to compile in the current directory:
javac -d . *.java
to use another jar for compiling java file:
javac -d -classpath ~/Downloads/hadoop-core1.2.1.jar ./build *.java
now to crete jar of compiled classes:
jar cvf YourJar.jar kmeans*.class
(mention kmeans*class instead of just * as jar needs to know all the files added.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment