Skip to content

Commit

Permalink
Merge pull request #21 from mauritssilvis/update_java
Browse files Browse the repository at this point in the history
Update to Java 21
  • Loading branch information
mauritssilvis committed Dec 1, 2023
2 parents d0da5b1 + 25dd424 commit 07e9a26
Show file tree
Hide file tree
Showing 28 changed files with 663 additions and 191 deletions.
88 changes: 88 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Created by https://gitattributes.io/api/common
# Adapted according to https://stackoverflow.com/a/42135910/12911324

# Common settings that generally should always be used with your language specific settings

# Auto detect text files and perform LF normalization
* text=auto eol=lf

#
# The above will handle all files NOT found below
#

# Documents
*.bibtex text diff=bibtex
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.md text diff=markdown
*.mdx text diff=markdown
*.tex text diff=tex
*.adoc text
*.textile text
*.mustache text
*.csv text eol=crlf
*.tab text
*.tsv text
*.txt text
*.sql text
*.epub diff=astextplain

# Graphics
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.tif binary
*.tiff binary
*.ico binary
# SVG treated as text by default.
*.svg text
# If you want to treat it as binary,
# use the following line instead.
# *.svg binary
*.eps binary

# Scripts
*.bash text eol=lf
*.fish text eol=lf
*.sh text eol=lf
*.zsh text eol=lf
# These are explicitly windows files and should use crlf
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf

# Serialisation
*.json text
*.toml text
*.xml text
*.yaml text
*.yml text

# Archives
*.7z binary
*.gz binary
*.tar binary
*.tgz binary
*.zip binary

# Text files where line endings should be preserved
*.patch -text

#
# Exclude files from exporting
#

.gitattributes export-ignore
.gitignore export-ignore
.gitkeep export-ignore

# End of https://gitattributes.io/api/common
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

