If you're new to Java, haven't done it in a while and need a refresher, and absorb things well by reading, I'd suggest the official Oracle tutorials as they're quite good, but one of the others may more suit your style.
- Official Oracle Java Tutorial
- Geek 4 Geeks Java Tutorial
- Java “Back to Basics” Tutorial
- W3Schools Java Tutorial (Comes with a web based IDE to run your changes to the example code!)
There are many introductory Java materials on youtube if you prefer videos.
- JDK 20 (Any version of Java 11+ will do for our purposes. This is a Java 20 direct link to an installer. Please remember where you install it as that will be important later.)
- Eclipse IDE for Java Developers
- Maven
- Installing Java
Links to options available in #notes-resources channel in discord and also in the Study Room 1 chat.
note: Some people chose 17 and some chose 20. so note the config change in the pom.xml java.version property attribute value.
Java 17
Java 20
<properties> <java.version>17</java.version> </properties>
<properties> <java.version>20</java.version> </properties>
- Downloading latest Maven Binaries and add them to the system CLASSPATH
- Links in discord Study Room 1 Chat
- Run a 'clean' Maven build with 'mvn clean'
- Run the Spring API directly from the zipped https://start.spring.io template using the spring provided run command 'mvn spring-boot:run' and checked our app was up by hitting the spring actuator endpoints at http://localhost:8080/actuator/info and getting a JSON Response {"status":"UP"} via HTTP GET by entering the address in our browser of choice.
- Installed Eclipse
- Created a workspace folder independent of the code
- Imported the Maven project as a Maven project in Eclipse
- Installed Spring Tools 4 add-on from the Eclipse Marketplace under Help
- Created a Spring Tools Runtime By starting as a Spring API app with the provided default spring tools runtime.
- Adjusted JDK runtime at workspace setup explicitly by directory 10.Ran the Spring API we downloaded in Eclipse via the IDE 'Run As' => 'Spring Boot App Option' and stop it with the IDE provided red button on the console top right of the console window.
User these commands to build and run the docker container
docker build -f DOCKERFILE --build-arg JAR_FILE=target/*.jar -t myorg/myapp .
User these commands to generate a server.p12 file to use as a certificate and place it in src/main/resources
openssl x509 -inform DER -in server.crt -outform PEM -out cert.pem
openssl pkcs12 -export -in myhost.crt -inkey myhost.key -out myhost.p12
Use the password "temp" or change in application.properties.