Description
Execute Java classes/applications
Technical Specification (partial)
java [-options] class [args...]
(to execute a class)
or
java [-options] -jar jarfile [args...]
-Dmyprop=myval set a system property.
retrieval: System.getProperty("myprop");
Notes
- Classpath Searching:
- JRE
- Environment Variable (classpath)
- Command-Line Classpath (overrides environment variable)
- Directory Delimitor: unix '/', Mac '/', Windows '\'
- Classpath Separator: unix ':', Mac ':', Windows ';'
- Current Directory: '.'
- First class found is the one used. Searching stops when first class is found.
Examples
bash script
javac -d build -sourcepath src src/com/bryanpugh/scjp/MyClass.java
ant
<project basedir="."> <target name=""> <mkdir dir="${basedir}/build"/> <javac srcdir="${basedir}/src" destdir="${basedir}/build"/>
</target name="">
</project>