netbeans installation error: can't initialize ui running in headless mode - netbeans

I'm trying to install NetBeans on Linux Mint, and I'm getting the following error every time I run the installation script:
Configuring the installer...
Searching for JVM on the system...
Extracting installation data...
Running the installer wizard...
Can`t initialize UI
Running in headless mode
What should I do to get it working?

In case anyone has this problem in the future, Netbeans doesn't like OpenJDK 6 but -- fortunately -- it works fine with OpenJDK 7 (as expected as for Java 7 OpenJDK is the reference implementation). Just make sure you remove any Java 6 packages before installation attempts. On Ubuntu and Mint one can do:
sudo apt-get purge ^openjdk-6-*
sudo apt-get install openjdk-7-jdk
It should work afterwards.

Looks like Netbeans does not work properly with Openjdk. This is what I did (in Linux Mint 12):
sudo apt-get remove openjdk*
sudo apt-get install sun-java6-jdk
Then you will be able to run the .sh installer as usual.

I hit this same issue on Kubuntu 12.04 LTS but needed Sun JDK 6 for a project I'm maintaining. I stumbled upon Martin Wimpress' OAB-Java script (by way of help.ubuntu.com) which creates and installs a local apt repository for Sun JDK 6. You can find the latest instructions on Martin's github site which run as follows:
cd ~/
wget https://github.com/flexiondotorg/oab-java6/raw/0.2.7/oab-java.sh \
-O oab-java.sh
chmod +x oab-java.sh
sudo ./oab-java.sh
If you want to see what this script is doing while it is running then execute the following from another shell:
tail -f ./oab-java.sh.log
Alternatively, you can clone the OAB-Java repo and kick of the script from within it:
git clone git://github.com/flexiondotorg/oab-java6.git
cd oab-java6
sudo ./oab-java.sh
Either way, once that is in place follow Jose's instructions to remove openjdk and install sun jdk:
sudo apt-get remove openjdk*
sudo apt-get install sun-java6-jdk
One final note, the script accepts a -7 argument which will create and install a local apt repository for Oracle JDK 7 should you want to go that route.

I was able to get it to work by getting into the target system using ssh -X, then making sure DISPLAY was exported. That handles the X server issues.

Change the priority of the Oracle Java executables:
export PATH=/usr/java/latest/bin:$PATH
Run the installer:
./netbeans-8.1-linux.sh

What worked for me was installing default java environment from the terminal:
sudo apt-get install default-jre

The installation was a success - under "user".
The installation failed - under "su" (under Red Hat equivalent of "sudo"). With
Can`t initialize UI
Running in headless mode
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
For me.

Related

Error while running 'make install' command to install Apache AGE

After successfully installing postgresql from source code, I got an error while installing Apache AGE. I have attached a screenshot of the error below. It would be great if someone can help out.Terminal view of command and error
I am searching online to find a solution but haven't been able to found yet.
From the image, it looks like you are using postgres 12.13.
For postgres 12, you should checkout to age for pg12 branch by doing git checkout release/PG12/1.1.1 and then make install.
I was also getting errors in a configuration which were resolved by using this command first.
sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison
Try this and this will solve your problem too
In addition to installing the essential libraries before the actual installation using:
sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison (Note: The above command is for Ubuntu only. If you are not on Ubuntu, See here)
It is also recommended to install the postgreSQL development files using:
sudo apt install postgresql-server-dev-xx
This is not the exact command to be typed in the terminal. Check out the link
here to see the exact compatible command to execute according to the version of Linux you are currently using.

E: Package 'oracle-java8-installer' has no installation candidate

