Run all commands through a command prompt/terminal in your jdbc folder.
Compile from project folder
javac ./src/App.java -d ./build
-d
: Directory of generated class filesRun with
java -cp "./build;./lib/postgresql-jdbc.jar" App dbpassword
For Linux/Mac the ;
should be a :
.
-cp
: Folder of Java classfiles (classpath)App
: Name of main filedbpassword
: Password of database connection (first argument)To use Java properly it has to be available in the environment variables.
Run java -version
to see if you have java properly installed.
On Windows it should get automatically added. On Linux or MacOS you can also use export PATH=/Applications/<you jdk folder>/Contents/Home/bin:$PATH
to add the path to the JDK into you environment.
Follow the entwicklungsumgebung.md guide to set up your local development setup.
The workspace contains two folders by default, where:
src
: the folder to maintain sourceslib
: the folder to maintain dependencieshttps://www.postgresqltutorial.com/postgresql-jdbc/