CentOS Invalid maximum heap size for .exe program - java

im using a VM with minimal installed CentOS 7. Im quite new with linux and CentOs. My Java version:
java -version
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (build 25.232-b09, mixed mode)
When I try running a java based application (a .exe) I get the following error, this Java application should be running with Java8, in fact it was running last time the VM was on (last friday) today (sunday) when a turned on again it gives the error:
Invalid maximum heap size: -Xmx1g
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
I tried the following commands:
java -Xmx1024M -Xms1024M
result of above command
and
java -Xmx2048M -d64
results of the second command
But as you see I only get some java usage text, and the problem persists.
Also tried to add into .bash_profile the line. Again with no success.
export _JAVA_OPTIONS=-Xmx2g

Updating.
Hello, it worked after a reinstalled the app, and with the export _JAVA_OPTIONS=-Xmx2g on .bash_profile.

Related

How do I properly set up java paths and other system variables to start monkeyrunner?

When I first attempted to run monekyrunner.bet I got some error about java not being found. At that moment java.exe was at C:\Program Files\Android\Android Studio\jre\bin\java.exe which came with the latest android studio installation (Android Studio Dolphin | 2021.3.1 Patch 1; Runtime version: 11.0.13+0-b1751.21-8125866 amd64). I added this path to JAVA_HOME system variable, but I kept getting the same error.
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)
I then downloaded jdk-19 from https://www.oracle.com/java/technologies/downloads/#jdk19-windows as recommended in the moneyrunner error text. Now I have another java.exe at C:\Program Files\Java\jdk-19\bin\java.exe and I set C:\Program Files\Java\jdk-19\ in JAVA_HOME.
java version:
java 19.0.1 2022-10-18
Java(TM) SE Runtime Environment (build 19.0.1+10-21)
Java HotSpot(TM) 64-Bit Server VM (build 19.0.1+10-21, mixed mode, sharing)
After this I started getting some error about SWT folder not existing. Reading this, I added an ANDROID_SWT system variable, which I have set to C:\Users\UserName\AppData\Local\Android\Sdk\tools\lib\x86_64\.
After this I got some error about monkeyrunner-26.0.0-dev.jar. Reading this, I modified the monkeyrunner bat file as explained in the post, but now I am getting
this error:
-Djava.ext.dirs=.;C:\Users\UserName\AppData\Local\Android\Sdk\tools\lib\x86_64"
-Dcom.android.monkeyrunner.bindir=..\framework -jar .\..\lib\monkeyrunner-26.0.0-dev.jar is not supported. Use
-classpath instead.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
.
System variables:
ANDROID_SWT : C:\Users\UserName\AppData\Local\Android\Sdk\tools\lib\x86_64\
JAVA_HOME: C:\Program Files\Android\Android Studio\jre\
Is there a step by step guide on how exactly to start monkeyrunner? I want to send input events through monkeyrunner, as shown here.

Error in starting cassandra in windows 10 PC

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).

elasticsearch install plugin: Could not reserve enough space for object heap

I am trying to install the elasticsearch plugin with the command: ./plugin install license which I found on this tut: link
But I get the error message:
Error occurred during initialization of VM
Could not reserve enough
space for object heap Error: Could not create the Java Virtual
Machine. Error: A fatal exception has occurred. Program will exit.
After that even if I run java -version I get the same error! Before I run ./plugin install license java -version worked fine and printed:
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-0ubuntu1.14.04.1)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)
Does anybody know whats my problem here? Its a fresh install of Ubuntu 14.04.4 LTS and I installed elasticsearch 2.2.3
Installation for ElasticSearch
1) Comment entry in C:\\elasticsearch-5.4.0\elasticsearch-5.4.0\config\jvm.options
#-Xms2g
#-Xmx2g
2) set ES_JAVA_OPTS as below in elasticsearch.bat
set ES_JAVA_OPTS = "-Xms512m -Xmx512m"

Android Studio Crash on Fedora 22

I'm trying to run Android Studio in my Fedora22 machine. I've followed the instructions in the site, downloaded the zip, extracted it and ran studio.sh file.
It opens the Android Studio correctly, but after the download of components starts, it just closes without showing any dialogbox with the error.
As I'm running through the terminal, I saw the following error before the program gets closed:
/home/mlima/android-studio/bin/studio.sh: line 188: 30819 Aborted
(core dumped) LD_LIBRARY_PATH="$IDE_BIN_HOME:$LD_LIBRARY_PATH"
"$JDK/bin/java" $AGENT "-Xbootclasspath/a:$IDE_HOME/lib/boot.jar"
-classpath "$CLASSPATH" $VM_OPTIONS "-Djb.vmOptionsFile=$VM_OPTIONS_FILES_USED"
"-XX:ErrorFile=$HOME/java_error_in_STUDIO_%p.log" -Djb.restart.code=88
-Didea.paths.selector=AndroidStudio1.4 $IDE_PROPERTIES_PROPERTY $IDE_JVM_ARGS $REQUIRED_JVM_ARGS $MAIN_CLASS_NAME "$#"
My javac -version: javac 1.8.0_60-debug
Thanks
Try to reinstall javac java -version is:
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
And it work.
If this doesn't resolve the problem you have to find the way to set your environment HomePath variable points the current java sdk path.
Hope this can help, bye

Weblogic10.3.5 install: Unrecognized option: -d64

Im trying to set up weblogic in my machine.
I downloaded from http://www.oracle.com/technetwork/middleware/ias/downloads/wls-main-097127.html.
My PATH looks like this, C:\Program Files\Java\jdk1.5.0_22\bin;
Java - version in cmd prompt gives this,
C:\setups>java -version
java version "1.5.0_22"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_22-b03, mixed mode)
Now, when i execute the weblogic jar file using the command as specified in the oracle documentation, C:\setups>java -d64 -jar wls1035_generic.jar , I get the below error.
Unrecognized option: -d64
Could not create the Java virtual machine.
How should i get rid and execute the jar file to install weblogic? pls help.
I was having this issue. It happened because I had a 32bit JDK and not the 64bit JDK that was required by the weblogic install package
To check what version you have, you type the following in your terminal
java -d64 -version
If you get an error then that is your issue, proceed as below:
You can find the 64bit jdk at: Oracle
I think to avoid conflicts you might want to delete your current JDK

Categories