Java
- Read instructions on installation of java and its dependencies: java-algs4
- Set Java compiler langauge level to 7.
To run programm in the command line interface (CLI): Normal
javac <name>.java
java <name>
To include the classpath in algo4 standard libraries:
javac-algs4 <name>.java
java-algs4 <name>
javac-algs4
will do the following:
#!/bin/bash
INSTALL=~/algs4
jars=(.:${INSTALL}/stdlib.jar:${INSTALL}/algs4.jar)
javac -cp "$jars" -g -encoding UTF-8 "$@"
To run programm in IntelliJ:
- Open the root director as the project root in IntelliJ
- Set language level to 7
- Add
~/algs4/algs4.jar
and~/algs4/stdlib.jar
to project's external libraries - In each assignment folder, mark
src
asSources Root
- Create target folder
tagert/classes
,target/test-classes
, and add them to project target folders - To compile and run, add
maven
framework support and ignore the generatedsrc
folder