Java Developer Kit executable unable to be found - java

I'm trying to install mysql on my Mac using the command
sudo apt install mysql
and it said I needed to install JDK on it. So I installed JDK but am receiving an error saying:
Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/bin/apt" (-1)
I have updated my env path to
JAVA_HOME=/Library/Java/Home
But when I install JDK theres no java file anywhere in my library, even though when I check to see if I have installed it, it is successfully found. I've installed Homebrew but do not know what package to install after the initial installation, or if this is the problem.
Any help would be appreciated.

If you are using Mac it would be much easier to install Homebrew from https://brew.sh and then use $ brew install mysql
see this link for the apt and yum command usage

Related

Netbeans is not getting installed in my Mac, it says JDK not found, though JDK is installed in the same

Error: Failure while executing the commands mentioned below:-
/usr/bin/sudo -E -- env LOGNAME=ajaygautam USER=ajaygautam USERNAME=ajaygautam /usr/sbin/installer -pkg /usr/local/Caskroom/netbeans/8.2/NetBeans\ 8.2.pkg -target / exited with 1.
Here's the output:
installer: Error - NetBeans IDE cannot be installed. Java (JRE) found on your computer but JDK 8 or newer is required. Please download and install the latest update of JDK 8 from http://www.oracle.com/technetwork/java/javase/downloads/index.html and restart NetBeans installation.
Would someone in tracing out the issue above? I'm not able to install NetBeans 8.2 package in my Mac.
I got the same problem and could to fix it with brew.
firstly install java JDK https://www.oracle.com/java/technologies/javase-downloads.html then run this in your terminal:
brew install netbeans
it will install the latest version of netbeans.
Download OpenJDK from Archived OpenJDK GA Releases.
This will give you a file such as openjdk-9.0.4_osx-x64_bin.tar. Extract the tar file and copy it to the correct place in your machine.
tar -xf openjdk-9.0.4_osx-x64_bin.tar
sudo cp -r jdk-12.0.2.jdk /Library/Java/JavaVirtualMachines/
Now you can run the Netbeans installer.
i just install using brew
brew install netbeans
and now i can use the latest 12.4
The following steps are used to install NetBeans on MacOS:-
1) Download the Latest version
In order to install NetBeans on MacOS, we have to download the latest version of NetBeans by visiting its official website I.e. https://netbeans.org/downloads/
2) Mount the disk image file
The dmg file which is downloaded from the official website of NetBeans is to be mounted to an installer. This can be done with the following command:
$ hdiutil mount Downloads/netbeans-8.2-macosx.dmg
3) Install the file
The file is mounted to the volumes directory which contains a package file (.pkg) which is installable by using the installer command. The command needs superuser privileges for which, sudo is used.
$ sudo installer -pkg Volumes/ NetBeans\ 8.2/NetBeans\ 8.2.pkg -target /
The file will be installed to the target root which is mentioned while installing the file.
4) Unmount the file
After the completion of installation process, we need to unmount the installer. This can be done by using the option Unmount with hdiutil command.
$ hdiutil unmount /Volumes/NetBeans\ 8.2
Well, we have done with the installation process of NetBeans 8.2 on MacOS.
Actually, java_home is in
/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java_home
but in my case, java_home was in the next location i.e
/System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/java_home
I deleted my java_home from /usr/libexec/java_home by root user
added new java_home in /usr/libexec by following command
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/java_home /usr/libexec/.
For some reason, some Netbeans versions for Mac OS do not detect the JDK contained in JRE. For proper installation and running the application, you must have Java for Mac OS installed previously. https://www.java.com/es/download/
Install The Lates Version ONLY which is 12.1 as of now!
https://netbeans.apache.org/download/nb121/nb121.html

How do I install Java JNA in Ubuntu server 14?

I'm trying to install the java native library from the command line as
sudo apt-get install libjna-java
but Ubuntu tells me
E: Unable to locate package libjna-java
and even if I do cache search, there is nothing there matching that package.
How do I install Java JNA in Ubuntu server 14?
libjna-java is in universe repository and it seems that you dont have it enabled.
To enable, run
sudo add-apt-repository universe

