[
https://issues.apache.org/jira/browse/DAEMON-419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17133271#comment-17133271
]
Manuel Dominguez Sarmiento edited comment on DAEMON-419 at 6/11/20, 1:30 PM:
-----------------------------------------------------------------------------
-X--enable-preview does not work. See below:
[https://www.mail-archive.com/[email protected]/msg134606.html]
The reason is that jsvc passes -X--enable-preview unmodified to java, instead
of- -enable-preview which is the proper syntax.
The patch seems fairly straightforward in src/native/unix/native/arguments.c
Similar to:
[
397|https://gitbox.apache.org/repos/asf?p=commons-daemon.git;a=blob;f=src/native/unix/native/arguments.c;h=8160c72944a7d7dae9cc8d43ec244f43a664a82f;hb=HEAD#l397]
/* Java 9 specific options */
[
398|https://gitbox.apache.org/repos/asf?p=commons-daemon.git;a=blob;f=src/native/unix/native/arguments.c;h=8160c72944a7d7dae9cc8d43ec244f43a664a82f;hb=HEAD#l398]
else if (!strncmp(argv[x], "--add-modules=", 14))
{ [
399|https://gitbox.apache.org/repos/asf?p=commons-daemon.git;a=blob;f=src/native/unix/native/arguments.c;h=8160c72944a7d7dae9cc8d43ec244f43a664a82f;hb=HEAD#l399]
args->opts[args->onum++] = strdup(argv[x]); [
400|https://gitbox.apache.org/repos/asf?p=commons-daemon.git;a=blob;f=src/native/unix/native/arguments.c;h=8160c72944a7d7dae9cc8d43ec244f43a664a82f;hb=HEAD#l400]
}
Something like:
/* Java 12 specific options */
else if (!strncmp(argv[x], "--enable-preview", 16))
{ args->opts[args->onum++] = strdup(argv[x]); }
Not sure if anything if required for the Windows code, since
src/native/windows/src/cmdline.c seems to pass on to java all arguments
starting with -- unmodified.
was (Author: mads1980):
-X--enable-preview does not work. See below:
[https://www.mail-archive.com/[email protected]/msg134606.html]
The reason is that jsvc passes -X--enable-preview unmodified to java, instead
of --enable-preview which is the proper syntax.
The patch seems fairly straightforward in src/native/unix/native/arguments.c
Similar to:
[
397|https://gitbox.apache.org/repos/asf?p=commons-daemon.git;a=blob;f=src/native/unix/native/arguments.c;h=8160c72944a7d7dae9cc8d43ec244f43a664a82f;hb=HEAD#l397]
/* Java 9 specific options */
[
398|https://gitbox.apache.org/repos/asf?p=commons-daemon.git;a=blob;f=src/native/unix/native/arguments.c;h=8160c72944a7d7dae9cc8d43ec244f43a664a82f;hb=HEAD#l398]
else if (!strncmp(argv[x], "--add-modules=", 14)) {
[
399|https://gitbox.apache.org/repos/asf?p=commons-daemon.git;a=blob;f=src/native/unix/native/arguments.c;h=8160c72944a7d7dae9cc8d43ec244f43a664a82f;hb=HEAD#l399]
args->opts[args->onum++] = strdup(argv[x]);
[
400|https://gitbox.apache.org/repos/asf?p=commons-daemon.git;a=blob;f=src/native/unix/native/arguments.c;h=8160c72944a7d7dae9cc8d43ec244f43a664a82f;hb=HEAD#l400]
}
Something like:
/* Java 12 specific options */
else if (!strncmp(argv[x], "--enable-preview", 16)) {
args->opts[args->onum++] = strdup(argv[x]);
}
Not sure if anything if required for the Windows code, since
src/native/windows/src/cmdline.c seems to pass on to java all arguments
starting with -- unmodified.
> jsvc support for Java 12+ preview features with --enable-preview
> ----------------------------------------------------------------
>
> Key: DAEMON-419
> URL: https://issues.apache.org/jira/browse/DAEMON-419
> Project: Commons Daemon
> Issue Type: New Feature
> Components: Jsvc
> Affects Versions: 1.2.2
> Reporter: Manuel Dominguez Sarmiento
> Priority: Major
>
> Currently jsvc offers no way to allow running Java with 12+ preview features.
> This is enabled with the --enable-preview command line flag, but jsvc does
> not understand this and fails with "Invalid option --enable-preview"
> See the following threads:
> [https://www.mail-archive.com/[email protected]/msg134585.html]
> [http://apache-commons.680414.n4.nabble.com/How-to-pass-the-enable-preview-tomcat-parameter-with-JSVC-td4733218.html]
>
> Reference for preview features:
> h1. JEP 12: Preview Language and VM Features
> [https://openjdk.java.net/jeps/12]
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)