Unrecognized VM option 'ShowCodeDetailsInExceptionMessages' - java

I'm new to java and I met this problem when I learnt about running junits testing in intelliJ. I changed run/debuug configurations templates for new projects->Junit->VM options to "-XX:+ShowCodeDetailsInExceptionMessages". Then when I ran the test file, it showed error message like :
Unrecognized VM option 'ShowCodeDetailsInExceptionMessages'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Could anyone help me figure out this problem? Thanks

The option -XX:+ShowCodeDetailsInExceptionMessages was introduced in Java 14 (https://openjdk.java.net/jeps/358), I suppose that you are trying to use this option in a previous version of Java.

Related

Working with MCRTsim simulator on a LINUX system

I am trying to use the MCRTsim simulator in my research work. As documented in https://resl.csie.nptu.edu.tw/dokuwiki/doku.php?id=guide, I run this command java -jar MCRTsim/dist/MCRTsim2.8.jar in specified directory, but the simulation window did not pop up. Instead, I got following exceptions:
Exception in thread "main" java.lang.NullPointerException
at java.base/java.io.Reader.<init>(Reader.java:167)
at java.base/java.io.InputStreamReader.<init>(InputStreamReader.java:109)
at org.apache.commons.io.IOUtils.copy(IOUtils.java:2440)
at org.apache.commons.io.IOUtils.toString(IOUtils.java:1084)
at org.apache.commons.io.IOUtils.toString(IOUtils.java:1110)
at userInterface.frontEnd.SimulationViewer.setComboBox(SimulationViewer.java:529)
at userInterface.frontEnd.SimulationViewer.initialize(SimulationViewer.java:359)
at userInterface.frontEnd.SimulationViewer.<init>(SimulationViewer.java:97)
at userInterface.UserInterface.initialize(UserInterface.java:45)
at userInterface.UserInterface.<init>(UserInterface.java:31)
at mcrtsim.MCRTsim.main(MCRTsim.java:55)
I am using Ubuntu system and JDK 11. I have not used Java much. I am not able to understand what this error is saying. Would anyone please help me with this?
Finally, I got the solution to this problem. I think this simulator is compatible with openjdk-8. So, I removed openjdk-11 from my system and installed openjdk-8.
After installing openjdk-8, I run the command java -jar dist/MCRTsim2.8.jar . This time I got the following error:
Exception in thread "main" java.awt.AWTError: Assistive Technology not
found: org.GNOME.Accessibility.AtkWrapper
at java.awt.Toolkit.loadAssistiveTechnologies(Toolkit.java:807)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:886)
at java.awt.Window.getToolkit(Window.java:1358)
at java.awt.Window.init(Window.java:506)
at java.awt.Window.<init>(Window.java:537)
at java.awt.Frame.<init>(Frame.java:420)
at javax.swing.JFrame.<init>(JFrame.java:233)
at userInterface.UserInterface.initialize(UserInterface.java:37)
at userInterface.UserInterface.<init>(UserInterface.java:31)
at mcrtsim.MCRTsim.main(MCRTsim.java:55)
After that, I followed this blog https://askubuntu.com/questions/695560/assistive-technology-not-found-awterror to rectify the above error.
I just commented this line #assistive_technologies=org.GNOME.Accessibility.AtkWrapper in /etc/java-8-openjdk/accessibility.properties file.
And, it started working.

HBASE error : Unrecognized VM option 'UseConcMarkSweepGC'

I have jdk-15.0.1 on my laptop, and have installed HBASE (hbase-2.2.6 version).
I followed every steps to install HBASE on this link : https://www.learntospark.com/2020/08/setup-hbase-in-windows.html
The problem is that when I try running HBASE in my command line using :
start-hbase.cmd
I get the following error message :
Unrecognized VM option 'UseConcMarkSweepGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
ERROR: Could not determine the startup mode.
As a beginner, I tried scouring around for information, but nothing that matches my problem.
I would be glad for any help you could give me.
CMS garbage collector is removed in JDK 15, thus UseConcMarkSweepGC too is removed.
JEP 363: Remove the Concurrent Mark Sweep GC
So, either you should switch back to java 8 or 11, or you should modify below line:
set HBASE_OPTS="-XX:+UseConcMarkSweepGC" "-Djava.net.preferIPv4Stack=true"
with
set HBASE_OPTS="-Djava.net.preferIPv4Stack=true"

Is there a dependency that is missing for this soot dependent app?