I tried to install java8 using the following commands:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
I'm getting an error as follows :
Package oracle-java8-installer 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
E: Package 'oracle-java8-installer' has no installation candidate
when I searched the error, I found out that "WebUpd8" team has officially discontinued there support.
Please help to install oracle java 8. I'm using ubuntu 16.04.
I just went through the same process and I fixed the problem by manually installing java 8 on my ubuntu 18.04 machine. Hopefully my answer will help you.
Download the latest JAVA 8 SE development kit from here: https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html
Open your terminal.
Type $mkdir /opt/jdk.
Untar Java in your new folder $tar -zxf jdk-8u5-linux-x64.tar.gz -C /opt/jdk.
Set oracle JDK as the default JVM by running those two instructions (or something around that depending on your configuration):
Note: Each bullet point is one single command
update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_<YourVersion>/bin/java 100
update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_<YourVersion>/bin/javac 100
You can check the result by running java -version !
Before I started, I went through those steps as well in order to remove completely java from my system: https://askubuntu.com/questions/84483/how-to-completely-uninstall-java#185250
The source I used for the manual installation of JAVA was this article: https://www.digitalocean.com/community/tutorials/how-to-manually-install-oracle-java-on-a-debian-or-ubuntu-vps
Add the following line to /etc/apt/sources.list:
deb https://debian.opennms.org/ stable main
Install GPG key of the repository:
wget -O - http://debian.opennms.org/OPENNMS-GPG-KEY | sudo apt-key add -
Update the package index:
sudo apt-get update
Install oracle-java8-installer deb package:
sudo apt-get install oracle-java8-installer
Source
I was facing the same issue and resolved with this:\
sudo apt install openjdk-8-jdk
Please read the details when we execute the below command:
sudo add-apt-repository ppa:webupd8team/java
The Oracle JDK License has changed for releases starting April 16,
2019.
The new Oracle Technology Network License Agreement for Oracle Java SE
is substantially different from prior Oracle JDK licenses. The new
license permits certain uses, such as personal use and development
use, at no cost -- but other uses authorized under prior Oracle JDK
licenses may no longer be available. Please review the terms carefully
before downloading and using this product. An FAQ is available here:
https://www.oracle.com/technetwork/java/javase/overview/oracle-jdk-faqs.html
Oracle Java downloads now require logging in to an Oracle account to
download Java updates, like the latest Oracle Java 8u211 / Java SE
8u212. Because of this I cannot update the PPA with the latest Java
(and the old links were broken by Oracle).
For this reason, THIS PPA IS DISCONTINUED (unless I find some way around this limitation).
This PPA works (Ubuntu 16.04)
sudo add-apt-repository ppa:ts.sch.gr/ppa
sudo apt-get update
sudo apt-get install oracle-java8-installer

How to start IDLE that comes with Python 3.6

I am using Linux Mint 18. I installed Python 3.5 and 3.6 using apt-get in the terminal. I can open IDLE of Python 2.7 and 3.5 using commands idle and idle3 respectively. How can I access IDLE that comes with Python 3.6?
Try the command idle3.6. python3 and idle3 are still associated with your system Python, which is 3.5.
Simply typing in idle3.6 should work just like carusot42 mentioned. If it doesn't work, perhaps you might want to see if everything else is installed correctly. Here are the steps I followed which worked perfectly fine for me. I am also running Linux Mint 18. The steps that I followed were:
Installed the prerequisites of Python. Do that by typing in the following commands -
sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
Download Python using the following command and extract it (use your desired location) -
cd /usr/src
wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
sudo tar xzf Python-3.6.0.tgz
The next step is to compile Python source. To do that type in the commands below-
cd Python-3.6.1
./configure
sudo make altinstall
make altinstall is used to prevent replacing the default Python binary
file /usr/bin/python
You should be good to go. You check your Python version by typing python3.6 -V in the terminal.
Once you do that, type in idle3.6 and then Python 3.6.1 shell should open for you.
The Software Manager in Linux Mint lists the Python Packages and IDLE Packages
separately. After you install Python, go look up the associated IDLE package in the Software Manager and install it. Reboot and it should work fine. It worked for me.

How to install Oracle JDK 7 and Netbeans IDE in Linaro 13.01 ubuntu tty1?