All notable changes to the [Challenges](https://github.com/mauritssilvis/challenges) project are documented in this file.

The file format is based on [keep a changelog](https://keepachangelog.com/en/1.0.0/),
The file format is based on [keep a changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [semantic versioning](https://semver.org/spec/v2.0.0.html).

## [0.4.0] - 2023-12-01

### Changed

- Update the Java version from 20 to 21.
- Extend and improve the general documentation.
- Extend and improve the documentation of the command-line Java project.
- Extend and improve the documentation of the IntelliJ Java project.
- Extend and improve the documentation of the Maven Java project.
- Improve the documentation of the executable JAR project.

## [0.3.1] - 2023-09-16

### Changed
Expand All @@ -30,3 +41,9 @@ and this project adheres to [semantic versioning](https://semver.org/spec/v2.0.0
- Add a Java project set up using IntelliJ IDEA.
- Add a Java project set up using Maven and IntelliJ IDEA.
- Add a project that can create an executable JAR using Maven and IntelliJ IDEA.

## License

Copyright © 2023 Maurits Silvis

This source code package is subject to the terms and conditions defined in the [GNU General Public License v3.0](LICENSE.md) or later.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
With this educational project, I provide solutions to common programming challenges.

Below, I first describe the [aims](#1-aims) I have with the current project.
I then [list](#2-overview) the programming languages for which I solved several challenges.
I then give an [overview](#2-overview) of the challenges I have solved thus far.

The release history of this project is contained in the [changelog](CHANGELOG.md).

Expand All @@ -33,6 +33,13 @@ Currently, solutions to common programming challenges are available for the foll

- [Java](java)

Specifically, I solved the following challenges:

- [Setting up a Java project using the command line](java/java-project-cli)
- [Setting up a Java project using IntelliJ IDEA](java/java-project-intellij)
- [Setting up a Java project using Maven and IntelliJ IDEA](java/java-project-maven-intellij)
- [Creating an executable JAR using Maven and IntelliJ IDEA](java/executable-jar-maven-intellij)

## License

Copyright © 2021–2023 Maurits Silvis
Expand Down
26 changes: 15 additions & 11 deletions java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ I solved the challenges in this section using the [command line](#22-bash) but w
### 1.2 IntelliJ IDEA projects

I solved the following challenges using [IntelliJ IDEA](#23-intellij-idea).
For some challenges, I did not use a build tool ([manual](#121-manual)).
For others, I used [Maven](#122-maven).
For some challenges, I did not use a build tool (manual).
For others, I used [Maven](#24-maven).

#### 1.2.1 Manual

Expand All @@ -46,33 +46,37 @@ C and C++ are, however, compiled into platform-specific machine code.
Instead, Java compiles to platform-independent class files containing so-called bytecode.
This bytecode can be executed on a platform of choice by a platform-specific Java virtual machine (JVM).

Most of the above-mentioned projects are configured to use the latest version of Java (Java 20 at the time of writing).
These projects require the installation of the Java Development Kit (JDK) 20 or later (see, e.g., https://adoptium.net/temurin/releases/).

Most of the above-mentioned projects are configured to use Java 21, which is the latest long-term support (LTS) version of Java at the time of writing.
These projects require the installation of the Java Development Kit (JDK) 21 or later.
The installation of the latest JDK is described in the [Installation section](java-project-cli/#111-installation) of [Setting up a Java project using the command line](java-project-cli).

### 2.2 Bash

[Bash](https://www.gnu.org/software/bash/) is a commonly-used command-line interface for Unix-like operating systems.
Bash can execute both user-provided commands and so-called shell scripts.
[Bash](https://www.gnu.org/software/bash/) is a commonly used command-line interface for Unix-based operating systems.
Bash can both interactively execute commands and run so-called shell scripts.
MacOS and most Linux distributions come with Bash or a Bash-like shell.
Windows users can obtain Bash by installing [Git for Windows](https://git-scm.com/download/win).

### 2.3 IntelliJ IDEA

[IntelliJ IDEA](https://www.jetbrains.com/idea/) is an integrated development environment (IDE) developed by [JetBrains](https://www.jetbrains.com/).
This IDE supports Java and several other JVM languages and can be extended with plugins to retrieve support for other programming languages.
IntelliJ IDEA has [detailed online documentation](https://www.jetbrains.com/help/idea/discover-intellij-idea.html), and its [community edition](https://www.jetbrains.com/idea/download/) can be downloaded and used for free.
IntelliJ IDEA has [detailed online documentation](https://www.jetbrains.com/help/idea/), and its [community edition](https://www.jetbrains.com/idea/download/) can be downloaded and used for free.

IntelliJ IDEA makes it easy to configure code styles, automatic copyright notices, code inspection profiles, run configurations and more.
The basic IntelliJ IDEA configuration used in the above-mentioned projects is described in the [IntelliJ IDEA section](java-project-intellij#12-intellij-idea) of [Setting up a Java project using IntelliJ IDEA](java-project-intellij).
The basic IntelliJ IDEA configuration used in the above-mentioned projects is described in the [IntelliJ IDEA section](java-project-intellij/#12-intellij-idea) of [Setting up a Java project using IntelliJ IDEA](java-project-intellij).
A step-by-step guide for setting up a Java project using IntelliJ IDEA can be found in the [Create a new project section](https://www.jetbrains.com/help/idea/new-project-wizard.html) of IntelliJ IDEA’s [online documentation](https://www.jetbrains.com/help/idea/).


### 2.4 Maven

[Maven](https://maven.apache.org/) is a build tool that can be used to manage and build projects written in Java and other programming languages.
The [project object model](https://maven.apache.org/guides/introduction/introduction-to-the-pom.html), a file named `pom.xml`, is central to using Maven.
In this file, the project properties can be set, build plugins can be configured, project dependencies can be defined, etc.

The basic Maven configuration used in the above-mentioned projects is discussed in the [Maven section](java-project-maven-intellij#13-maven) of [Setting up a Java project using Maven and IntelliJ IDEA](java-project-maven-intellij).
A step-by-step guide for setting up a Maven project using IntelliJ IDEA can be found in the [Maven section](https://www.jetbrains.com/help/idea/maven-support.html#create_new_maven_project) of IntelliJ IDEA's [online documentation](https://www.jetbrains.com/help/idea/discover-intellij-idea.html).
The basic Maven configuration used in the above-mentioned projects is discussed in the [Maven section](java-project-maven-intellij/#13-maven) of [Setting up a Java project using Maven and IntelliJ IDEA](java-project-maven-intellij).
A step-by-step guide for setting up a Maven project using IntelliJ IDEA can be found in the [Maven section](https://www.jetbrains.com/help/idea/maven-support.html) of IntelliJ IDEA’s [online documentation](https://www.jetbrains.com/help/idea/).
Maven does not need to be installed when used with IntelliJ IDEA.

## License

Expand Down
42 changes: 42 additions & 0 deletions java/executable-jar-maven-intellij/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Created by https://gitattributes.io/api/java

# Java sources
*.java text diff=java
*.kt text diff=kotlin
*.groovy text diff=java
*.scala text diff=java
*.gradle text diff=java
*.gradle.kts text diff=kotlin

# These files are text and should be normalized (Convert crlf => lf)
*.css text diff=css
*.scss text diff=css
*.sass text
*.df text
*.htm text diff=html
*.html text diff=html
*.js text
*.jsp text
*.jspf text
*.jspx text
*.properties text
*.tld text
*.tag text
*.tagx text
*.xml text

# These files are binary and should be left untouched
# (binary is a macro for -text -diff)
*.class binary
*.dll binary
*.ear binary
*.jar binary
*.so binary
*.war binary
*.jks binary

# Common build-tool wrapper scripts ('.cmd' versions are handled by 'Common.gitattributes')
mvnw text eol=lf
gradlew text eol=lf

# End of https://gitattributes.io/api/java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion java/executable-jar-maven-intellij/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 07e9a26

Please sign in to comment.