I try to run soot dependent app, using lots of jar files as dependencies in the compilation and every time a new error occurs.
The error I got at last is this:
[main] INFO soot.jimple.infoflow.android.SetupApplication - ARSC file parsing took 0.01102201 seconds
Exception in thread "main" java.lang.NoSuchMethodError: soot.Body.getUnits()Lsoot/PatchingChain;
at soot.jimple.infoflow.entryPointCreators.BaseEntryPointCreator.createEmptyMainMethod(BaseEntryPointCreator.java:165)
at soot.jimple.infoflow.entryPointCreators.BaseEntryPointCreator.createDummyMainInternal(BaseEntryPointCreator.java:123)
at soot.jimple.infoflow.entryPointCreators.BaseEntryPointCreator.createDummyMain(BaseEntryPointCreator.java:109)
at soot.jimple.infoflow.android.SetupApplication.createMainMethod(SetupApplication.java:622)
at soot.jimple.infoflow.android.SetupApplication.calculateCallbackMethods(SetupApplication.java:471)
at soot.jimple.infoflow.android.SetupApplication.calculateSourcesSinksEntrypoints(SetupApplication.java:401)
at soot.jimple.infoflow.android.SetupApplication.calculateSourcesSinksEntrypoints(SetupApplication.java:359)
at Appgraph.main(Appgraph.java:37)
I try to run it both in Java 11 and Java 8 but the same error occurs. The compilation and running commands I use are:
javac -cp ".:soot-4.1.0-jar-with-dependencies.jar:soot-infoflow-android.jar:soot-infoflow.jar:axml-2.0.jar:commons-io-2.6.jar:android.jar:guava-27.1-android.jar:jsr305-1.3.9.jar:dexlib2-2.3.4.jar:multidexlib2-2.3.4.r2.jar:failureaccess-1.0.1.jar:sootall-2.5.0.jar:soot-2.5.0.jar:soot.jar:soot-4.1.0-jar-with-dependencies.jar" Appgraph.java for the compilation command
java -Xmx2g -cp ".:soot-4.1.0-jar-with-dependencies.jar:soot-infoflow-android.jar:soot-infoflow.jar:axml-2.0.jar:commons-io-2.6.jar:android.jar:guava-27.1-android.jar:jsr305-1.3.9.jar:dexlib2-2.3.4.jar:multidexlib2-2.3.4.r2.jar:failureaccess-1.0.1.jar:sootall-2.5.0.jar:soot-2.5.0.jar:SourcesAndSinks.txt" Appgraph apks/3baea0cd661a580a84e4110b1a309942.apk . as the running command
I tried multiple versions of soot but no version got me past the above error.
Seems like you are trying to use a very old version of FlowDroid (soot-infoflow) together with a new version of Soot.
The mentioned method soot.Body.getUnits()Lsoot/PatchingChain; is part of Soot and has been changed in August 2018: https://github.com/Sable/soot/commit/25e145a694676a6ae786ebb44fcef51aa03b4cf5#diff-e17f2a0d88bf86133287578f02eb7483
Hence you need a version of FlowDroid that has been released after that date.

Selenium HTML Runner Error (Multi-Window)

I'm trying to execute html tests (recorded with Selenium IDE on firefox) with the following command :
$> java -jar /path/to/selenium-html-runner-3.0.0.jar -htmlSuite "*firefox" "http://www.google.com" "/path/to/test.html" "/path/to/results.html"
I'm getting the following error :
$> Multi-window mode is longer used as an option and will be ignored.
Exception in thread "main" java.lang.NullPointerException
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.validateArgs(HTMLLauncher.java:261)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.mainInt(HTMLLauncher.java:218)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.main(HTMLLauncher.java:273)
Any ideas of want is wrong here ?
Thanks !
This seems to be a bug that was fixed in the recently released 3.0.1.

Calling Java from Python: "Can't find or load class" Error

I'm trying to call a java program from python using command line. The code is as follows:
subprocess.check_output(["java", "pitt.search.semanticvectors.CompareTerms", "-queryvectorfile","termvectors.bin","term1","term2"])
I get the following error:
Error: Could not find or load main class pitt.search.semanticvectors.CompareTerms
This happens when I run the program from PyDev (version 2.5 in Eclipse 3.7.2). However, if I run the same code from the terminal, it works and I get the result I want.
I'm almost sure that the problem is related with some configuration of PyDev and how it handles the java CLASSPATH, which is:
/Users/feralvam/Programas/semanticvectors-3.4/semanticvectors-3.4.jar:/Users/feralvam/Programas/lucene-3.5.0/lucene-core-3.5.0.jar:/Users/feralvam/Programas/lucene-3.5.0/contrib/demo/lucene-demo-3.5.0.jar:
The class "pitt.search.semanticvectors.CompareTerms" is in "semanticvectors-3.4.jar".
Any help you could give me would be really appreciated.
Thanks!
The solution proposed by #eis worked. Now, the command is:
subprocess.check_output(["java", "-classpath", "/Users/feralvam/Programas/semanticvectors-3.4/semanticvectors-3.4.jar:/Users/feralvam/Programas/lucene-3.5.0/lucene-core-3.5.0.jar:/Users/feralvam/Programas/lucene-3.5.0/contrib/demo/lucene-demo-3.5.0.jar:", "pitt.search.semanticvectors.CompareTerms", "-queryvectorfile","/Users/feralvam/termvectors.bin","term1","term2"])

Categories

Resources