I have a Processor A13(cpu: cortex-A8 ARM v7) of allwinner and my OS is Linaro 13.01 Ubuntu tty1.
So how do I install Oracle JDK7 and Netbeans IDE on that?
If you're using Ubuntu, there are several ways to install NetBeans. One way is to use Ubuntu's "Software Centre" which you can use just to search to NetBeans and it should install it including all dependencies.
You can also use your web browser in Ubuntu and head to www.netbeans.org and click "Download" at the top right, there you can choose your operating system and download the correct version of NetBeans.
Once downloaded you can run the NetBeans installer through terminal using: sh ./<NetBeans file name here>. And the installer will start.
To install Open JDK:
However, you may need to download and install the JDK first; which you can also do in terminal by typing: sudo apt-get install openjdk-7-jdk.
To install Oracle JDK:
This is taken from this link: http://www.wikihow.com/Install-Oracle-Java-JDK-on-Ubuntu-Linux
Remove open JDK from your system: sudo apt-get purge openjdk-\*
Create a new directory for the oracle JDK: sudo mkdir -p /usr/local/java
Download the Oracle Java JDK for linux by clicking here
Copy the Oracle Java binaries to the /usr/local/java directory: cd /home/userName/Downloads, sudo -s cp -r jfk-7u13-linux-x64.tar.gz /usr/local/java, cd /usr/local/java.
Extract the file: sudo -s tar xvzf jdk-7u13-linux-x64.tar.gz
Edit the system path file: sudo nano /etc/profile
Scroll to the bottom of the file and add this:
JAVA_HOME=/usr/local/java/jdk1.7.0_13
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export PATH
Save the file and exit (Ctrl+X), then enter "y" for nano.
Let Ubuntu know where the Oracle Java JDK is:
LOCN="/usr/local/jdk7"
sudo update-alternatives --install "/usr/bin/java" "java" "${LOCN}/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "${LOCN}/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "${LOCN}/bin/javaws" 1
Make sure Ubuntu knows to use this as the default JDK:
sudo update-alternatives --set java ${LOCN}/bin/java
sudo update-alternatives --set javac ${LOCN}/bin/javac
sudo update-alternatives --set javaws ${LOCN}/bin/javaws
Reload system path: /etc/profile, or just restart.
If you have trouble following my instructions then take a look at the link I posted above.
I would recommend using Open JDK instead though, as you can see; it's much easier to install.
I hope this helps.
Install Oracle JDK for ARM processor and Hard Float OS Image is here.
Oracle JDK for ARM Processor
And download Netbeans IDE 7.0.1 for Linux and install it.
Not to spoil your fun, but the A13 is a very weak SOC for this task.
I wouldn't even try anything below dual Cortex A15 with 2GB RAM (The Samsung XE303).
Oracle now releases the standard JDK8 for ARM Linux hardfloat so it is possible to install it on Debian/Ubuntu fairly easily:
Get JDK8 from Oracle's webpage (currently early access)
Extract th tar.gz-d JDK8 ARM/LInux/hfloat into /usr/lib/jvm/jdk1.8.0
Use update-alternatives (first answer)
Run "java -version" to check the results
..voila
I learned from Digital Ocean Docs how to manually install Oracle JDK on a headless ubuntu.
With a bit of Googling, I found following script to be useful.
wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz

What does "The APR based Apache Tomcat Native library was not found" mean?

