Unrecognized Option Error For Java In Mac

Hi experts, I'm trying to install SAP GUI for Java on a mac (SAP GUI for Java 7.50 rev 12) but I got a fatal error saying: Installation of SAP GUI for Java 7.50 rev 12. CCC 8136930 says the following w.r.t the new module options: The java launcher will pass options down to the VM via JNI invocation API. The VM will take the long form options, and the options with argument will be passed as one single string with `=` delimiter. The '=' is required. The VM doesn't handle options containing blanks.

RULE 'gc/arguments/TestTargetSurvivorRatioFlag.java' Exception java.lang.RuntimeException: Expected to get exit value of [1]
I am about to file a new bug, as Michail suggested. Latest HS-Runtime nightly has this mismatch issue, causing 16 'New' failures.
Nikita, you are right, it was made by mistake. If we cannot add rules to this CR for correct Aurora's matching, I can create one new CR for storing all of these rules for matching in Aurora. So this issues is used by developers, separate issue will be used for testing and matching purposes.
In the history for this bug I see: Michail Chernov made changes - 2015-06-25 15:28 Link This issue backport of JDK-8129840 [ JDK-8129840 ] So apparently it was marked as a backport by mistake.
Attaching simple script with test cases.
Came up with a full matrix covering hopefully all possibilities: #1 desired JDK behavior: Note: '(1)' next to results denotes a result that is different from the current jdk9/hs-rt behavior! Note: '(2)' next to results denotes a result that is different from the jdk8 behavior! #1.1 normal flag (new behavior): ..............................................................exists, invalid value...........................does not exist .............................................................-XX:MinHeapFreeRatio=notnum.......-XX:THIS_FLAG_DOESNT_EXIST -IgnoreUnrecognizedVMOptions...........................ERR.........................................................ERR +IgnoreUnrecognizedVMOptions..........................ERR (1)(2)...............................................OK #1.1.1 java -XX:-IgnoreUnrecognizedVMOptions -XX:MinHeapFreeRatio=notnum -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.1.2 java -XX:-IgnoreUnrecognizedVMOptions -XX:THIS_FLAG_DOESNT_EXIST -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.1.3 java -XX:+IgnoreUnrecognizedVMOptions -XX:MinHeapFreeRatio=notnum -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.1.4 java -XX:+IgnoreUnrecognizedVMOptions -XX:THIS_FLAG_DOESNT_EXIST -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi #1.2 normal flag with ranges (this fix): ............................................................exists, in range......................exists, out of range ............................................................-XX:StackRedPages=1.........-XX:StackRedPages=0 -IgnoreUnrecognizedVMOptions......................OK.....................................ERR +IgnoreUnrecognizedVMOptions.....................OK.....................................ERR (1) #1.2.1 java -XX:-IgnoreUnrecognizedVMOptions -XX:StackRedPages=1 -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi #1.2.2 java -XX:-IgnoreUnrecognizedVMOptions -XX:StackRedPages=0 -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.2.3 java -XX:+IgnoreUnrecognizedVMOptions -XX:StackRedPages=1 -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi #1.2.4 java -XX:+IgnoreUnrecognizedVMOptions -XX:StackRedPages=0 -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.3 locked flag (new behavior): ............................................................diagnostic & locked..............................experimental & locked............................commercial & locked ............................................................-XX:-UnlockDiagnosticVMOptions.......-XX:-UnlockExperimentalVMOptions......-XX:-UnlockCommercialFeatures ............................................................-XX:+PrintInlining................................-XX:+AlwaysSafeConstructors................-XX:+FlightRecorder -IgnoreUnrecognizedVMOptions....................ERR............................................................ERR...................................................ERR +IgnoreUnrecognizedVMOptions...................ERR (1)(2)..................................................ERR (1)(2)..........................................ERR (1)(2) #1.3.1 java -XX:-IgnoreUnrecognizedVMOptions -XX:-UnlockDiagnosticVMOptions -XX:+PrintInlining -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.3.2 java -XX:-IgnoreUnrecognizedVMOptions -XX:-UnlockExperimentalVMOptions -XX:+AlwaysSafeConstructors -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.3.3 java -XX:-IgnoreUnrecognizedVMOptions -XX:-UnlockCommercialFeatures -XX:+FlightRecorder -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.3.4 java -XX:+IgnoreUnrecognizedVMOptions -XX:-UnlockDiagnosticVMOptions -XX:+PrintInlining -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.3.5 java -XX:+IgnoreUnrecognizedVMOptions -XX:-UnlockExperimentalVMOptions -XX:+AlwaysSafeConstructors -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.3.6 java -XX:+IgnoreUnrecognizedVMOptions -XX:-UnlockCommercialFeatures -XX:+FlightRecorder -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.4 develop & notproduct flag on debug VM (trivial, unchanged): ............................................................develop & !product_build...........notproduct & !product_build ............................................................-XX:+DeoptimizeALot................-XX:+VerifyCodeCache -IgnoreUnrecognizedVMOptions........................OK........................................OK +IgnoreUnrecognizedVMOptions.......................OK........................................OK #1.4.1 java -XX:-IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi #1.4.2 java -XX:-IgnoreUnrecognizedVMOptions -XX:+VerifyCodeCache -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi #1.4.3 java -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi #1.4.4 java -XX:+IgnoreUnrecognizedVMOptions -XX:+VerifyCodeCache -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi #1.5 develop & notproduct flag on product VM (consistent with JDK-6886353, unchanged): ............................................................develop & !product_build...........notproduct & !product_build ............................................................-XX:+DeoptimizeALot................-XX:+VerifyCodeCache -IgnoreUnrecognizedVMOptions........................ERR......................................ERR +IgnoreUnrecognizedVMOptions.......................OK........................................OK #1.5.1 java -XX:-IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.5.2 java -XX:-IgnoreUnrecognizedVMOptions -XX:+VerifyCodeCache -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.5.3 java -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi #1.5.4 java -XX:+IgnoreUnrecognizedVMOptions -XX:+VerifyCodeCache -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi #1.6 malformed locked flag (new behavior): ............................................................diagnostic & locked..............................experimental & locked............................commercial & locked ............................................................-XX:-UnlockDiagnosticVMOptions.......-XX:-UnlockExperimentalVMOptions......-XX:-UnlockCommercialFeatures ............................................................-XX:PrintInlining...................................-XX:AlwaysSafeConstructors..................-XX:FlightRecorder -IgnoreUnrecognizedVMOptions....................ERR............................................................ERR...................................................ERR +IgnoreUnrecognizedVMOptions...................ERR (1)(2)..................................................ERR (1)(2)..........................................ERR (1)(2) #1.6.1 java -XX:-IgnoreUnrecognizedVMOptions -XX:-UnlockDiagnosticVMOptions -XX:PrintInlining -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.6.2 java -XX:-IgnoreUnrecognizedVMOptions -XX:-UnlockExperimentalVMOptions -XX:AlwaysSafeConstructors -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.6.3 java -XX:-IgnoreUnrecognizedVMOptions -XX:-UnlockCommercialFeatures -XX:FlightRecorder -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.6.4 java -XX:+IgnoreUnrecognizedVMOptions -XX:-UnlockDiagnosticVMOptions -XX:PrintInlining -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.6.5 java -XX:+IgnoreUnrecognizedVMOptions -XX:-UnlockExperimentalVMOptions -XX:AlwaysSafeConstructors -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.6.6 java -XX:+IgnoreUnrecognizedVMOptions -XX:-UnlockCommercialFeatures -XX:FlightRecorder -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.7 malformed develop & notproduct flag on debug VM (new behavior): ............................................................develop & !product_build...........notproduct & !product_build ............................................................-XX:DeoptimizeALot..................-XX:VerifyCodeCache -IgnoreUnrecognizedVMOptions........................ERR........................................ERR +IgnoreUnrecognizedVMOptions.......................ERR (1)(2)..............................ERR (1)(2) #1.7.1 java -XX:-IgnoreUnrecognizedVMOptions -XX:DeoptimizeALot -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.7.2 java -XX:-IgnoreUnrecognizedVMOptions -XX:VerifyCodeCache -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.7.3 java -XX:+IgnoreUnrecognizedVMOptions -XX:DeoptimizeALot -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.7.4 java -XX:+IgnoreUnrecognizedVMOptions -XX:VerifyCodeCache -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.8 malformed develop & notproduct flag on product VM (unchanged behavior): ............................................................develop & !product_build...........notproduct & !product_build ............................................................-XX:DeoptimizeALot..................-XX:VerifyCodeCache -IgnoreUnrecognizedVMOptions........................ERR........................................ERR +IgnoreUnrecognizedVMOptions.......................OK...........................................OK #1.8.1 java -XX:-IgnoreUnrecognizedVMOptions -XX:DeoptimizeALot -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.8.2 java -XX:-IgnoreUnrecognizedVMOptions -XX:VerifyCodeCache -version ; if [ $? -ne 0 ] ; then echo PASS ; else echo FAIL ; fi #1.8.3 java -XX:+IgnoreUnrecognizedVMOptions -XX:DeoptimizeALot -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi #1.8.4 java -XX:+IgnoreUnrecognizedVMOptions -XX:VerifyCodeCache -version ; if [ $? -eq 0 ] ; then echo PASS ; else echo FAIL ; fi
The new strict behavior of IgnoreUnrecognizedVMOptions, is: - ignore unrecognized OR not applicable EVEN if they are malfmored - those that are recognized (regardless of whether they are ignored) CAN NOT be malformed OR locked
# hg diffdiff -r e8351756255d src/share/vm/runtime/arguments.cpp--- a/src/share/vm/runtime/arguments.cpp Mon Jul 27 13:56:26 2015 -0700+++ b/src/share/vm/runtime/arguments.cpp Wed Jul 29 15:51:28 2015 -0500@@ -844,7 +844,7 @@ JDK_Version since = JDK_Version(); - if (parse_argument(arg, origin) || ignore_unrecognized) {+ if (parse_argument(arg, origin)) { return true; } @@ -893,9 +893,16 @@ 'Improperly specified VM option '%s'n', argname); } } else {+ // We can get here if, for example, we have a develop flag in a product build+ if (ignore_unrecognized) {+ return true;+ } jio_fprintf(defaultStream::error_stream(), '%s', locked_message_buf); } } else {+ if (ignore_unrecognized) {+ return true;+ } jio_fprintf(defaultStream::error_stream(), 'Unrecognized VM option '%s'n', argname); Flag* fuzzy_matched = Flag::fuzzy_match((const char*)argname, arg_len, true);
Thank you Dmitry.I see: a locked flag could be a developer flag, that is not available in product build. That would mean that it is found by the locked code, but it could result in error in product build. In such cases IgnoreUnrecognizedVMOptions was used to short-circuit the flag check and return OK, before getting to the 'locked flags' code.Indeed as Dmitry says we do need to short-circuit the 'locked flags' code too - verified by running: java -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot -version ; echo $?
Gerard, I think that case for locked flag should exist, since as I remember '-XX:+IgnoreUnrecognizedVMOptions' is often used in tests to handle such situation, e.g. when develop flag is used in test for product build. See for example https://bugs.openjdk.java.net/browse/JDK-6886353
Actually, the fix is even simpler, because we don't need to handle 'locked' flags in any special way. The code path handling locked flags is only taken if the flag is recognized, so we will never be in that code with a locked/unrecognized flag:# hg diffdiff -r e8351756255d src/share/vm/runtime/arguments.cpp--- a/src/share/vm/runtime/arguments.cpp Mon Jul 27 13:56:26 2015 -0700+++ b/src/share/vm/runtime/arguments.cpp Wed Jul 29 14:50:55 2015 -0500@@ -844,7 +844,7 @@ JDK_Version since = JDK_Version(); - if (parse_argument(arg, origin) || ignore_unrecognized) {+ if (parse_argument(arg, origin)) { return true; } @@ -896,6 +896,9 @@ jio_fprintf(defaultStream::error_stream(), '%s', locked_message_buf); } } else {+ if (ignore_unrecognized) {+ return true;+ } jio_fprintf(defaultStream::error_stream(), 'Unrecognized VM option '%s'n', argname); Flag* fuzzy_matched = Flag::fuzzy_match((const char*)argname, arg_len, true);
Following Dmitry's suggestion, the following simple fix should do it:# hg diff src/share/vm/runtime/arguments.cppdiff -r e8351756255d src/share/vm/runtime/arguments.cpp--- a/src/share/vm/runtime/arguments.cpp Mon Jul 27 13:56:26 2015 -0700+++ b/src/share/vm/runtime/arguments.cpp Wed Jul 29 12:09:50 2015 -0500@@ -844,7 +844,7 @@ JDK_Version since = JDK_Version(); - if (parse_argument(arg, origin) || ignore_unrecognized) {+ if (parse_argument(arg, origin)) { return true; } @@ -893,9 +893,15 @@ 'Improperly specified VM option '%s'n', argname); } } else {+ if (ignore_unrecognized) {+ return true;+ } jio_fprintf(defaultStream::error_stream(), '%s', locked_message_buf); } } else {+ if (ignore_unrecognized) {+ return true;+ } jio_fprintf(defaultStream::error_stream(), 'Unrecognized VM option '%s'n', argname); Flag* fuzzy_matched = Flag::fuzzy_match((const char*)argname, arg_len, true);
So we have the following test cases for a regular (product) flags: current JDK behavior: ...........................................................exists, in range...............exists, out of range..........does not exist ..........................................................-XX:StackRedPages=1...-XX:StackRedPages=0...-XX:THIS_FLAG_DOESNT_EXIST -IgnoreUnrecognizedVMOptions..................OK.................................ERR.........................................ERR +IgnoreUnrecognizedVMOptions.................OK.................................OK...........................................OK desired JDK behavior: ...........................................................exists, in range...............exists, out of range..........does not exist ..........................................................-XX:StackRedPages=1...-XX:StackRedPages=0...-XX:THIS_FLAG_DOESNT_EXIST -IgnoreUnrecognizedVMOptions..................OK.................................ERR.........................................ERR +IgnoreUnrecognizedVMOptions.................OK.................................ERR.........................................OK In particular, with +IgnoreUnrecognizedVMOptions the VM currently returns OK regardless of whether the flag existed or not (desired behavior), but also regardless of whether a recognized flag had valid value set (incorrect behavior).
The other way is just handle 'IgnoreUnrecognizedVMOption' in more precise manner(as it names means),i.e. ignore option only if option with passed name is not exist or if option is locked(e.g. diagnostic flag). In this case out-of-range options, badly specified options(e.g. -XX:UseG1GC) will be considered as invalid options.
Probably the safest way to go forward would be to add a new flag (ex. IgnoreFlagsList JDK-8132545) with very clear specifications and then deprecate 'IgnoreUnrecognizedVMOption' (JDK-8132546) In the meantime, however, it would probably be useful to quickly fix the existing issue to unblock the current tests that are failing (ie. JDK-8130697)
The current consensus seems to be that it is time to change how the flag works, i.e.:-------------------------------------------------------------------------------------------------------------------I agree with this suggestion. Make it ccstrlist so we can specify list of flags. But then the name should be different - 'Unrecognized' is misleading in such case I think.Thanks,VladimirOn 6/26/15 1:59 AM, Stefan Karlsson wrote:> On 2015-06-26 08:00, Bengt Rutisson wrote:>>>> Hi all,>>>> Just one more thought if we are thinking about making changes to the>> IgnoreUnrecognizedVMOptions flag.>>>> I am not a big fan of this flag since I think it just goes to show>> that we don't have enough control over our testing. As I understand it>> the main reason for the introduction of this flag was that when>> compressed oops was implemented we had no way of controlling which>> tests were run on 32 bit platforms (where the UseCompressedOops flag>> is not available) or o 64 bit platforms.>>>> I think it is unfortunate that we don't have better control of our>> testing. But one way of at least increasing the control would be to>> make IgnoreUnrecognizedVMOptions more specific. I would suggest that>> we change it to take a named argument that should be ignored.>>>> Something like:>>>> -XX:IgnoreUnrecognizedVMOption=UseCompressedOops>>>> That way it would not hide other issues in our testing. As it is now>> we run a lot of our testing with IgnoreUnrecognizedVMOptions which>> means that we don't find tests that need to be updated when we for>> example remove a command line option.>>>> Maybe it is a side track, but I wanted to mention it in this discussion.>> Yes, I've also suggested this a couple of times. Maybe it's time to> create an RFE?>> StefanK>>>>> Bengt
http://mail.openjdk.java.net/pipermail/hotspot-dev/2015-June/019213.html
I think we need a clear specification of how options should be processed so that we can verify that against the code. In particular it is not clear to me how 'ignoreUnrecognizedVMOptions' should interact with things like out-of-range values. A flowchart for option processing would be quite valuable here I think.
The problem in Arguments::process_argument function(src/share/vm/runtime/arguments.cpp module): 817 bool Arguments::process_argument(const char* arg, 818 jboolean ignore_unrecognized, Flag::Flags origin) { 819 820 JDK_Version since = JDK_Version(); 821 822 if (parse_argument(arg, origin) || ignore_unrecognized) { 823 return true; 824 }... 850 // For locked flags, report a custom error message if available. 851 // Otherwise, report the standard unrecognized VM option. 852 Flag* found_flag = Flag::find_flag((const char*)argname, arg_len, true, true); 853 if (found_flag != NULL) { 854 char locked_message_buf[BUFLEN]; 855 found_flag->get_locked_message(locked_message_buf, BUFLEN); 856 if (strlen(locked_message_buf) 0) { 857 if (found_flag->is_bool() && !has_plus_minus) { 858 jio_fprintf(defaultStream::error_stream(), 859 'Missing �� setting for VM option '%s'n', argname); 860 } else if (!found_flag->is_bool() && has_plus_minus) { 861 jio_fprintf(defaultStream::error_stream(), 862 'Unexpected �� setting in VM option '%s'n', argname); 863 } else { 864 jio_fprintf(defaultStream::error_stream(), 865 'Improperly specified VM option '%s'n', argname); 866 } 867 } else { 868 jio_fprintf(defaultStream::error_stream(), '%s', locked_message_buf); 869 } 870 } else { 871 jio_fprintf(defaultStream::error_stream(), 872 'Unrecognized VM option '%s'n', argname); 873 Flag* fuzzy_matched = Flag::fuzzy_match((const char*)argname, arg_len, true); 874 if (fuzzy_matched != NULL) { 875 jio_fprintf(defaultStream::error_stream(), 876 'Did you mean '%s%s%s'? ', 877 (fuzzy_matched->is_bool()) ? '(+/-)' : ', 878 fuzzy_matched->_name, 879 (fuzzy_matched->is_bool()) ? ' : '=<value>'); 880 } 881 } 882 883 // allow for commandline 'commenting out' options like -XX:#+Verbose 884 return arg[0] '#'; 885 } The range check is performed when parse_argument(arg, origin) function is called. But if '-XX:+IgnoreUnrecongnizedVMOptions' is specified, then 'ignore_unrecognized' will be true and 'if' statement on line822 will always be true. I think that a better place to check 'ignore_unrecognized' is on 'else' branch on line 867(for locked flags) and on 'else' branch on line 870(where we actually found unrecognized option). If 'ignore_unrecognized' is true, then returntrue in this case, otherwise execute code in these 'else' branches. In this case out-of-range options(line 822) and improperly specified options will be catched(lines 857-866), e.g. '-XX:UseG1GC' (without +/-) or 'java -XX:MaxRAMFraction=NOTNUM'.

This is not a tutorial. These are my running notes from getting Cassandra to run on Fedora 32. The debugging steps are interesting in their own right. I’ll provide a summary at the end for any sane enough not to read through the rest.

Table of contents

Unrecognized Option Error For Java In Mac Operating System

Old Instructions

So…Starting with https://www.liquidweb.com/kb/how-to-install-cassandra-2-on-fedora-20/ The dsc-20 is, I think, version specific, so I want to se if there is something more appropriate for F32 (has it really been so many years?)

This is a short video showing you how to remove the JAVAOPTIONS setting on Windows to remove the pesky issue of it overwriting your maximum ram allocation. Hello, I do have issues to compile Tensorflow on my mac in order to use the Java version. Here some useful information about my environment: macOS 10.12.3 gcc 6.3.0 (from MacPorts) Bazel 4.3.0 Python 2.7 Tensorflow commit a12c7dc CPU onl.

Looking in here https://rpm.datastax.com/community/noarch/ I see that there is still a dsc-20 series of packages, but also dsc-30…which might be a bit more recent of a release.

I’d be interested to see what is in the dsc30 package versus Cassandra.

OK. But…there is no Systemd file:

Garbage Collection Configuration

We’ll, let’s just try to run it.

Seems like it is built to use an older version of the Java CLI params, which is now gone. Where does this come from?

We can remove it there. According to this post, the appropriate replacement is -XX:+UseG1GC

OK, lets take care of both of those. According to this post, the GC line we put in above should cover UseConcMarkSweepGC.

The second option is in the logging section. It is not included in the jvm.options. However, if I run it with just the first option removed, I now get:

More trial and error shows I need to comment out all of the GC logging values at the bottom of the file:

-Xloggc is deprecated. Will use -Xlog:gc:/var/log/cassandra/gc.log instead. This is not from the jvm.options file (it was already commented out above).

I’m going to replace this with -Xlog:gc:/var/log/cassandra/gc.log as the message suggests in /etc/cassandra/default.conf/cassandra-env.sh

Thread Priority Policy

Looks like that was never a legal value. Since I am running a pretty tip-of-tree Linux distribution and OpenJDK version, I am going to set this to 1.

And with that, Cassandra will run. Too much output here. Let’s try to connect:

cqlsh doesn’t run

OK…let’s dig: First, is it listening:

I’m not sure off the top of my head which of those is the Query language port, but I can telnet to 7000, 7199, and 46381

Running cqlsh –help I see:

Lets give that a try:

Unrecognized option error for java in mac download

Nope. Ok, maybe there is a log file. Perhaps the Casandra process is stuck.

[ayoung@ayoungP40 ~]$ ls -lah /var/log/cassandra/total 52Mdrwxr-xr-x. 2 cassandra cassandra 4.0K Oct 19 15:41 .drwxr-xr-x. 23 root root 4.0K Oct 19 11:49 ..-rw-r–r–. 1 root root 19M Oct 19 15:41 debug.log

That is a long log file. I’m going to stop the process, wipe this directory and start again. Note that just hitting Ctrl C on the terminal was not enough to stop the process, I had to send a kill by pid.

This time the shell script exited on its own, but the cassandra process is running in the background of that terminal. lsof provides similar output. The high number port is now 44823 which means that I can at least rule that out; I think it is an ephemeral port anyway.

According to This post, the port for The query language is not open. That would be 9042. The two ports are for Data sync and for Java Management Extensions (JMX).

Why don’t I get Query port? Lets look in the log:

But starting it seems to trigger a cascading failure: I now have a lot of log files. Let me see if I can find the first error. Nah, they are all zipped up. Going to wipe and restart, using tail -f on the log file before asking to restart thrift.

Since trying to start it with nodetool enablethrift failed. Let me try changing that value in the config file and restarting. My log file now ends as:

Something is not happy. Let me see where the errors start. tail the log and tee it into a file in /tmp so I can look at it in the end.

Note: At this point, I suspected SELinux, so I put my machine in permissive mode. No change.

Option

Native Transport

So I turned to Minecraft. Turns out they have the same problem there, and the solution is to disable native transport: Lets see if that applies to Cassandra.

Ok, and looking in that file I see:

#Whether to start the native transport server.

#Please note that the address on which the native transport is bound is the

#same as the rpc_address. The port however is different and specified below.

Let me try disabling that and see what happens. No love but…in the log file I now see:

So let me try on that port.

Unrecognized Option Error For Java In Mac Download

Maybe it needs the native transport, and it should not be on the same port? Sure enough, further down the conf I find:

Change the value for start_native_transport back to true and restart the server.

Now it fails with no message why.

This native_transport intrigues me. Lets see what else we can find…hmm seems as if that is an old protocol, and the native_transport has been in effect for 5 or so years…which would explain why it shows in the F22 page, but is not really supported. I should probably turn it off.

Interlude: nodetool status

OK…what else can I do to test my cluster? Nodetool?

Better install repository

OK….wipe the system, try with a different repo. Before this, I wiped out all of my old config files, and will need to remake any changes that I noted above.

Option

Unrecognized Option Error For Java In Mac Os

sudo yum install http://apache.mirror.digitalpacific.com.au/cassandra/redhat/311x/cassandra-3.11.8-1.noarch.rpm http://apache.mirror.digitalpacific.com.au/cassandra/redhat/311x/cassandra-tools-3.11.8-1.noarch.rpm

Still no systemd scripts. Maybe in the 4 Beta. I’ll check that later. Make the same config changes for the jvm.options. Note that the thread priority has moved here, too. Also, it does not want to run as root any more…progress. Do this to let things log:

Insufficient permissions on directory /var/lib/cassandra/data

Get that one too.

sudo chown -R ayoung:ayoung /var/lib/cassandra/

telnet localhost 9160

Connects….I thought that would be turned off…interesting

cqlshConnection error: (‘Unable to connect to any servers’, {‘127.0.0.1’: ConnectionShutdown(‘Connection to 127.0.0.1 was closed’,)})$ strace cqlsh 2>&1 | grep -i connect(connect(5, {sa_family=AF_INET, sin_port=htons(9160), sin_addr=inet_addr(“127.0.0.1”)}, 16) = -1 EINPROGRESS (Operation now in progress)

This despite the fact that the docs say

Connects to 127.0.0.1:9042 by default.

Possibly picking up from config files.

Anticlimax: Works in a different terminal

I just opened another window, typed cqlsh and it worked…..go figure….Maybe some phantom env var from a previous incantation.

Summary

Unrecognized Option Error For Java In Macbook

  • For stable (not beta) Use the 3.11 version
  • Run as non-root user is now enforced
  • Change ownership of the var directories so your user can read and write
  • remove the GC options from jvm.options
  • Set the threading priority policy to 1 (or 0)
  • make sure that you have a clean env when running cqlsh
Java

It would be nice to have a better understanding of what went wrong running cqlsh. Problems that go away by themselves tend to return by them selves.