Travis build OpenJDK10 with JavaFx support - java

Since a few days travis does not support the jdk option oraclejdk10 anymore. So I tried to move to openjdk10. The problem is, that I need JavaFX support, and I get various error messages for various tries to get it working:
Try 1:
language: java
install: true
script: "cd Aggregation; mvn test -B"
sudo: false
jdk:
- openjdk10
notifications:
email:
recipients:
- junktogo#web.de
on_success: change
on_failure: always
Travis error:
Multiple packages like javafx.application do not exist
Try 2 (Install the openjfx package):
I added the following section:
before_install:
- sudo apt install -y openjfx
Travis error:
E: Unable to locate package openjfx
The command "sudo apt install -y openjfx" failed and exited with 100 during.
This problem remains even if adding sudo apt update.
Try 3:
before_install:
- sudo apt-get build-dep libopenjfx-java
- sudo apt-get --compile source libopenjfx-java
Travis error:
E: Unable to locate package libopenjfx-java
The command "sudo apt-get build-dep libopenjfx-java" failed and exited with 100 during.

As Jan S. suggested including JavaFX using a Maven dependency instead of trying to build it using Travis works just fine.
Add something like the following to your Maven dependencies section:
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>11</version>
</dependency>

Teavis build with OpenJDK 8
language: java
dist: bionic
jdk:
- openjdk8
before_install:
- sudo apt-get update -q
- sudo apt install openjfx=8u161-b12-1ubuntu2 libopenjfx-java=8u161-b12-1ubuntu2 libopenjfx-jni=8u161-b12-1ubuntu2
- chmod +x deploy.sh
after_success:
- ./deploy.sh

You need a proper setup of OpenJFX to bring it to work since JavaFX is not included in OpenJDK and also you should upgrade to OpenJDK 11 since Java 10 is EOL (End of Life).
Checkout the official documentation:
https://openjfx.io/
OpenJDK 11:
https://jdk.java.net/11/

Related

java.lang.UnsatisfiedLinkError: /usr/local/openjdk-8/jre/lib/amd64/libawt_xawt.so: libXrender.so.1:

I am running my automation test project in Gitlab pipeline. I am getting the exception as "java.lang.UnsatisfiedLinkError: /usr/local/openjdk-8/jre/lib/amd64/libawt_xawt.so: libXrender.so.1: cannot open shared object file: No such file or directory"
I tried multiple solution for installing and updating the packages but no luck
Tried solutions :
dpkg --add-architecture i386
apt-get update
apt -y install libxext6
apt-get -y install libbz2-1.0:i386 libxrender1:i386 libxtst6:i386 libxi6:i386
apt-get -y install libxrender1 libxtst6 libxi6
could you please suggest?
After running java -jar languagetool.jar I received the same error as your question mentions:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so
Based on this similar question, I tried:
sudo apt-get install -y openjdk-6-jre
Which returned:
Reading package lists... Done Building dependency tree Reading
state information... Done Package openjdk-6-jre is not available, but
is referred to by another package. This may mean that the package is
missing, has been obsoleted, or is only available from another source
However the following packages replace it: icedtea-netx
E: Package 'openjdk-6-jre' has no installation candidate
Hence, I tried:
sudo apt-get install -y icedtea-netx
And that resolved the error.
Are you trying to build the native lib (creating the .so file in the fly) or trying to make use of the pre-built version of it? In the first case, make sure your test-automation tool supports it; in the second case, make sure the presence of your lib file in the appropriate location.
You are probably encountering this error because you do not have the libawt_xawt.so package in your /usr/local/openjdk-8/jre/lib/amd64/ directory.
To fix the problem, follow these steps:
1- Update the package index:
sudo apt-get update
2- Install openjdk-11-jre deb package:
sudo apt-get install openjdk-11-jre
source here.

Java installation error in Ubuntu 18.4 LTS

I have to run Django CRM in my local machine. I followed all commands and tried to install every dependency.
I got stuck in the following command.
sudo apt-get install oracle-java8-installer -y java -version
I got the following error when I tried above command.
E: Command line option 'e' [from -version] is not understood in combination with the other options.
The link of Github CRM Django CRM
Documentation
Please someone help me.
Looking to Django-CRM documentation, seems like the command to install java (required by elasticsearch dependency) it's not the correct one for ubuntu 18.04
To install it you need to run:
apt-get install openjdk-8-jre-headless
Then you can follow the instructions as in the documentation
wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch > key.elastic
apt-key add key.elastic
echo "deb https://packages.elastic.co/elasticsearch/2.x/debian stable main" | tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list
apt-get update && apt-get install elasticsearch -y
Also, remember to add sudo on the commands if you are not running the commands as root

The program 'mvn' can be found in the following packages:

I am trying to install dataloader on my Linux machine.
https://github.com/forcedotcom/dataloader
There is a command line on third line:
$ mvn clean package -DskipTests
When I typed that in, I got this error:
The program 'mvn' can be found in the following packages:
* maven
* maven2
Try: sudo apt-get install <selected package>
I am not sure what to do.
Dataloader needs Maven. It's a dependency manager for Java.
Thus you have to install Maven before being able to use it.
Just run sudo apt-get update && sudo apt-get install maven2 and mvn will be available on your computer.
Maven documentation (for more up to date installation instructions) : https://maven.apache.org/install.html

0 NATIVE_LIBRARY_NAME cannot be resolved or is not a field with Linux + Eclipse + Java

