I have a server with java code running and need to setup the same environment on another server to run the code
Now when I try to run my program I get this error
Exception in thread "main" java.lang.NoSuchMethodError: 'void sun.security.pkcs11.SunPKCS11.(java.io.InputStream)'
but on the first machine working fine and getting the result
I run java -v on first machine and get this result
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 8.1.002)
SAP Java Server VM (build 8.1.002 25.11-b13, Dec 16 2014 04:44:15 - 81_REL - optU - windows x86 - 6 - bas2:230506 (mixed mode))
but I can't find the same environment to install on the other server and make my program work
Related
I am using WSL-2 Ubuntu 20.04 on windows10 and I want to run a java application on it but I get the following error:
Error: JavaFX runtime components are missing, and are required to run
this application
It is strange because I have installed Java 8 which has JavaFX included.
java -version gives me back the following:
java -version
openjdk version "1.8.0_312"
OpenJDK Runtime Environment (build 1.8.0_312-8u312-b07-0ubuntu1~20.04-b07)OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode)
javac -version
javac 1.8.0_312
I am running the java program in the following way:
java -jar myprogram.jar
What do I miss?
I had downloaded the Cassandra software and installed the dependencies i.e. Python and Java. Then in cmd I wrote the following command.
C:\apache-cassandra-3.11.10\bin>cassandra
It gave the following output
WARNING! Powershell script execution unavailable.
Please use 'powershell Set-ExecutionPolicy Unrestricted'
on this user-account to run cassandra with fully featured
functionality on this platform.
Starting with legacy startup options
Starting Cassandra Server
Unrecognized VM option 'UseParNewGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
My java version is:
C:\apache-cassandra-3.11.10\bin>java --version
java 16 2021-03-16
Java(TM) SE Runtime Environment (build 16+36-2231)
Java HotSpot(TM) 64-Bit Server VM (build 16+36-2231, mixed mode, sharing)
Does Cassandra 3.11.10 support Java-16?
Set the appropriate execution policy in Powershell.
Cassandra 3 only works with Java 8 and lower.
The other possibility for you is to run Cassandra on WSL (Windows Subsystem Linux).
I am starting a Java application with the following command line arguments:
java -Dcom.sun.management.jmxremote.port=12312 \
-Dcom.sun.management.jmxremote.rmi.port=12313 \
-Dcom.sun.management.jmxremote.authenticate=false \
Main
My program exits immediately and I get the following error:
Error: Exception thrown by the agent : java.lang.NullPointerException
I am using Java 8 update 45 on Windows 7:
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
This error occurs if com.sun.management.jmxremote.rmi.port is set to a port that is already in use. Try setting the property to a free port or killing the process that is currently using the port in question.
There is a reported bug here in Open JDK to improve this error message. It is fixed in Java 8 update 60 and Java 7 update 80.
I was facing same issue.
After killing older process using same JMX port, issue got resolved and tomcat started properly.
I'm having issues starting my neo4j instance (2.0.0 M03). I have java 7 installed as indicated in the code block below but when trying to start neo4j it apparently does not recognize this, gives and error and does not start. The terminal output is below. Any ideas on how to fix this or what exactly is going wrong? Thanks a lot.
Tim-Bornys-MacBook-Pro:neo4j community 2.0.0 M03 BornyTM$ java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
Tim-Bornys-MacBook-Pro:neo4j community 2.0.0 M03 BornyTM$ bin/neo4j start
WARNING! You are using an unsupported version of the Java runtime. Please use Oracle(R) Java(TM) Runtime Environment 7.
Starting Neo4j Server...WARNING: not changing user
process [88317]... waiting for server to be ready.... Failed to start within 120 seconds.
Neo4j Server may have failed to start, please check the logs.
The problem was JAVA_HOME was not set to the correct JVM. To determine where you have your instance installed you can enter the following into terminal:
/usr/libexec/java_home -v 1.7
This should return the location, in my case: /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/
To set JAVA_HOME just export pointing towards the location like below (enter into the console):
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/
I am unable to execute the java command in a specific folder , throwing error as below
JVMXM008: Error occured while initialising System ClassException in thread "main" Could not create the Java virtual machine.
With same user, I am able to run java in home directory but I am not able to run in application config directory.
echo $JAVA_HOME
/usr/java14
java -version
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2)
Classic VM (build 1.4.2, J2RE 1.4.2 IBM AIX build ca142-20080515 (SR11) (JIT enabled: jitc))
It appears that you do not have appropriate permissions in the 'specific folder' to access resources needed to start the JVM. You either need to get permissions(preferred) or run as root.