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

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?

Related

Fastlane build failed

Im configuring the fastlane build for the first time.I don't have idea about this issue.Please help
[![Could not open settings generic class cache for settings file '/Volumes/Files/22/17/learn/uber_app/driver app new/driver_app_new/android/settings.gradle' (/Users/admin/.gradle/caches/6.6/scripts/dvrvymk2d1pk34aa6juknj4vr).
BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 60]1]1
I changed my Java 16 version to
java version "15.0.2" 2021-01-19
Java(TM) SE Runtime Environment (build 15.0.2+7-27)
Java HotSpot(TM) 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)
Issue resolved.
Gradle prior to 7.0 is not compatible with Java 16: GitHub: Gradle issue #13481.
Either use Gradle 7 or run Gradle using an older JDK: Using Java 16 with Gradle.

java web start fails to locate java runtime

Hi I am trying to run javaws but it prompts:
To open this Web Start application you need to download the Java Runtime Environment.
I am sure JRE is installed, maybe javaws does not find it, how do I fix that?
Johns-MacBook-Pro:~ johnmactavish$ java --version
java 13.0.2 2020-01-14
Java(TM) SE Runtime Environment (build 13.0.2+8)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
Johns-MacBook-Pro:~ johnmactavish$ javaws
No Java runtime present, requesting install.
Unable to locate a Java Runtime to invoke.
Johns-MacBook-Pro:~ johnmactavish$
Java Web Start (javaws) was deprecated in Java 9 and removed in Java 11.
As you are using java 13, you can either downgrade from 13 to 8, or look for alternatives.
Perhaps an alternative such as https://openwebstart.com/ can help you out with that.
P.S: In case you're using tools to manage version such as sdkman or such, there might be the case where it's also not available in SDKs # version 8 provided by sdkman.

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

Missing spark file from my system?

I'm trying to run a program written in Scala that uses Apache Spark 2.0. However, I keep getting the following error:
/opt/spark-1.6.1/bin/spark-class: line 86: /usr/java/jdk1.8.0_40/bin/java: No such file or directory
Does anyone know what might be causing this?
Edit: Running the java -version command yields the following result:
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-b15)
OpenJDK 64-Bit Server VM (build 25.111-b15, mixed mode)
Edit 2: Took a peek into /usr/java and found that instead of jdk1.8.0_40, I have jdk1.8.0_101. Used export JAVA_HOME to reset it and now env displays JAVA_HOME as the correct path. It's still not working, though! Same error anyway. Do I need to run some kind of update command?