Uiautomatorviewer not working. It is showing lib is not supported - uiautomatorviewer

My Java version is
openjdk version "16.0.1" 2021-04-20
OpenJDK Runtime Environment (build 16.0.1+9-24)
OpenJDK 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)
It is showing like this error->
-Djava.ext.dirs=..\lib\x86_64;..\lib is not supported.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. The program will exit.
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

Related

sdkman! How to manage pre-existing JDK?

I wanted to try Java 19 and have easy switching back to the Java 17 that I have already installed.
So, I installed sdkman but it knows nothing of the previous Java.
Found the "install local" command, used it to link the java 17 location to a unique name and sdkman seems happy, as it reports "Done installing!".
After that the "sdk current java" returns "Not using any version of java".
So then I tried "sdk use java [my unique name]. That was also accepted.
But still the "sdk current java" response is unchanged.
Have I misunderstood how this should work? I want to be sure sdkman knows what is there already before I add another Java.
Thanks for your advice!
Terminal commands follow (Kubuntu 22.04)
john#NUC8i3BEH:~$ java -version
openjdk version "17.0.4.1" 2022-08-12 LTS
OpenJDK Runtime Environment (build 17.0.4.1+1-LTS)
OpenJDK 64-Bit Server VM (build 17.0.4.1+1-LTS, mixed mode, sharing)
john#NUC8i3BEH:~$ sdk install java 17.0.4.1-Bellsoft /usr/lib/jvm/bellsoft-java17-full-amd64
Invalid version! 17.0.4.1-Bellsoft with length 17 exceeds max of 15!
john#NUC8i3BEH:~$ sdk install java 17.0.4.1-Bell /usr/lib/jvm/bellsoft-java17-full-amd64
Linking java 17.0.4.1-Bell to /usr/lib/jvm/bellsoft-java17-full-amd64
Done installing!
john#NUC8i3BEH:~$ sdk list
john#NUC8i3BEH:~$ sdk current
No candidates are in use
john#NUC8i3BEH:~$ sdk current java
Not using any version of java
john#NUC8i3BEH:~$ sdk list java
john#NUC8i3BEH:~$ sdk use java 17.0.4.1-Bell
==== BROADCAST =================================================================
* 2022-09-21: neo4jmigrations 1.12.0 available on SDKMAN! https://github.com/michael-simons/neo4j-migrations/releases/tag/1.12.0
* 2022-09-21: micronaut 3.7.0 available on SDKMAN!
* 2022-09-20: quarkus 2.12.3.Final available on SDKMAN! https://github.com/quarkusio/quarkus/releases/tag/2.12.3.Final
================================================================================
Setting java version 17.0.4.1-Bell as default.
Using java version 17.0.4.1-Bell in this shell.
john#NUC8i3BEH:~$ java -version
openjdk version "17.0.4.1" 2022-08-12 LTS
OpenJDK Runtime Environment (build 17.0.4.1+1-LTS)
OpenJDK 64-Bit Server VM (build 17.0.4.1+1-LTS, mixed mode, sharing)
john#NUC8i3BEH:~$ sdk current java
Not using any version of java
john#NUC8i3BEH:~$
OK, I should have tried harder.
I installed Java 19 with sdkman then the command "sdk default java [my old version]" switches back as required.

Building Kotlin Multiplatform app with Xcode Cloud

as Apple announced that Xcode Cloud is now available for all developers, I tried to set it up for a Kotlin Multiplatform project. The start was a little bit hard tbh. Currently I am facing following problem during a simple test action:
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.
Command PhaseScriptExecution failed with a nonzero exit code
So I tried to install a jdk during the ci_post_clone.sh phase. The output of java -version after the installation on the Xcode Cloud is the following:
openjdk version "17.0.2" 2022-01-18
OpenJDK Runtime Environment (build 17.0.2+8-86)
OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing)
Installed java
also ./gradlew -v output:
Showing All Messages
------------------------------------------------------------
Gradle 7.4.2
------------------------------------------------------------
Kotlin: 1.5.31
Groovy: 3.0.9
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 17.0.2 (Oracle Corporation 17.0.2+8-86)
OS: Mac OS X 12.4 x86_64
Nevertheless, I still get the same error. Is this maybe a restriction by Apple?
Any ideas?

JMC Java Flight Recorder not enabled

