LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Installing latest version of Netbeans IDE? (https://www.linuxquestions.org/questions/linux-software-2/installing-latest-version-of-netbeans-ide-932828/)

lugoteehalt 03-05-2012 09:33 AM

Installing latest version of Netbeans IDE?
 
Trying to install the latest netbeans from Oracle, which is usually easy, and do 'bash netbeans-7.1.1-ml-linux.sh'. The installer starts but says that 'no compatible JDK was found'. Eventually the installation does not work.

So I install the JDK from the Oracle web site, download the tarball and unpack it in my home directory. Then try to install netbeans in my home directory. Same thing happens, 'no compatible JDK was found'. I enter the path to the JDK manually, when invited to do so, but it say: 'an unknown error occured while validating the path'.

Anyone know how to fix this?

Thanks any help.

bigrigdriver 03-05-2012 10:56 AM

My suggestion is to read through the installer script. Look for path variables that you can edit. That may do the trick.

jefro 03-05-2012 03:35 PM

Since you say bash, are you in some other shell at that time?

jsbjsb001 01-12-2022 05:30 AM

While I realize this thread is over 8 years old; I had exactly the same issue myself and managed to solve it (as Java is one of the programming subjects for the programming course I'm currently doing and NetBeans is the IDE they use, and I wanted to install it on my Linux machine), and since I found this thread and it deserves an actual answer...

The problem is that the NetBeans IDE seems to be tied to the same version as Java JRE (Java Runtime Environment) & JDK (Java Development Kit) itself. In other words, and for example, if you have downloaded NetBeans IDE 12.6, then you need Java JRE & JDK version 12 installed, or the NetBeans installer will not let you install the NetBeans IDE. In my case, once I realized this and installed the right version of Java JRE & JDK, the NetBeans installer finally automatically found Java and stopped complaining, and the NetBeans IDE installed with no problems! (and the NetBeans IDE itself seems to run with no issues so far either!)

I also got another error that was also easy to fix - once I figured out which Java package contained the library mentioned below:

Code:

An error occured while initializing the NetBeans IDE installer UI.
Most probably the running JVM is not compatible with the current platform.
See FAQ at http://wiki.netbeans.org/FaqUnableToPrepareBundledJdk for more information.
Can't load library: /usr/lib/jvm/java-15-openjdk/lib/libawt_xawt.so

Exception:
  java.lang.UnsatisfiedLinkError:
  Can't load library: /usr/lib/jvm/java-15-openjdk/lib/libawt_xawt.so

So first of all, check your package manager to make sure the version of the Java JRE & JDK you have installed *matches* the version (the *major version* that is) of the NetBeans IDE you have downloaded (the .sh file) and wish to install (see my comment above). Then, make sure you also have the development package for openjdk installed, and if need be, whatever openjdk package that contains libawt_xawt.so also installed (PS. the wiki link referenced above is dead).

On my system that would be the following packages:

* java-<version>-openjdk-devel (the JDK development package)
* java-<version>-openjdk-gui (for the libawt_xawt.so library)

Replace <version> with the actual version of Java that is required (that matches the version of NetBeans you've downloaded and want to install). Also, if you use a Debian-based distribution, you'll likely need to replace "devel" with "dev", as Debian/deb based distros tend to use a different naming convention for packages compared to rpm based distros. The exact names of said packages themselves may also slight differ depending on your particular distro as well.

While the following may or may not be required depending on your situation, you may need to also make sure your JAVA_HOME environment variable is pointing to the right directory for your Java JRE & JDK install. You probably won't have to worry about this if you didn't have Java already installed beforehand, since the installation of the Java JRE should take care of this for you in that case. But if on the other hand you did already have a different version of the Java JRE & JDK installed already, then you may need to make sure the JAVA_HOME environment variable is pointing to the right Java install.

To check you can type the following as root (to check it for all users);

Code:

env | grep JAVA
If it's been set, you should get something like the following returned:

Code:

JAVA_HOME=/usr/lib/jvm/java-12-openjdk
The particular version may well be different, and you'll have to check that against the actual version of Java you have installed.

You can set it manually if need be like the following;

Code:

export JAVA_HOME=/usr/lib/jvm/java-<version>-openjdk
Change <version> to the actual version you have installed, but be aware this will *not* set it permanently though and therefore it will disappear as soon as you shutdown or restart your system.

You'd have to either edit the appropriate config file in the /etc directory to make it system-wide (apply to all users), or export it in the appropriate config file for your shell to make it permanent. The link below explains how exactly to do this - it should apply to almost any distro (if not any distro), not just to Ubuntu:

https://keepgrowing.in/java/how-to-p...ome-on-ubuntu/

computersavvy 01-12-2022 08:05 PM

Thank you for the detailed explanation. Many of us are aware that versions of dependent packages should match for compatibility reasons, but some may not understand that and your explanation makes it clear.

JSB 01-15-2022 04:50 AM

Quote:

Originally Posted by jsbjsb001 (Post 6317423)
While I realize this thread is over 8 years old; I had exactly the same issue myself and managed to solve it (as Java is one of the programming subjects for the programming course I'm currently doing and NetBeans is the IDE they use, and I wanted to install it on my Linux machine), and since I found this thread and it deserves an actual answer...

The problem is that the NetBeans IDE seems to be tied to the same version as Java JRE (Java Runtime Environment) & JDK (Java Development Kit) itself. In other words, and for example, if you have downloaded NetBeans IDE 12.6, then you need Java JRE & JDK version 12 installed, or the NetBeans installer will not let you install the NetBeans IDE. In my case, once I realized this and installed the right version of Java JRE & JDK, the NetBeans installer finally automatically found Java and stopped complaining, and the NetBeans IDE installed with no problems! (and the NetBeans IDE itself seems to run with no issues so far either!)

I also got another error that was also easy to fix - once I figured out which Java package contained the library mentioned below:

Code:

An error occured while initializing the NetBeans IDE installer UI.
Most probably the running JVM is not compatible with the current platform.
See FAQ at http://wiki.netbeans.org/FaqUnableToPrepareBundledJdk for more information.
Can't load library: /usr/lib/jvm/java-15-openjdk/lib/libawt_xawt.so

Exception:
  java.lang.UnsatisfiedLinkError:
  Can't load library: /usr/lib/jvm/java-15-openjdk/lib/libawt_xawt.so

So first of all, check your package manager to make sure the version of the Java JRE & JDK you have installed *matches* the version (the *major version* that is) of the NetBeans IDE you have downloaded (the .sh file) and wish to install (see my comment above). Then, make sure you also have the development package for openjdk installed, and if need be, whatever openjdk package that contains libawt_xawt.so also installed (PS. the wiki link referenced above is dead).

On my system that would be the following packages:

* java-<version>-openjdk-devel (the JDK development package)
* java-<version>-openjdk-gui (for the libawt_xawt.so library)

Replace <version> with the actual version of Java that is required (that matches the version of NetBeans you've downloaded and want to install). Also, if you use a Debian-based distribution, you'll likely need to replace "devel" with "dev", as Debian/deb based distros tend to use a different naming convention for packages compared to rpm based distros. The exact names of said packages themselves may also slight differ depending on your particular distro as well.

While the following may or may not be required depending on your situation, you may need to also make sure your JAVA_HOME environment variable is pointing to the right directory for your Java JRE & JDK install. You probably won't have to worry about this if you didn't have Java already installed beforehand, since the installation of the Java JRE should take care of this for you in that case. But if on the other hand you did already have a different version of the Java JRE & JDK installed already, then you may need to make sure the JAVA_HOME environment variable is pointing to the right Java install.

To check you can type the following as root (to check it for all users);

Code:

env | grep JAVA
If it's been set, you should get something like the following returned:

Code:

JAVA_HOME=/usr/lib/jvm/java-12-openjdk
The particular version may well be different, and you'll have to check that against the actual version of Java you have installed.

You can set it manually if need be like the following;

Code:

export JAVA_HOME=/usr/lib/jvm/java-<version>-openjdk
Change <version> to the actual version you have installed, but be aware this will *not* set it permanently though and therefore it will disappear as soon as you shutdown or restart your system.

You'd have to either edit the appropriate config file in the /etc directory to make it system-wide (apply to all users), or export it in the appropriate config file for your shell to make it permanent. The link below explains how exactly to do this - it should apply to almost any distro (if not any distro), not just to Ubuntu:

https://keepgrowing.in/java/how-to-p...ome-on-ubuntu/

Thank you my friend! I want use netbeans ide I will try your instruction.


All times are GMT -5. The time now is 02:36 PM.