Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
ChangeLog
---------

### v3.0.6 (2020-03-19)
* Fixed an issue related to Java 4-8 version number detection (PR #81, Thanks to @thatChadM for his contribution)

### v3.0.5 (2019-12-15)
* If java is missing, offer a choice between Oracle and AdoptOpenJDK download buttons (#78)
* Support Array style `Java:Arguments` for Apple Plist style (#76)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014-2018 Tobias Fischer
Copyright (c) 2014-2020 Tobias Fischer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions src/universalJavaApplicationStub
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
# #
# @author Tobias Fischer #
# @url https://github.com/tofi86/universalJavaApplicationStub #
# @date 2019-12-15 #
# @version 3.0.5 #
# @date 2020-03-19 #
# @version 3.0.6 #
# #
##################################################################################
# #
# The MIT License (MIT) #
# #
# Copyright (c) 2014-2018 Tobias Fischer #
# Copyright (c) 2014-2020 Tobias Fischer #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
Expand Down Expand Up @@ -477,7 +477,7 @@ function get_comparable_java_version() {
################################################################################
function is_valid_requirement_pattern() {
local java_req=$1
java8pattern='1\.[4-8](\.0)?(\.0_[0-9]+)?[*+]?'
java8pattern='1\.[4-8](\.[0-9]+)?(\.0_[0-9]+)?[*+]?'
java9pattern='(9|1[0-9])(-ea|[*+]|(\.[0-9]+){1,2}[*+]?)?'
# test matches either old Java versioning scheme (up to 1.8) or new scheme (starting with 9)
if [[ ${java_req} =~ ^(${java8pattern}|${java9pattern})$ ]]; then
Expand Down
6 changes: 4 additions & 2 deletions test/java-version-tester.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Tests for the functions used in universalJavaApplicationStub script
# tofi86 @ 2018-07-29
# tofi86 @ 2020-02-11



Expand Down Expand Up @@ -84,7 +84,7 @@ function get_comparable_java_version() {
################################################################################
function is_valid_requirement_pattern() {
local java_req=$1
java8pattern='1\.[4-8](\.0)?(\.0_[0-9]+)?[*+]?'
java8pattern='1\.[4-8](\.[0-9]+)?(\.0_[0-9]+)?[*+]?'
java9pattern='(9|1[0-9])(-ea|[*+]|(\.[0-9]+){1,2}[*+]?)?'
# test matches either old Java versioning scheme (up to 1.8) or new scheme (starting with 9)
if [[ ${java_req} =~ ^(${java8pattern}|${java9pattern})$ ]]; then
Expand Down Expand Up @@ -179,6 +179,7 @@ echo "Tests with Java 1.6:"
testExtractMajor "1.6" "6"
testExtractMajor "1.6+" "6"
testExtractMajor "1.6.0" "6"
testExtractMajor "1.6.2" "6"
testExtractMajor "1.6.0_07" "6"
testExtractMajor "1.6.0_45" "6"
testExtractMajor "1.6.0_65-b14-468" "6"
Expand Down Expand Up @@ -328,6 +329,7 @@ testValidReqPattern "1.6.0_45" "0"
testValidReqPattern "1.6.0_45+" "0"
testValidReqPattern "1.6.0_100" "0"
testValidReqPattern "1.6.0_100+" "0"
testValidReqPattern "1.6.2" "0"
echo ""
echo "Tests with old version scheme (invalid requirements):"
testValidReqPattern "1.2" "1"
Expand Down