I am using spring tool suite with the java mission control plugin to start an app which I would like to monitor using the JFR. I added -XX:+UnlockCommercialFeatures -XX:+FlightRecorder to the SpringToolSuite4.ini and additionally set JAVA_OPTS with those two flags (both of which is not necessary if I understand it correctly) and -XX:+FlightRecorder in Run configurations > Arguments > VM arguments of the application to be monitored. When adding both flags as well to the run configuration the application cannot be started with the openJdk.
After starting the application in the JVM Browser when selecting the Flight Recorder I get the following exception.
java.lang.RuntimeException: Flight Recorder features are not enabled. To enable this you need to use a Java 7u4 or later JVM started with -XX:+UnlockCommercialFeatures -XX:+FlightRecorder.
at com.oracle.jmc.flightrecorder.controlpanel.ui.FlightRecorderProvider.refresh(FlightRecorderProvider.java:105)
at com.oracle.jmc.browser.views.JVMBrowserView$1.run(JVMBrowserView.java:98)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: com.oracle.jmc.rjmx.services.jfr.FlightRecorderException: Flight Recorder features are not enabled. To enable this you need to use a Java 7u4 or later JVM started with -XX:+UnlockCommercialFeatures -XX:+FlightRecorder.
at com.oracle.jmc.flightrecorder.controlpanel.ui.FlightRecorderProvider.getService(FlightRecorderProvider.java:161)
at com.oracle.jmc.flightrecorder.controlpanel.ui.FlightRecorderProvider.refreshRecordings(FlightRecorderProvider.java:117)
at com.oracle.jmc.flightrecorder.controlpanel.ui.FlightRecorderProvider.refresh(FlightRecorderProvider.java:94)
... 7 more
I tried it with the following java versions.
$ java -version
openjdk version "11.0.2" 2018-10-16
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.2+7)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.2+7, mixed mode)
or with the JDK from oracle
$ java -version
java version "11.0.2" 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)
For none of the above mentioned JDK's there is a jmc.exe which was there with java 8. Is that part of the plugin?
How can I get this running?
IIRC, Java 11 requires JMC 7 to be able to start and view recordings.
JMC 7 EA builds are expected to appear here soon - https://jdk.java.net/jmc/
In the meantime you can build JMC yourself, see http://hg.openjdk.java.net/jmc/jmc7/ (or github, not exactly sure which version it is synced to - https://github.com/JDKMissionControl/jmc) and the README on how to build.
You can start recordings using JVM command line flags, and using jcmd, and parse the recordings using https://docs.oracle.com/en/java/javase/11/docs/api/jdk.jfr/jdk/jfr/consumer/package-summary.html

Eclipse (php) always crashes EXCEPTION_ACCESS_VIOLATION

Im not so familiar in eclipse and new of it.
This is the error log file
A fatal error has been detected by the Java Runtime Environment:
EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0xffffffffa5795120, pid=4680, tid=0x00000000000009f8
JRE version: Java(TM) SE Runtime Environment (8.0_121-b13) (build 1.8.0_121-b13)
Java VM: Java HotSpot(TM) 64-Bit Server VM (25.121-b13 mixed mode windows-amd64 compressed oops)
Problematic frame:
C 0xffffffffa5795120
Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
If you would like to submit a bug report, please visit:
http://bugreport.java.com/bugreport/crash.jsp
I already searched here in stackoverflow and tried put this on eclipse.ini
-XX:CompileCommand=exclude,org.eclipse.jdt.internal.compiler.parser.TypeConverter::*
still my eclipse crashes

scala-native build failed in windwos with java.io.IOException: Cannot run program "which" error

When I build Scala native demo using sbt rtlib/publishLocal nscplugin/publishLocal it gives following error
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
Scala code runner version 2.12.0-M3 -- Copyright 2002-2015, LAMP/EPFL
Error
[info] Loading project definition from D:\Work\RandD\WSAMITScript\Scala-Native\scala-native\project
java.io.IOException: Cannot run program "which": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at sbt.SimpleProcessBuilder.run(ProcessImpl.scala:349)
at sbt.AbstractProcessBuilder.lines(ProcessImpl.scala:149)
at sbt.AbstractProcessBuilder.lines_$bang(ProcessImpl.scala:143)
at scala.scalanative.sbtplugin.ScalaNative
Scala Native currently doesn't support Windows. Follow the corresponding issue to track progress on that front.
Have you tried if it works inside a Cygwin terminal?