Unrecognized option: -XLoggc: - garbage-collection

Does OpenJDK does not support the -XLoggc flag? What equivalent flags can I use? Where are the flags for OpenJDK documented?
$ cat Hello.java
public class Hello {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
$ javac Hello.java
$ java -XLoggc:gc.log Hello
Unrecognized option: -XLoggc:gc.log
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
$ java -version
java version "1.7.0_147-icedtea"
OpenJDK Runtime Environment (IcedTea7 2.0pre) (7~b147-2.0~pre6-1ubuntu1)
OpenJDK Client VM (build 21.0-b17, mixed mode, sharing)

The flag is -Xloggc with lower-case "l".

Related

What causes this fatal error in the Amazon Corretto JVM?

When running my application on the Amazon Corretto JVM I encountered the following error. What does this mean?
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fcde9765caa, pid=1, tid=144
#
# JRE version: OpenJDK Runtime Environment Corretto-11.0.18.10.1 (11.0.18+10) (build 11.0.18+10-LTS)
# Java VM: OpenJDK 64-Bit Server VM Corretto-11.0.18.10.1 (11.0.18+10-LTS, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0xc03caa] ObjectSampleCheckpoint::add_to_leakp_set(Method const*, unsigned long)+0x7a
When reporting a JVM crash, always include hs_err.log dump produced by the JVM. A short error message is not enough to provide a definitive conclusion.
In your case, however, the reason is most likely the JVM bug JDK-8236743.
Upgrade to JDK 17+ where the issue is already fixed or disable OldObjectSample events in your JFR recording.

Console.Error.WriteLine() writes to stdout

The following program:
using System;
namespace teststderr {
class MainClass {
public static void Main(string[] args)
{
Console.Error.WriteLine("Hello World!");
}
}
}
when run with redirected stderr, still produces output:
$ ~/test-stderr/test-stderr/bin/Debug/test-stderr.exe 2>/dev/null
Hello World!
According to strace, it really writes to fd 1. But if I don't redirect stderr, it writes to fd 2. I find this behavior rather suprising, and cannot find it described anywhere. Can anybody clarify why it behaves so?
mono --version
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-10)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen

Anyone experiencing Error code -46 on Java SDK 1.20

Latest Java SDK (1.20) seems to throw NoSuchMethodError when trying to autheticate with the accesspoint using onAuthenticationRequired() ; Once the exception is thrown then all subsequent attempt to connect to the bridge will result in " Error - Code 46 Message bridge not responding"
Anyone experiencing this behaviour, code is executed on
java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.8) (6b27-1.12.8)
OpenJDK Zero VM (build 20.0-b12, mixed mode)
Exception in thread "Thread-25" java.lang.NoSuchMethodError: java.lang.Integer.compare(II)I
at com.philips.lighting.hue.sdk.fbp.PHBridgeVersionManager$1.compare(PHBridgeVersionManager.java:83)
at com.philips.lighting.hue.sdk.fbp.PHBridgeVersionManager$1.compare(PHBridgeVersionManager.java:1)
at java.util.Arrays.mergeSort(Arrays.java:1283)
at java.util.Arrays.mergeSort(Arrays.java:1294)
at java.util.Arrays.sort(Arrays.java:1223)
at java.util.Collections.sort(Collections.java:176)
at com.philips.lighting.hue.sdk.fbp.PHBridgeVersionManager.setFallbackBridgeVersion(PHBridgeVersionManager.java:130)
at com.philips.lighting.hue.sdk.fbp.PHBridgeVersionManager.setBridgeVersion(PHBridgeVersionManager.java:365)
at com.philips.lighting.hue.sdk.connection.impl.PHBridgeInternal.processResponse(PHBridgeInternal.java:450)
at com.philips.lighting.hue.sdk.connection.impl.PHBridgeInternal$1.run(PHBridgeInternal.java:122)
Integer.compare was introduced in Java 7 and you're clearly using Java 6 based on the error message.
Try using Java 7 or Java 8.

Error while starting android studio

I am getting this error while starting android studio. Can you please help
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f6b09ea7208, pid=4501, tid=0x00007f6a7aafc700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_131-b11) (build 1.8.0_131-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# J 6230 C1 org.iq80.snappy.UnsafeMemory.copyLong([BI[BI)V (116 bytes) # 0x00007f6b09ea7208 [0x00007f6b09ea71a0+0x68]

I am trying to generate .h file in android-studio for NDK

Can anyone figure out whats the issue in this command.
i used command for generating is:
-classpath $Classpath$ -v -jni $FileClass$
it throws exception:
Exception in thread "main" java.lang.IllegalArgumentException: Not a valid class name: Files\Java\jdk1.8.0_102\jre\lib\charsets.jar;C:\Program
at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:129)
at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:107)
at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:64)
at com.sun.tools.javah.JavahTask.run(JavahTask.java:503)
at com.sun.tools.javah.JavahTask.run(JavahTask.java:329)
at com.sun.tools.javah.Main.main(Main.java:46)
MyNDK.class:
public class MyNDK {
// Used to load the 'native-lib' library on application startup.
static {
System.loadLibrary("MyLibrary");
}
public native int getHelloSum(int[] val,int size);
}
Setting for NDK:
#Alex Cohn helped me to fix this the correct answer is :
-classpath "$Classpath$" -v -jni $FileClass$

Resources