I am using Tomcat 7 in Eclipse on Windows. When starting Tomcat, I am getting the following info message:
The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path
What does this mean and how can I provide the APR library?
It means exactly what it says: "The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path"
The library referred to is bundled into an OS specific dll (tcnative-1.dll) loaded via JNI. It allows tomcat to use OS functionalities not provided in the Java Runtime (such as sendfile, epoll, OpenSSL, system status, etc.). Tomcat will run just fine without it, but for some use cases, it will be faster with the native libraries.
If you really want it, download the tcnative-1.dll (or libtcnative.so for Linux) and put it in the bin folder, and add a system property to the launch configuration of the tomcat server in eclipse.
-Djava.library.path=c:\dev\tomcat\bin
Unless you're running a production server, don't worry about this message. This is a library which is used to improve performance (on production systems). From Apache Portable Runtime (APR) based Native library for Tomcat:
Tomcat can use the Apache Portable Runtime to provide superior
scalability, performance, and better integration with native server
technologies. The Apache Portable Runtime is a highly portable library
that is at the heart of Apache HTTP Server 2.x. APR has many uses,
including access to advanced IO functionality (such as sendfile, epoll
and OpenSSL), OS level functionality (random number generation, system
status, etc), and native process handling (shared memory, NT pipes and
Unix sockets).
On RHEL Linux just issue:
yum install tomcat-native.x86_64
/Note:depending on Your architecture 64bit or 32bit package may have different extension/
That is all. After that You will find in the log file next informational message:
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
All operations will be noticeably faster than before.
Installation the native library on Ubuntu server with:
sudo apt-get install libtcnative-1
If that does not work tomcat-native needs to be installed
Install Oracle java7:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
sudo apt-get install oracle-java7-set-default
Install tomcat apr:
wget http://apache.mirror.anlx.net//apr/apr-1.5.0.tar.gz
tar zxvf apr-1.5.0.tar.gz
rm apr-1.5.0.tar.gz
cd apr-1.5.0
sudo ./configure
sudo make
sudo make install
export LD_LIBRARY_PATH='$LD_LIBRARY_PATH:/usr/local/apr/lib'
Install tomcat tomcat-native:
wget http://mirrors.ukfast.co.uk/sites/ftp.apache.org//tomcat/tomcat-connectors/native/1.1.29/source/tomcat-native-1.1.29-src.tar.gz
tar zxvf tomcat-native-1.1.29-src.tar.gz
rm tomcat-native-1.1.29-src.tar.gz
cd tomcat-native-1.1.29-src/jni/native
JAVA_HOME=/usr/lib/jvm/java-7-oracle
sudo ./configure --with-apr=/usr/local/apr --with-java-home=$JAVA_HOME
sudo make
sudo make install
I just went through this and configured it with the following:
Ubuntu 16.04
Tomcat 8.5.9
Apache2.4.25
APR 1.5.2
Tomcat-native 1.2.10
Java 8
These are the steps i used based on the older posts here:
Install package
sudo apt-get update
sudo apt-get install libtcnative-1
Verify these packages are installed
sudo apt-get install make
sudo apt-get install gcc
sudo apt-get install openssl
Install package
sudo apt-get install libssl-dev
Install and compile Apache APR
cd /opt/tomcat/bin
sudo wget http://apache.mirror.anlx.net//apr/apr-1.5.2.tar.gz
sudo tar -xzvf apr-1.5.2.tar.gz
cd apr-1.5.2
sudo ./configure
sudo make
sudo make install
verify installation
cd /usr/local/apr/lib/
ls
you should see the compiled file as
libapr-1.la
Download and install Tomcat Native source package
cd /opt/tomcat/bin
sudo wget https://archive.apache.org/dist/tomcat/tomcat-connectors/native/1.2.10/source/tomcat-native-1.2.10-src.tar.gz
sudo tar -xzvf tomcat-native-1.2.10-src.tar.gz
cd tomcat-native-1.2.10-src/native
verify JAVA_HOME
sudo pico ~/.bashrc
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
source ~/.bashrc
sudo ./configure --with-apr=/usr/local/apr --with-java-home=$JAVA_HOME
sudo make
sudo make install
Edit the /opt/tomcat/bin/setenv.sh file with following line:
sudo pico /opt/tomcat/bin/setenv.sh
export LD_LIBRARY_PATH='$LD_LIBRARY_PATH:/usr/local/apr/lib'
restart tomcat
sudo service tomcat restart
On Mac OS X:
$ brew install tomcat-native
==> tomcat-native
In order for tomcat's APR lifecycle listener to find this library, you'll
need to add it to java.library.path. This can be done by adding this line
to $CATALINA_HOME/bin/setenv.sh
CATALINA_OPTS="$CATALINA_OPTS -Djava.library.path=/usr/local/opt/tomcat-native/lib"
If $CATALINA_HOME/bin/setenv.sh doesn't exist, create it and make it executable.
Then add it to the eclipse's tomcat arguments (double-click Server > Open Launch Configuration > Arguments tab > VM arguments)
-Djava.library.path=/usr/local/opt/tomcat-native/lib
on debian 8 I fix it with installing libapr1-dev:
apt-get install libtcnative-1 libapr1-dev
Had this problem as well. If you do have the libraries, but still have this error, it may be a configuration error. Your server.xml may be missing the following line:
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
(Alternatively, it may be commented out). This <Listener>, like other listeners is a child of the top-level <Server>.
Without the <Listener> line, there's no attempt to load the APR library, so LD_LIBRARY_PATH and -Djava.library.path= settings are ignored.
I had this issue upgrading from Java 8 to 11. After adding this dependency, my app launched without issue:
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.25.0-GA</version>
</dependency>
I had the same problem when tomсat could not find the class. Try to view other log files. Sometimes No class def found error appears in different log files:
tomcat8-stdout
tomcat8-stderr
localhost
If you don't have Tomcat Native library install it with:
sudo apt-get install libtcnative-1
and if it's still there an old version upgrade it with:
sudo apt-get upgrade libtcnative-1
My problem was in add some library from tomcat to eclipse class path i just going to
eclipse click right to project and going to debug configuration -> classpath -> Add External JARs add all jars files from apache-tomcat-7.0.35\bin this was my problem and it's worked for me .
For future readers:
I had faced this issue myself when trying to run a Spring Boot application in Spring STS. This issue didn't resurface initially. I was able to work on my project without any issues for quite some time until one fine day I started getting this particular error.
From what I am able to recall I had not made any configuration changes to my project and neither changed the Java/Tomcat version being used.
None of the discussions/suggestions regarding installing the tomcat native library made any sense to me since the project was already working fine before.
SOLUTION that worked for me:
So lastly I though of trying to delete and reimport my project.
I deleted my project from Spring STS, restarted the Spring STS and then reimported the project. It worked like a charm and never faced the issue ever since.
You may also try deleting any IDE generated files/folders(if there are any) in your project, before restarting the IDE and reimporting the project.
I still happen to work on this project from time to time and haven't faced the issue as of now. My current development IDE is IntelliJ.
I'm not sure if the error was IDE specific.