VM error while starting Wildfly (JBoss) server - java

I have wildfly-10.0.0.Final available with PATH variable set. I am using Ubuntu. Also I have jdk1.7.0_79. I am facing the problem that as when I am trying to start server that is executing standalone.sh then I am getting the error,
Unrecognized VM option 'MetaspaceSize=96M'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Use jdk 1.8 instead of jdk 1.7. MetaspaceSize is a new flag added for Metaspace in jdk 1.8.

Check java -version. If it is not java version "1.8.0_xx", then set the JAVA_HOME environment variable as below and run the command,
bash-4.1$ export JAVA_HOME=LOCATION_TO_JDK1.8.0

You have to put in the standalone.bat file this line set JAVA_HOME=C:\Program Files\Java\jdk-9.0.4, and change the ubication of the JDK installation.

Related

Why does the Java JDK not set its own path after installation on Windows?

Problem:
After installing Java SE version 14.0.1 I tried to run the command java in CMD because I wanted to check if everything works as it should, but an error occurred because CMD could not find what I wanted.
I checked the system environment variable to see if the path for the Java JDK was set, but no, it was not set.
Question:
Why was the path not set by the Java JDK after installing Java SE 14.0.1?
It depens on the installator provider by the combianation of vendor and version. As far as I know the AdoptOpenJDK add the PATH variable

Unable to launch the UI Automator viewer

I am unable to launch the UI Automator viewer can anyone help me ?how can I launch it? when I double click on "uiautomatorviewer" for some time black window opens but closed automatically even I had set variables in windows path variable
ANDROID_HOME%\tools;
%ANDROID_HOME%\platform-tools;
even i am not sure how I can alaunch it?
If your using JDK 9 or 10 Please downgrade it to JDK 8. It should solve the problem.
Also ensure you have set the below path's correctly.
ANDROID_HOME C:\Users\xxx\AppData\Local\Android\Sdk
JAVA_HOME C:\Program Files\Java\jdk1.8.0_181
Under path in System variables
C:\Users\xxx\AppData\Local\Android\Sdk\tools\bin
C:\Users\xxx\AppData\Local\Android\Sdk\tools
C:\Users\xxx\AppData\Local\Android\Sdk\platform-tools
C:\Program Files\Java\jdk1.8.0_181\bin
Adding here as Answer so that It should be clear to everyone.
Found a solution which DON'T NEED ONE TO DOWNGRADE TO JAVA 8+
so, there is an option for JRE to run VM for "uiautomatorviewer".
Step:1
One needs to install Android Studio
Step:2
Add the below location to "path" System Variable-
C:\Program Files\Android\Android Studio\jre\bin
I have jdk-11.0.6 and "uiautomatorviewer" is working fine
I add this to Path C:\Program Files\Android\Android Studio\jre\bin in system variable
>>> java --version
openjdk 11.0.13 2021-10-19
OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
OpenJDK 64-Bit Server VM (build 11.0.13+0-b1751.21-8125866, mixed mode)
>>> javac --version
javac 11.0.13
I also try by set
JAVA_HOME C:\Program Files\Android\Android Studio\jre
ANDROID_HOME C:\... ...\Android\SDK
add bellow lines into Path
%ANDROID_HOME%\tools;
%ANDROID_HOME%\tools\bin;
%ANDROID_HOME%\platform-tools;
but when I try to open uiautomatorviewer.bat it show me error :-(
ERROR: No suitable Java found. In order to properly use the Android Developer
Tools, you need a suitable version of Java JDK installed on your system.
We recommend that you install the JDK version of JavaSE, available here:
http://www.oracle.com/technetwork/java/javase/downloads
If you already have Java installed, you can define the JAVA_HOME environment
variable in Control Panel / System / Avanced System Settings to point to the
JDK folder.
You can find the complete Android SDK requirements here:
http://developer.android.com/sdk/requirements.html
Edit the uiautomatorviewer.bat file
rem set java_exe=
call ..\lib\find_java.bat
edit to
set java_exe=C:\Program Files\Android\Android Studio\jre\bin\java.exe
rem call ..\lib\find_java.bat
try to run uiautomatorviewer.bat it show me error :-(
-Djava.ext.dirs=..\lib\x86_64;..\lib is not supported. Use -classpath instead.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
is there no way except downgrade jdk1.8.xx.xx.xx!!!!

Facing issue while installing opentaps

I am trying to install opentaps-1.5.0 on a Windows machine, Java version 1.7.0_45.
Getting an error
C:\opentaps-1.5.0>"\bin\java" -Xms512M - Xms1536M -XX:MaxPermSize=1024M -jar ofbiz.jar 1>runtime\logs\console.cog
Syatem cannot find the path specified`
try java version 1.6.... opentaps supports java1.5 or java1.6...
also you have to set java path("C:\Program Files\Java\jdk1.6"...inmy case) in the systems environment variable ...
check this link..
http://www.opentaps.org/docs/index.php/General_Installation_of_Opentaps

Ant and Classpath

I just started to learn Java using Thinking in Java book, and have some troubles using ant.
I'm using Ubuntu 12.04, and have openjdk 7 java installed. I also setup the CLASSPATH to be the code folder
When I run ant in code folder, this is the output:
Exception in thread "main" java.lang.RuntimeException: JDK 1.4.1 or higher is required to run the examples in this book.
[CheckVersion] at com.bruceeckel.tools.CheckVersion.main(Unknown Source)
However when I run java -version, this is the output:
java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.5) (6b27-1.12.5-0ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
How to setup ant and classpath correctly?
P/S: Thanks everyone for the help!!! I figured out why it fails to check the version.
The testing condition is "if(minor < '4' || point < '1')" in CheckVersion.java. Yet my version is 1.6.024, eventhough 6>4 but 0<1 that's why it failed. I guess we need to rewrite the testing condition!
Try setting your JAVA_HOME environment variable to the install directory of your 1.6 JDK.
When you type "java -version", the command shell is using the first java executable it finds in your PATH. Ant probably looks for the java executable in the "bin" sub-directory of your JAVA_HOME directory.
To find the location of your java executable, type the following:
which java
and let's say you got the following output:
/usr/local/java1.6/bin/java
You would then set your JAVA_HOME variable to /usr/local/java1.6. Assuming a Bourne or Bash shell, the syntax for that would be
export JAVA_HOME=/usr/local/java1.6

Eclipse JDK 7 Start Failure

When I try to use the eclipse.exe file to start the eclipse it fails. This issue started occuring after I installed JDK 7 on my system .
When I use the command line paramater
eclipse -vm "C:\Program Files\Java\jdk1.7.0_06\bin"
eclipse starts just fine. I am assuming it is something related to the JVM which has caused the issue.
Meanwhile when I try to check java version I get the following error:
C:\Test>java -version
Error occurred during initialization of VM
Not sure if the two are related.
java -version failing indicates to me that you probably need to configure the OS environment variables,
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_06
Path=...;%JAVA_HOME%\bin;

Categories