Missing spark file from my system? - scala

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?

Related

Glassfish5 not starting

i have tomcat working fine, the error is not even about the port, which i know how to change, is this some sort of java version compatibility problem?
i'm a student so i don't know much
here's the output
$ asadmin start-domain domain1
Exception in thread "main" java.lang.NullPointerException
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.initializeServiceLocator(AbstractModulesRegistryImpl.java:152)
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.newServiceLocator(AbstractModulesRegistryImpl.java:144)
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator(AbstractModulesRegistryImpl.java:218)
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator(AbstractModulesRegistryImpl.java:224)
at com.sun.enterprise.module.single.StaticModulesRegistry.createServiceLocator(StaticModulesRegistry.java:88)
at com.sun.enterprise.admin.cli.CLIContainer.getServiceLocator(CLIContainer.java:217)
at com.sun.enterprise.admin.cli.CLIContainer.getLocalCommand(CLIContainer.java:255)
at com.sun.enterprise.admin.cli.CLICommand.getCommand(CLICommand.java:231)
at com.sun.enterprise.admin.cli.AdminMain.executeCommand(AdminMain.java:371)
at com.sun.enterprise.admin.cli.AdminMain.doMain(AdminMain.java:306)
at org.glassfish.admin.cli.AsadminMain.main(AsadminMain.java:57)
the command $ asadmin list-applications says the server is not up
i'm on Mx Linux fully updated
$ java -version
openjdk version "11.0.16" 2022-07-19
OpenJDK Runtime Environment (build 11.0.16+8-post-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 11.0.16+8-post-Debian-1deb11u1, mixed mode, sharing)
i haven't done anything yet, i can't find any problem similar to this on google
It was the JDK version
Inside netbeans when i clicked on Start to start the server, it says something about JDK 11, netbeans has a feature that let's you download many open JDK versions, i downloaded a random openJDK8 version and it worked
I don't know how to edit the JDK version manually or from any other IDE though, but my (video) class is using netbeans so for now i'm ok (they didn't teach on video because the video is 2 years old so it's outdated)

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.

Starting kafka on Linux or Win

I have tried for the last 10 hours to start the kafka server but I couldn't.
I managed to install zookeeper and run it on win10 but I had the
classpath is empty. please build the project first e.g. by running 'gradlew
jarall'
error.
So I installed ubuntu and the jre 9, zookeeper workd fine here ,too. But kafka does not. The latest error I get is:
[0.000s][warning][gc] -Xloggc is deprecated. Will use -Xlog:gc:/home/emi/kafka/bin/../logs/kafkaServer-gc.log instead.
Unrecognized VM option 'PrintGCDateStamps'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
I even switched to java 8 and tried different versions of kafka, but I can't get it going. In both cases I don't think it's a problem of environement variables for java since zookeeper works just fine: java -version returns
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
Problem solved on Windows, probabily using the source file instead the scala compiled was the problem

Kafka start issue with Windows

I am trying to run Kafka on my windows machine and i get the below exception.
C:\Users\Abdul.Qaadir\Desktop\Camunda\Kafka\kafka_2.11-0.10.2.0\kafka_2.11-0.10.2.0\kafka_2.11-0.10.2.0\bin\windows>.\kafka-server-start.bat .\config\server.properties
**The input line is too long.
The syntax of the command is incorrect.**
C:\Users\Abdul.Qaadir\Desktop\Camunda\Kafka\kafka_2.11-0.10.2.0\kafka_2.11-0.10.2.0\kafka_2.11-0.10.2.0\bin\windows>java -version
java version "1.8.0_141"
Java(TM) SE Runtime Environment (build 1.8.0_141-b15)
Java HotSpot(TM) Client VM (build 25.141-b15, mixed mode)
Can anyone help?
enter image description here
I had the same problem in windows too.
As a workaround, unzip kafka in a folder with a shorter name,like C:\Users\YourUser\Desktop\Camunda\Kafka\
You must have the bin, lib, ... folders right there.
That should do the trick.
It was due to directory depth. Moved the kafka installable under c drive and it worked.

Matlab builder JA: Problems with accessing builder JA

First of all I would like to thank you for any kind of help, I try to be as clear as possible.
If I want to use MATLAB builder JA via deploytool, I have there no option to create JAVA package in deploytool GUI. I suppose that I have something wrong with settings but don't know which step exactly.
So first of all I Install MATLAB 2013a with MATLAB builder JA Version 2.2.6, I had to install corresponding version of Matlab Compiler Runtime (version v8.1) and also windows SDK 7.1. It is necessary to have proper version of JDK corresponding to Matlab version, so when I use command in Matlab:
version -java
"Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode"
So I downloaded proper version of JDK (x64bit same like my OS and MATLAB version are).
Setup a JAVA_HOME path (C:\Program Files\Java\jdk1.6.0_17) in environment variable, and also add a custom path to "Path" variable in my case:
C:\Program Files\Java\jdk1.6.0_17\bin;
C:\Program Files\MATLAB\R2013a\runtime\win64;
C:\Program Files\MATLAB\MATLAB Compiler Runtime\v81\runtime\win64;
So then when I type in MATLAB getenv JAVA_HOME I get a right path to JAVA installation, but when I type again version -java I get same response like I had with no installation of JDK. When I try to write javac -version command in Matlab, I get this response:
"Undefined function 'javac' for input arguments of type 'char'."
I also type this commands in my command line in windows, and the result was good:
"java version "1.6.0_17'
Java(TM) SE Runtime Enviroment (build 1.6.0_17-b04)
Java HotSpot(TM) 64-Bit Server VM (build 14.3.-b01, mixed mode)"
In the ideal scenario i should get same response in matlab but I don't and I have absolutely no idea why.
I was reading lots of material about it and no one has the same problem. I tried matlab 2013b too with another licence, MCR, and JDK (1.7.0_11) but with same result.
What am I doing wrong? please help.. thank you very much