I have a small webdriver.io project just for experimenting with it for the first time. I now wanted to add allure reports but when I try to run allure open I get the following exception and I have no idea where I have to look to resolve this:
Starting web server...
2021-05-04 22:06:43.669:INFO::main: Logging initialized #349ms to org.eclipse.jetty.util.log.StdErrLog
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2630)
at java.base/java.lang.Runtime.load0(Runtime.java:768)
at java.base/java.lang.System.load(System.java:1837)
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2648)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
at java.base/java.lang.System.loadLibrary(System.java:1873)
at java.desktop/java.awt.Toolkit$3.run(Toolkit.java:1399)
at java.desktop/java.awt.Toolkit$3.run(Toolkit.java:1397)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1396)
at java.desktop/java.awt.Toolkit.<clinit>(Toolkit.java:1429)
at java.desktop/java.awt.Desktop.isDesktopSupported(Desktop.java:328)
at io.qameta.allure.Commands.openBrowser(Commands.java:220)
at io.qameta.allure.Commands.open(Commands.java:152)
at io.qameta.allure.CommandLine.run(CommandLine.java:165)
at java.base/java.util.Optional.orElseGet(Optional.java:369)
at io.qameta.allure.CommandLine.main(CommandLine.java:88)
The reports are getting generated just fine. Only when I try to open them I get this error.
I have allure-reporter and allure-commandline installed via npm. I have my project inside a Debian WSL and run chromedriver with VcXsrv X Server in case this might help.
Does anybody have an idea how this error might get resolved or have a hint for what to look for? I hope I gave you enough information. If not, just say what you need. Thanks in advance for your help!
on ubuntu 20.04:
sudo apt install openjdk-11-jdk
As Joakim suggested in this comment here, the headless version was installed. I got the same error with ldd, the library missing.
It's not a good idea to change your question in general, it's better to search first and ask a new one if needed, with all specifics.
This may help you understand the possible cause of the second issue:
Desktop API is not supported on the current platform
I highly recommend to use a plain Ubuntu Linux installation if you want to use Linux, WSL is not the same and has specific issues that you will not encounter in Linux. If a dedicated install is not an option, try to look for generic issues. Expect differences in behavior with shells, docker and graphical related things, because those things are specifically implemented in certain ways for WSL.
[For me it worked]
When you get this kinda error it means in installation of your jdk some of files are missed. To solve this problem act like bellow:
sudo apt install openjdk-[version]-jdk --fix-missing
eg.
sudo apt install openjdk-16-jdk --fix-missing
it means you already installed the jdk but there are some missing files with it. So you can fix it as easy as a pice of cake just by using '--fix-missing'
You likely have some missing downstream libraries.
Run this to find out which ones, then install them.
$ ldd /usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so
java.lang.UnsupportedOperationException: The BROWSE action is not supported on the current platform!
at java.desktop/java.awt.Desktop.checkActionSupport(Desktop.java:380)
at java.desktop/java.awt.Desktop.browse(Desktop.java:524)
at io.qameta.allure.Commands.openBrowser(Commands.java:222)
That means WSL doesn't support java.awt.Desktop.browse().
This has been brought up before in Stackoverflow.
See https://stackoverflow.com/a/27881223/775715
/usr/lib/jvm/java-17-openjdk-17.0.4.1.1-1.fc36.x86_64/lib/libawt_xawt.so
This error requires an updat of the jdk.
Download the current update from Oracle support jdk-17_linux-x64_bin.rpm
sudo rpm -ivh jdk-17_linux-x64_bin.rpm
this will install libawt_headless.so and it is working
Operating System deployed to is Fedora36
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-11-openjdk/lib/libawt_xawt.so
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2633)
at java.base/java.lang.Runtime.load0(Runtime.java:768)
at java.base/java.lang.System.load(System.java:1837)
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2445)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2501)
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2700)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2651)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
at java.base/java.lang.System.loadLibrary(System.java:1873)
at java.desktop/java.awt.Toolkit$3.run(Toolkit.java:1395)
at java.desktop/java.awt.Toolkit$3.run(Toolkit.java:1393)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1392)
at java.desktop/java.awt.Toolkit.<clinit>(Toolkit.java:1425)
at java.desktop/java.awt.Insets.<clinit>(Insets.java:89)
at java.desktop/javax.swing.plaf.synth.SynthLookAndFeel.<clinit>(SynthLookAndFeel.java:75)
at snowflake.App.main(App.java:67)
If you get this error on Manjaro Linux when running any Java program (in my case SnowFlake), then you need to install openjdk11-src, jre11-openjdk, jdk11-openjdk
Related
I have tried loading the latest versions of GraalVm from the site onto OS/X from : graalvm-ce-java11-darwin-amd64-20.2.0.tar.gz
I tar this bundle, following the instructions and sudo mv the directory to /Libaray/Java/JavaVirtualMachines and setup the .bash_profile per the instructions. If I run the java_home -V command I see the VM there.
When I try to execute any of the command line utilizes from the VM (java, javac, jar, etc.) I get a fault by OS/X saying the application is from an untrusted developer. I then I have to to control panel/security and settings/general and manually select each an every binary and each and every native library one at a time and tell OS/X to add them as an exception to allow them to be run.
Am I missing something or is this expected behavior? Is there a better way to install the graalVM on OS/X?
This is an old issue but maybe it helps:
https://github.com/oracle/graal/issues/1724
I wonder why this has not been fixed yet.
I am not very familiar with the Ubuntu. I have moved a jar file relatd to Blazegraph which I used on my Windows machine to my Ubuntu VM (Ubuntu 18.04 LTS Bionic).
I have also used chmod +x filename to make it executable. But when running the file, I get the following error:
ERROR: Banner.java:160: Uncaught exception in thread
java.lang.NullPointerException at
com.bigdata.rdf.sail.webapp.StandaloneNanoSparqlServer.main(StandaloneNanoSparqlServer.java:142)
Why do I get this message? I also found this thread on GitHub, but seems no one had a chance in fixing it!
Note: The file is blazegraph.jar which acts as a local server for the blazegraph so I can run SPARQL queries on some ontologies. Is this because the file is trying to act as a server and possibly firewall issues? However, the server will be at http://localhost:9999/blazegraph/ which I think shouldn't have to do anything with the firewall (if there is any on Linux).
Seems this is a bug with the Blazegraph.
See these links to read more about the problem: [1] [2].
PS: There have been some ways for getting rid of the problem but they did not work for me or I could't make them work. I initially wanted to remove this question but thought maybe others have the same problem.
When attempting to start Elasticsearch 5.1.1 via
$ elasticsearch
I get the output:
Error: Could not find or load main class -Xms2g
I've looked into:
I read it may be an error in how a class is called? But I'm not exposed to doing that. This thread doesn't help and isn't really my problem as I'm not installing a plugin.
I installed via Homebrew. Here is some output from that:
$ brew info elasticsearch
elasticsearch: stable 5.1.1, HEAD
Distributed search & analytics engine
https://www.elastic.co/products/elasticsearch
Conflicts with: elasticsearch#1.7, elasticsearch#2.4
/usr/local/Cellar/elasticsearch/5.1.1 (98 files, 35.2M) *
Built from source on 2016-12-14 at 09:23:56
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/elasticsearch.rb
==> Requirements
Required: java >= 1.8 ✔
==> Caveats
Data: /usr/local/var/elasticsearch/elasticsearch_GabbAHH/
Logs: /usr/local/var/log/elasticsearch/elasticsearch_GabbAHH.log
Plugins: /usr/local/Cellar/elasticsearch/5.1.1/libexec/plugins/
Config: /usr/local/etc/elasticsearch/
plugin script: /usr/local/Cellar/elasticsearch/5.1.1/libexec/bin/plugin
To have launchd start elasticsearch now and restart at login:
brew services start elasticsearch
Or, if you don't want/need a background service you can just run:
elasticsearch
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
mongodb
ruby
I also tried originally installing via manually extracting the .tar.gz package. I at first got some Java permission denied errors, but after running a chown to admin for myself I also got this same Error: Could not find or load main class type error.
I just updated my Java JDK to the latest: 1.8.0_112 and set my JAVA_HOME variable to that directory accordingly.
The most recent version of Elasticsearch 2 (2.4.3) works. Meanwhile, Elasticsearch v5.0.2 fails.
What can I do to have Elasticsearch properly installed on my Mac?
Watch out with this line in your .bashrc or similar:
export GREP_OPTIONS='--color=always'
That will break many shell's pipes, so many runners will fail without giving you any clue.
Distros as Ubuntu usually have this enabled by default for system users. Be careful and check that shell environment variable.
This problem was solved on my servers by just unsetting this variable.
You most likely have a problem in your .bash_profile. Usually elastic starts out of the box on a mac.
What I usually do to make upgrading and using multiple projects on my machine is using the following script:
#!/bin/bash
CURRENT_PROJECT=$(pwd)
CONFIG=$CURRENT_PROJECT/config
DATA=$CURRENT_PROJECT/data
LOGS=$CURRENT_PROJECT/logs
BASH_ES_OPTS="-Epath.conf=$CONFIG -Epath.data=$DATA -Epath.logs=$LOGS"
ELASTICSEARCH=$HOME/Development/elastic/elasticsearch/elasticsearch-5.1.1
$ELASTICSEARCH/bin/elasticsearch $BASH_ES_OPTS
Notice the options in BASH_ES_OPTS, these are the ones that changes a lot in version 5. My structure is a folder per project with this script and a few folders: config, data and logs. The config folder contains the files from the elastic distribution: elasticsearch.yml, jvm.properties and log4j2.properties.
I'm running 64-bit OpenSUSE 12.1, today I downloaded the latest Scala 2.9.2 from the official website, after unpacking the tgz and go to scala-2.9.2/bin directory, I executed "scala" and got this error message:
[init] error: error while loading <root>, error in opening zip file
Failed to initialize compiler: object scala not found.
** Note that as of 2.8 scala does not assume use of the java classpath.
** For the old behavior pass -usejavacp to scala, or if using a Settings
** object programatically, settings.usejavacp.value = true.
I attempted to run scala -usejavacp but it doesn't help.
I've been using Scala a lot in many other distros and have never got this error before.
My OpenSUSE installation has OpenJDK 6 installed.
Please suggest your opinions, thank you!
I have made the following attempts to solve the problem:
Install Oracle JDK 1.7 and run scala, confirmed that scala REPL reports running in hotspot JVM 1.7, same error occurs.
Installed sbt and run "console" from sbt, same error occurs.
strace and diff the output between sudo scala and scala as normal user, there is no difference except the error message above.
scala -Ylog-classpath as su and normal user, then diff the output, same as above.
disabled AppArmor and tried again, same error message.
Download other scala versions (all of 2.9x, and 2.10 milestone 4), all of their REPL give the same error message.
Made sure fsc is not running before scala REPL runs
Made sure that the hostname is resolvable
well this is a really interesting problem, I'll definitely post a solution if I can luckily find it.
Thanks a lot for your help!
Last edit:
Thanks for everyone here and on reddit (http://www.reddit.com/r/scala/comments/w5s0m/please_help_scala_only_runs_as_root_user_gives/) who offered very valuable suggestions to help me figure out this very strange issue. See my answer below for the solution.
Do not put sbt-launch.jar in your $SCALA_HOME/lib directory, your project's lib directory, or anywhere it will be put on a classpath.
I have just found out the reason:
A closer examination of the output of "strace -f scala" as normal user yields an interesting output:
[pid 11919] open("/usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre/lib/ext/gnome-java-bridge.jar", O_RDONLY) = -1 EACCES (Permission denied)
Soon follow that, is the system call to inform user that scala REPL failed to initialize:
[pid 11919] write(1, "\nFailed to initialize compiler: "..., 260
The gnome-java-bridge.jar has permission 400, I changed it to 444 and problem is solved!
The permission issue seems to have been listed as OpenSUSE bug:
http://lists.opensuse.org/opensuse-bugs/2012-07/msg00920.html
It looks like it's not being able to open `scala-library.jar´, or one of the other jar files required for REPL.
You did not say whether scalac works or not. That might give a clue.
At any rate, I'd make sure all of the jar files are a+r, and the directory they are in, as well as all other parent directories, are a+rx.
This is most probably caused by jdk-xxx/jre/lib/ext containing jars that is not readable. Please look for file starting with "."jar and "._jar" and remove them.
[UPDATE] Was just an idiot mistake. See end for solution.
I am trying to install Maven on my 2011 Macbook Pro. Unfortunately I don't know Java at all, but I am trying to muddle my way through some tools built in Java, and they imply that using Maven to install them will make things easier.
I followed the Maven install instructions here: http://maven.apache.org/download.html#Installation.
I...
1) downloaded Maven,
2) unzipped it,
3) put it in /usr/local/apache-maven-3.0.3/
4) added
export M2_HOME=/usr/local/apache-maven/apache-maven-3.0.3`
export M2=$M2_HOME/bin`
export PATH=$M2:$PATH`
to my .zshrc file
5) typed mvn --version and got back:
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/plexus/classworlds/launcher/Launcher
Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.classworlds.launcher.Launcher
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
I found a couple of blog posts (http://steveswinsburg.wordpress.com/2011/03/09/java-update-broke-my-maven/) that described how to fix a similar sounding error, but those seem to be problems with upgrading Maven 2 to Maven 3. Afaik, I've never even had Maven 2. I nevertheless followed the directions in that post, and am still getting the exact same error.
Please help!
Also does anyone know a good resource for a beginner to learn how the "Java ecosystem", i.e. Maven, classpaths, etc works? I tried some "Learn Java" videos at udemy.com, but they were all about the syntax of programming in Java, whereas most of the problems I've been having have been around figuring out how to make existing Java apps run in the first place, or how to follow basic jargon-filled documentation.
[SOLUTION]
Summary...idiot mistake.
While following the Maven installation directions, I cut-n-pasted the line "In a command terminal, add the M2_HOME environment variable, e.g. export M2_HOME=/usr/local/apache-maven/apache-maven-3.0.3", not realizing that I had actually installed my unzipped file in /usr/local/apache-maven-3.0.3.
Once again, scumbag brain "saves time" by refusing to automatically read apparently redundant information, so I didn't notice that apache's example expected I had nested the install inside a second folder.
Fixing the .zshrc line to read `export M2_HOME=/usr/local/apache-maven-3.0.3' fixed the problem.
Thanks ivantod for pointing out my error.
Mac OS X Lion ships with maven already installed on it # /usr/share/maven.
You only have to type java on terminal to install java and export JAVA_HOME in ~/.profile to /System/Library/Frameworks/JavaVM.framework/Home. Optionally you can set other parameters like MAVEN_OPTS and JAVA_OPTS.