I get an error on Core.NATIVE_LIBRARY_NAME like so:
Stacktrace:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
NATIVE_LIBRARY_NAME cannot be resolved or is not a field
at MyVideoCap.main(MyVideoCap.java:7)
I had settled the NativLibrary path at the following location.
/home/.../OpenCV/opencv-2.4.5/build/lib
I had followed the instruction on https://www.openshift.com/blogs/day-12-opencv-face-detection-for-java-developers but it doesn't creates any opencv2.4.9.jar file I am working on ubuntu 12 and eclipse with opencv api suppoert.
so help me if you can to generating and building the jar file in the build directory in ubuntu. thanks in advance...
Here I found the full Installing progress of the OpenCV...
# install basic development environment
sudo apt-get install build-essential cmake pkg-config
# install opencv dependencies. ubuntu 13.04 ships with opencv which is close enough to 2.4.6 to pull in most of the needed dependencies.
sudo apt-get build-dep libopencv-dev
# additional dependencies for java support
sudo apt-get install default-jdk ant
# compile opencv
tar xzvf opencv-2.4.6.1.tar.gz
cd opencv-2.4.6.1
mkdir build; cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON ..
make
sudo make install
And in last don't forget to set Native library path to the
/home/.../opencv-2.4.6.1/build/lib
Thats it...

How to install Maven 3 on Ubuntu 18.04/17.04/16.10/16.04 LTS/15.10/15.04/14.10/14.04 LTS/13.10/13.04 by using apt-get? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Try:
sudo apt-get install maven
If it works for you ignore the rest of this post.
Intro
I started setting up my Ubuntu 12.10 on April 2013 and the normal sudo apt-get install maven was not working for maven 3 back then.
The manual installation in this post is useful if you like to dig in deeper to your ubuntu kernel in regards with apt-get and where it finds the list of applications that are available for installation on Ubuntu
. It can also be potentially useful for more recent releases of Ubuntu like Ubuntu 15.04, etc. if you face the same problem as I did back then with Ubuntu 12.10.
Automatic Installation via apt-get:
Checkout the manual installation if your current ubuntu can not install maven via common 'apt-get install maven'.
sudo apt-get update
sudo apt-get install maven
Make sure to remove maven 2 if your ubuntu is not fresh or if you were using maven 2 before:
sudo apt-get remove maven2
Manual Installation via apt-get by adding maven 3 repository (Ubuntu 14.04 check out update 1):
This can be useful if your ubuntu apt-get repositories list is not up to date.
Maven 3 was required to set up the system and as it turns out most of the documents out there are referring to how to install Maven to Ubuntu version 12.04 or before. Best document I found was:
killertilapia's blog
The whole process I came up with is as follows:
sudo -H gedit /etc/apt/sources.list
Add the following line the sources.list file:
deb http://ppa.launchpad.net/natecarlson/maven3/ubuntu precise main
deb-src http://ppa.launchpad.net/natecarlson/maven3/ubuntu precise main
sudo apt-get update && sudo apt-get install maven3
sudo ln -s /usr/share/maven3/bin/mvn /usr/bin/mvn
Caution 1: command "sudo apt-add-repository ppa:natecarlson/maven3" did not work on my Ubuntu and had to run sudo apt-add-repository -rm ppa:natecarlson/maven3 to get my apt-get to work again.
Caution 2: thanks to David, you need to remove your existing symbolic link to previous versions of maven before running step 4.
OS X Installation
I decided to add OS X installation in case you use multiple environments for your dev: See the source stackoverflow thread for more details.
Install Homebrew that is the equavalent of apt-get, then install Maven using:
brew install maven
Update 1: Installation for Ubunutu 14.04
Haven't tried this myself but I am confident this should work without security warnings:
sudo apt-get purge maven maven2 maven3
sudo apt-add-repository ppa:andrei-pozolotin/maven3
sudo apt-get update
sudo apt-get install maven3
Note: source here, many thanks and +1s to #rendybjunior, #Dominic_Bartl, and #FunThomas424242
Here's an easier way:
sudo apt-get install maven
More details are here.
It's best to use miske's answer.
Properly installing natecarlson's repository
If you really want to use natecarlson's repository, the instructions just below can do any of the following:
set it up from scratch
repair it if apt-get update gives a 404 error after add-apt-repository
repair it if apt-get update gives a NO_PUBKEY error after manually adding it to /etc/apt/sources.list
Open a terminal and run the following:
sudo -i
Enter your password if necessary, then paste the following into the terminal:
export GOOD_RELEASE='precise'
export BAD_RELEASE="`lsb_release -cs`"
cd /etc/apt
sed -i '/natecarlson\/maven3/d' sources.list
cd sources.list.d
rm -f natecarlson-maven3-*.list*
apt-add-repository -y ppa:natecarlson/maven3
mv natecarlson-maven3-${BAD_RELEASE}.list natecarlson-maven3-${GOOD_RELEASE}.list
sed -i "s/${BAD_RELEASE}/${GOOD_RELEASE}/" natecarlson-maven3-${GOOD_RELEASE}.list
apt-get update
exit
echo Done!
Removing natecarlson's repository
If you installed natecarlson's repository (either using add-apt-repository or manually added to /etc/apt/sources.list) and you don't want it anymore, open a terminal and run the following:
sudo -i
Enter your password if necessary, then paste the following into the terminal:
cd /etc/apt
sed -i '/natecarlson\/maven3/d' sources.list
cd sources.list.d
rm -f natecarlson-maven3-*.list*
apt-get update
exit
echo Done!

Categories

Resources