Getting ERROR: Cannot start PyCharm No JDK found

I am trying to use PyCharm 4.0.3 (community version) with Red Hat 6.3. I downloaded Linux version from PyCharm website and extracted it on my Linux machine. When I ran PyCharm it initially gave me below error
ERROR: Cannot start PyCharm
No JDK found. Please validate either PYCHARM_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation.
Then I added below two lines in my ~/.cshrc (I am using tcsh)
setenv JAVA_HOME /tools/jre1.6.0
setenv PATH ${PATH}:${JAVA_HOME}/bin
I verified that Java location is correct but now when I run PyCharm it doesn't do anything and I get the control back on command prompt.
For running PyCharm you need to install Oracle Java. Install Oracle Java with the following commands.
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
After successful execution of above commands you can run pycharm.sh file in the bin folder.
I also had the same problem
To solve this problem
First you need to install java jdk 1.8
Below link java sdk 32 bit version
http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-i586.tar.gz
For 64 bit
http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.tar.gz

How to get javax.comm API?

I'd recently downloaded a project on SMS sending, but when I tries to compile the code it gives error on line import javax.comm.*;.
Can anybody tell me where to find javax.comm and where to place so that there will be no compilation error.
Oracle Java Communications API Reference - http://www.oracle.com/technetwork/java/index-jsp-141752.html
Official 3.0 Download (Solarix, Linux) - http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-misc-419423.html
Unofficial 2.0 Download (All): http://www.java2s.com/Code/Jar/c/Downloadcomm20jar.htm
Unofficial 2.0 Download (Windows installer) - http://kishor15389.blogspot.hk/2011/05/how-to-install-java-communications.html
In order to ensure there is no compilation error, place the file on your classpath when compiling (-cp command-line option, or check your IDE documentation).
Use RXTX.
On Debian install librxtx-java by typing:
sudo apt-get install librxtx-java
On Fedora or Enterprise Linux install rxtx by typing:
sudo yum install rxtx
you can find Java Communications API 2.0 in below link
http://www.java2s.com/Code/Jar/c/Downloadcomm20jar.htm
Another Simple way i found in Netbeans right click on your project>libraris click add jar/folder add your comm.jar and you done.
if you dont have comm.jar download it from >>> http://llk.media.mit.edu/projects/picdev/software/javaxcomm.zip
On ubuntu
sudo apt-get install librxtx-java then
add RXTX jars to the project which are in
usr/share/java

jni.h: No such file or directory

I have been following this tutorial, and at step 5, I am getting the following output from GCC:
HelloWorld.c:1:17: error: jni.h: No such file or directory
In file included from HelloWorld.c:3:
HelloWorld.h:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
HelloWorld.c:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
I know that he include directories vary from system to system, so I tried to adapt the command accordingly, but I cannot seem to find the correct directory on my system. I am using Ubuntu 10.04LTS.
Open up a terminal and type:
locate jni.h
That should tell you where every file called jni.h is on your system. I am on ubuntu 11.04, and it's located at:
/usr/lib/jvm/java-6-openjdk/include/jni.h
/usr/lib/jvm/java-6-sun-1.6.0.26/include/jni.h
You may also need to get it from the repos:
sudo apt-get install openjdk-6-jdk
should do the trick if you don't have it installed.
jni.h lives with JDK. For me it is: jdk1.6.0_25/include/.
And by default, I don't think Ubuntu would have JDK with development libraries, so download latest JDK version from Oracle and install it somewhere.
Or you can install openjdk as #Leif suggested if it works on 10.04 LTS. Although, I personally, prefer the one from Sun/Oracle.
In Ubuntu 14.04 run:
sudo apt-get install openjdk-7-jdk openjdk-7-jre-lib
Now, you have a headers into /usr/lib/jvm/java-7-openjdk-amd64/include
For OpenJDK 6:
sudo apt-get install openjdk-6-jdk openjdk-6-jre-lib

Categories

Resources