[
https://issues.apache.org/jira/browse/KARAF-5695?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jean-Baptiste Onofré resolved KARAF-5695.
-----------------------------------------
Resolution: Fixed
> Starting Karaf Container 4.2.0 in Ubuntu 17.10 with OpenJDK 9 fails
> -------------------------------------------------------------------
>
> Key: KARAF-5695
> URL: https://issues.apache.org/jira/browse/KARAF-5695
> Project: Karaf
> Issue Type: Bug
> Affects Versions: 4.2.0
> Environment: Ubuntu 17.10
> OpenJDK 9 (build 9-Ubuntu+0-9b181-4)
> Reporter: Shahin Mameghani
> Assignee: Freeman Fang
> Priority: Major
> Fix For: 4.2.1
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> In earlier versions of Java, executing {{java -version}} in a terminal will
> return for instance {{1.8.0_162}} but in Ubuntu 17.10 with Java 9 it returns
> {{9-Ubuntu}}. Because of this, when executing {{./bin/karaf}}, the following
> error output is given.
> {code:java}
> /home/shahin/tools/apache-karaf-4.2.0/bin/karaf: 212: [: Illegal number:
> 9-Ubuntu
> /home/shahin/tools/apache-karaf-4.2.0/bin/karaf: 274: [: Illegal number:
> 9-Ubuntu
> -Djava.endorsed.dirs=/usr/lib/jvm/java-9-openjdk-amd64/jre/lib/endorsed:/usr/lib/jvm/java-9-openjdk-amd64/lib/endorsed:/home/shahin/tools/apache-karaf-4.2.0/lib/endorsed
> is not supported. Endorsed standards and standalone APIs
> in modular form will be supported via the concept of upgradeable modules.
> Error: Could not create the Java Virtual Machine.
> Error: A fatal exception has occurred. Program will exit.
> {code}
> Starting Karaf with Java 8 however works just fine.
> A workaround for this was to modify the {{sed}} expression at line 211 in the
> function {{checkJvmVersion()}} in {{./bin/inc}} from
> {code:java}
> sed -e 's/_.*//g; s/^1\.//g ; s/\..*//g;'{code}
> to
> {code:java}
> sed -e 's/_.*//g; s/^1\.//g ; s/\..*//g; s/-.*//g;'
> {code}
> After this Karaf boots properly with Java 9.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)