Working on installing the Java "Play" framework (2.2.5) on Debian... seem to have everything installed properly but the file won't run even after modding it with +x:
myuser#Home:~/play-2.2.5$ ls -la
total 44
drwxrwxr-x 5 root root 4096 Oct 6 20:57 .
drwxr-xr-x 31 myuser myuser 4096 Oct 21 13:24 ..
-rw-rw-r-- 1 root root 8700 Oct 6 20:57 CONTRIBUTING.md
drwxrwxr-x 9 root root 4096 Oct 6 20:57 framework
-rwxrwxr-x 1 root root 1795 Oct 6 20:57 play
-rw-rw-r-- 1 root root 1453 Oct 6 20:57 play.bat
-rw-rw-r-- 1 root root 1872 Oct 6 20:57 README.md
drwxrwxr-x 3 root root 4096 Oct 6 20:57 repository
drwxrwxr-x 4 root root 4096 Oct 6 20:57 samples
myuser#Home:~/play-2.2.5$ play
bash: play: command not found
Java is installed..
myuser#Home:~/play-2.2.5$ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
How should I troubleshoot from here?
By default, the path in Linux does not include the current directory. If you want to run an executable not in the path, you need to specify the full path to the file. For the current directory, specifying the directory . will do the job.
myuser#Home:~/play-2.2.5$ ./play
^^
Related
App throwing error at startup looking specifically for java-1.8.0-openjdk-amd64. Environment is Ubuntu1604. Java java-8-openjdk-i386 is already installed , but need the amd64 and then use it as an alternate. Where can I source amd64 tar file ? Have ran "sudo apt-get install openjdk-8-jdk". thx
2/6/21 current status - have not being able to install Java 8 AMD64.
Hi there, I tried :
sudo tar xvf jdk-8u291-linux-x64.tar.gz --directory /usr/lib/jvm/
and this installed to /usr/lib/jvm/jdk1.8.0_291.
However I was expecting /usr/lib/jvm/java-1.8.0-openjdk-amd64 folder structure.
Whats currently installed is:
ubuadmin#ubu1604OAEdd:/usr/lib/jvm$ ls -lrta
total 24
lrwxrwxrwx 1 root root 23 Feb 25 2016 default-java -> java-1.8.0-openjdk-i386
drwxr-xr-x 8 10143 10143 4096 Apr 7 20:26 jdk1.8.0_291
-rw-r--r-- 1 root root 2716 Apr 21 17:10 .java-1.8.0-openjdk-i386.jinfo
lrwxrwxrwx 1 root root 19 Apr 21 17:10 java-1.8.0-openjdk-i386 -> java-8-openjdk-i386
drwxr-xr-x 8 root root 4096 Jun 1 23:17 java-8-openjdk-i386
drwxr-xr-x 2 root root 4096 Jun 1 23:17 openjdk-8
drwxr-xr-x 69 root root 4096 Jun 1 23:43 ..
drwxr-xr-x 5 root root 4096 Jun 2 09:26 .
ubuadmin#ubu1604OAEdd:/usr/lib/jvm$ java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~16.04.1-b10)
OpenJDK Server VM (build 25.292-b10, mixed mode)
ubuadmin#ubu1604OAEdd:/usr/lib/jvm$
ubuadmin#ubu1604OAEdd:/usr/lib/jvm$ sudo update-alternatives --config java
There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-8-openjdk-i386/jre/bin/java
Nothing to configure.
ubuadmin#ubu1604OAEdd:/usr/lib/jvm$
How can I complete the install. The app I'm trying to use is looking for :
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/bin/java
Answering your question as-is - you can find links to all jdk implementations on jdk.dev . But you'll have to extract jdk and add bin directory to PATH by yourself
As for updating alternatives it's a question for askubuntu.com, but I believe, that you should do install before updating.
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_291/bin/java" 1
I just read here, that the Java DB (respectively Derby) is shipped with the JDK.
Where is the derby.jar within the Java installation on my Mac?
The terminal command
/usr/libexec/java_home
prints
/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home
and
ls -halt /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home
drwxr-xr-x 10 root wheel 320B 6 Okt 14:29 .
drwxr-xr-x 5 root wheel 160B 6 Okt 14:29 ..
-r--r--r-- 1 root wheel 160B 6 Okt 14:29 README.html
drwxr-xr-x 34 root wheel 1,1K 6 Okt 14:29 bin
drwxr-xr-x 7 root wheel 224B 6 Okt 14:29 conf
drwxr-xr-x 9 root wheel 288B 6 Okt 14:29 include
drwxr-xr-x 72 root wheel 2,3K 6 Okt 14:29 jmods
drwxr-xr-x 72 root wheel 2,3K 6 Okt 14:29 legal
drwxr-xr-x 57 root wheel 1,8K 6 Okt 14:29 lib
-rw-r--r-- 1 root wheel 1,2K 6 Okt 14:29 release
The only jar file within the Home folder I can find is the following:
find . -name '*.jar'
./lib/jrt-fs.jar
Thank you for your help!
P.S.:
java -version
prints
java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)
As of JDK 9, Derby is no longer included in the JDK. From the migration guide:
JavaDB, which was a rebranding of Apache Derby, isn’t included in JDK 9.
JavaDB was bundled with JDK 7 and JDK 8. It was found in the db directory of the JDK installation directory.
You can download and install Apache Derby from Apache Derby Downloads.
Pulling my hair out about this one. java -version and javac -version both report the same 1.7.0_45, but when I try to compile the simplest class I get a class file error:
> cat A.java
public class A {}
> javac A.java
A.java:1: cannot access java.lang.Object
bad class file: /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/rt.jar(java/lang/Object.class)
class file has wrong version 51.0, should be 49.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
public class A {}
^
1 error
There certainly is no JDK 1.5 installed. I don't think there even is a 1.5 JDK that runs on OSX any more.
FWIW, here's the frameworks directory containing the "versions" and stub executables:
> ls -al /System/Library/Frameworks/JavaVM.framework/Versions/
total 64
drwxr-xr-x 11 root wheel 374 28 Mar 09:03 .
drwxr-xr-x 12 root wheel 408 11 Mar 07:52 ..
lrwxr-xr-x 1 root wheel 10 29 Oct 12:54 1.4 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 29 Oct 12:54 1.4.2 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 29 Oct 12:54 1.5 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 29 Oct 12:54 1.5.0 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 29 Oct 12:54 1.6 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 29 Oct 12:54 1.6.0 -> CurrentJDK
drwxr-xr-x 8 root wheel 272 28 Mar 09:03 A
lrwxr-xr-x 1 root wheel 1 29 Oct 12:54 Current -> A
lrwxr-xr-x 1 root wheel 1 28 Mar 09:03 CurrentJDK -> A
I've checked the usual suspects, there's no JAVA_HOME or CLASSPATH environment variables, not that it matters when there's no 1.5 installed. I also get the exact same behaviour if I install JDK 8.
Does anybody have an idea what's causing this?
OK, thanks to this post (Java compilation error: Mac) I found the solution:
rm -rf ~/Library/Java/Extensions
sudo rm -rf /Library/Java/Extensions
Where does Oracle (Sun) install their JDK/JRE on Mac OS X 10.8 Mountain Lion?
/Library/Java/JavaVirtualMachines/ according to the Mac JDK Uninstall Docs.
The Oracle Java SE downloads at: http://www.oracle.com/technetwork/java/javase/overview/index.html
install here on Maverick at least:
/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/
this JRE is entirely separate from the ones that Apple has installed, which are under /System/Library/Frameworks/JavaVM.framework/Versions/ as another answer mentioned.
If you setting the JRE path in something like Eclipse you'll need to point to the /home directory i.e
/Library/Java/JavaVirtualMachines/<Replace with version>/Contents/Home
Some of the other answers might be correct but this is what worked for me (which is different and up to date as of January 2016) when installing it on a new computer at the office.
The path as mentioned in another answer is
/Library/Java/JavaVirtualMachines/<Replace with version>/Contents/Home
Here however is a visual guide to getting there, because you can find many directories named "Library". Make sure you are here
then click into JavaVirtualMachines
If you are doing a new setup and just downloaded Android studio, they might have sent you to "Download Java for OS X 2015-001" at https://support.apple.com/kb/dl1572?locale=en_US That gives you version 1.6.0
That won't work!!!!
I got the error that I needed JDK 7.0 or newer.
I looked for a newer version and found this link from Oracle
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
I installed it, then selected that one. And it worked
On my system, evaluating which java leads me to /usr/bin/java. This in turn is a symlink to:
/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
In case it's relevant, java -version tells me I have 1.6.0_37 installed.
The JDK/JRE as mentioned in previous answers is located in /Library/Java/JavaVirtualMachines/<version>/Contents/Home/. The JRE is dir under this Home.
Interestingly browsers doesn't use files from this location for java applet plugin. The location used by browsers is /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/.
In fact if you run JRE installer, it updates the files in this location rather than JDK/JRE location.
Enough answers here, but I'm JUST adding a way to find it by yourself
$ sudo find / -name Java
/Library/Application Support/Oracle/Java
/Library/Java
/private/var/root/Library/Application Support/Oracle/Java
/System/Library/Java
/Users/prayagupd/Library/Application Support/Oracle/Java
To be more specific,
$ sudo find / -name jdk*
/Applications/Android Studio.app/Contents/jre/jdk
/Applications/Android Studio.app/Contents/lib/jdkAnnotations.jar
/Applications/IntelliJ IDEA.app/Contents/jre/jdk
/Applications/IntelliJ IDEA.app/Contents/lib/jdkAnnotations.jar
/Library/Java/JavaVirtualMachines/jdk1.7.0_76.jdk
You see /Library/Java/JavaVirtualMachines/ is the place you need to look inside.
And /Library/Java/JavaVirtualMachines/jdk<version>.jdk/Contents/Home/ is your JAVA_HOME
$ ls -ls /Library/Java/JavaVirtualMachines/jdk1.7.0_76.jdk/Contents/Home/
total 39776
8 -rw-rw-r-- 1 root wheel 3339 Dec 18 2014 COPYRIGHT
8 -rw-rw-r-- 1 root wheel 40 Dec 18 2014 LICENSE
8 -rw-rw-r-- 1 root wheel 114 Dec 18 2014 README.html
216 -rw-rw-r-- 1 root wheel 110114 Dec 17 2014 THIRDPARTYLICENSEREADME-JAVAFX.txt
344 -rw-rw-r-- 1 root wheel 173559 Dec 18 2014 THIRDPARTYLICENSEREADME.txt
0 drwxrwxr-x 44 root wheel 1496 Feb 28 20:13 bin
0 drwxrwxr-x 9 root wheel 306 Feb 28 20:13 db
0 drwxrwxr-x 9 root wheel 306 Feb 28 20:13 include
0 drwxrwxr-x 10 root wheel 340 Feb 28 20:13 jre
0 drwxrwxr-x 14 root wheel 476 Feb 28 20:13 lib
0 drwxrwxr-x 5 root wheel 170 Dec 18 2014 man
8 -rw-rw-r-- 1 root wheel 502 Dec 18 2014 release
39184 -rw-rw-r-- 1 root wheel 20061067 Dec 18 2014 src.zip
The version 8 release from Oracle (1.8.0_40-b25) can be found at:
/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/bin/java
FYI: Oracle is not following the practice of making /Library/Java/Current (etc) a link to the latest installed java.
Below is my method of keeping up with versions over time: from my .zshrc file:
108 JAVA_6_HOME=/System/Library/Frameworks/JavaVM.framework/Home
109 JAVA_7_HOME=/Library/Java/Current
110 JAVA_8_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
111
112 export JAVA_6_HOME
113 export JAVA_7_HOME
114 export JAVA_8_HOME
115
116 export JAVA_HOME=$JAVA_8_HOME
117
118 PATH=$PATH:$JAVA_HOME/bin
119
I need Java5 (not 6), but Snow Leopard comes with only Java6.
There is /System/Library/Frameworks/JavaVM.framework/Versions/1.5, but that just points to 1.6.0:
$ ls -la /System/Library/Frameworks/JavaVM.framework/Versions/
lrwxr-xr-x 1 root wheel 5 Sep 24 20:12 1.3 -> 1.3.1
drwxr-xr-x 3 root wheel 102 Jul 21 07:35 1.3.1
lrwxr-xr-x 1 root wheel 10 Sep 24 20:12 1.5 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Sep 24 20:12 1.5.0 -> CurrentJDK
lrwxr-xr-x 1 root wheel 5 Sep 24 20:12 1.6 -> 1.6.0
drwxr-xr-x 7 root wheel 238 Sep 24 20:12 1.6.0
drwxr-xr-x 8 root wheel 272 Sep 24 20:12 A
lrwxr-xr-x 1 root wheel 1 Sep 24 20:12 Current -> A
lrwxr-xr-x 1 root wheel 3 Sep 24 20:12 CurrentJDK -> 1.6
Can I install the real 1.5 from somewhere?
Here is a link to downgrading Snow Leopard to Java 1.5
Hmm, i do not have installed 10.6 yet (it is on the way), but the versions directory looks strange. Where is 1.4? And no version should point to CurrentJDK! My 10.5 installation is the following:
r2d2:~ arne$ ls -l /System/Library/Frameworks/JavaVM.framework/Versions
total 56
lrwxr-xr-x 1 root wheel 5 16 Sep 19:14 1.3 -> 1.3.1
drwxr-xr-x 3 root wheel 102 14 Jan 2008 1.3.1
lrwxr-xr-x 1 root wheel 5 16 Sep 19:14 1.4 -> 1.4.2
lrwxr-xr-x 1 root wheel 3 21 Feb 2008 1.4.1 -> 1.4
drwxr-xr-x 8 root wheel 272 21 Feb 2008 1.4.2
lrwxr-xr-x 1 root wheel 5 16 Sep 19:14 1.5 -> 1.5.0
drwxr-xr-x 8 root wheel 272 21 Feb 2008 1.5.0
lrwxr-xr-x 1 root wheel 5 16 Sep 19:14 1.6 -> 1.6.0
drwxr-xr-x 8 root wheel 272 26 Sep 2008 1.6.0
drwxr-xr-x 8 root wheel 272 16 Sep 19:14 A
lrwxr-xr-x 1 root wheel 1 16 Sep 19:14 Current -> A
lrwxr-xr-x 1 root wheel 3 16 Sep 19:14 CurrentJDK -> 1.5
r2d2:~ arne$
Do other 10.6 users have the same problem? I am not shure about installing the Java 5 package for 10.5 will work on 10.6. Someone have experience?
Run java5 on Snow Leopard
Get the java 5 that was included in 10.5 "leopard" and unpack
cd /tmp/
curl -o java.1.5.0-leopard.tar.gz
http://www.cs.washington.edu/homes/isdal/snow_leopard_workaround/java.1.5.0-leopard.tar.gz
tar -xvzf java.1.5.0-leopard.tar.gz
Move it to your System java folder (password needed)
sudo mv 1.5.0 /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0-leopard
Tell OS X that java 5 actually is java 5
cd /System/Library/Frameworks/JavaVM.framework/Versions/
sudo rm 1.5.0
sudo ln -s 1.5.0-leopard 1.5.0
sudo rm 1.5
sudo ln -s 1.5.0 1.5
I've put together a small how-to here.
I was receiving a 'Bus Error' when trying to use the steps at http://wiki.oneswarm.org/index.php/OS_X_10.6_Snow_Leopard on 10.6.6. However when I tried
Sagacity's steps above. I was able to get 1.5 to run.