Created
December 13, 2015 14:35
-
-
Save MrWooJ/1347367d48fd96c8f4f0 to your computer and use it in GitHub Desktop.
Build & Run Java Codes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| LIBPATH="" | |
| PROJECTDIR=$(pwd) | |
| BINDIR=$PROJECTDIR"/bin" | |
| #Your Project Source Directory | |
| SRCDIR=$PROJECTDIR"/src/..." | |
| #Your Runnabple Main Function ,java File | |
| RUNPATH="com.xxx.yyy" | |
| function GenerateLibrariPath { | |
| #Add Your Project JAR Files Dependecies Here (Sample Bellow Line) | |
| local ExampleJar=$PROJECTDIR"/JarFiles/ExampleJar" | |
| #For OS X | |
| LIBPATH=.:$ExampleJar:$BINDIR | |
| #For Windows | |
| LIBPATH=.;$ExampleJar;$BINDIR | |
| } | |
| GenerateLibrariPath | |
| #echo "LibraryPath: "$LIBPATH | |
| cd $SRCDIR | |
| #echo "SRC PWD: "$(pwd) | |
| javac -d $BINDIR -cp $LIBPATH *.java | |
| cd $PROJECTDIR | |
| #echo "BIN PWD: "$(pwd) | |
| java -cp $LIBPATH $RUNPATH $PROJECTDIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment