No CurrentJDK directory - xcode

I am on OS X Yosemite 10.10.3
I am running XCODE and receive the error
Error: JAVA_HOME is not defined correctly.
We cannot execute /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/bin/java
I have looked at Where is JAVA_HOME on OSX Sierra (10.12), El Captain (10.11), Yosemite (10.10), Mavericks (10.9), Mountain Lion (10.8) or OSX Lion (10.7)?
and tried all of the suggestions for the JAVA_HOME variable.
I have tried uninstalling and reinstalling java and the jdk from Oracle
java -version gives me
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
I have made sure that in all the suggestions I replaced the version # with my correct version #.
Everyone that has made a response seems to have a CurrentJDK within /System/Library/Frameworks/JavaVM.framework/Versions/.
I only have A and Current
I am wondering if this is part of the reason I am getting the error, and how would I fix that?

cd /System/Library/Frameworks/JavaVM.framework/Versions/
sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents CurrentJDK
Running these 2 lines fixed my issue, and added a CurrentJDK to the Versions directory.

Related

Scout not working even though Java Runtime is installed on Mac

Today my Compass/Sass stopped compiling and i was unable to get it working again. So i installed Scout. But Scout wouldn’t run until i installed Java Runtime for Mac. So I downloaded and installed Java Runtime for Mac. But when running Scout I am still prompted as if Java Runtime was never installed. I see the Java Runtime in my System Preferences so I assume it’s working?
I’m running Mac OS 10.10.1 Yosemite
Anyone know what the problem might be?
I found the solution. You need to run a legacy version of Java for some applications to still work. Here's the download link and info from Apple:
https://support.apple.com/kb/DL1572?locale=en_US
Java for OS X 2015-001 installs the legacy Java 6 runtime for OS X
10.11 El Capitan, OS X 10.10 Yosemite, OS X 10.9 Mavericks, OS X 10.8 Mountain Lion, and OS X 10.7 Lion.
This package is exclusively intended for support of legacy software
and installs the same deprecated version of Java 6 included in the
2014-001 and 2013-005 releases.
Quit any Java applications before installing this update.
I don't know Scout but you might need the older JNI (Java Native Interface) version of Java (1.6) that Apple deprecated a long time ago but is still available if you know now to find it.
The easiest way to install it is to use this command in Terminal:
/usr/libexec/java_home --task JNI --request
and follow the prompts (it will pop up a dialog box offering to install the requested version). OS X can host multiple versions of Java a once so installing this older version shouldn't affect your existing installation.

Why can't I update Java from 1.6 to 1.7 on Coldfusion 9.0.2 on Mac OSX 10.8.5

I'm running OSX 10.8.5 and recently installed Coldfusion 9.0.2 and applied the hotfix so I'm running CF Version 9,0,2,282541 (which should be compatible with Java 1.7). My prod environment is running Java 1.7 so I'm trying to replicate that on a dev machine. The Java Version currently being used by CF is 1.6.0_65.
My dev box has Java running in multiple locations as follows:
System/Library/Java/JavaVirtualMachines/1.6.0.jdk
Library/Java/JavaVirtualMachines/jdk1.7.0_65.jdk
When I run java-version from within Terminal, I get the following:
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
However, when I start CF, it reverts to 1.6.0_65:
Java Version: 1.6.0_65
Java Vendor: Apple Inc.
Java Home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Now I know that CF doesn't use the system environment variable JAVA_HOME. It uses the jvm.config argument "java.home"
When I run 'java -version' within terminal, that is using the java version that it finds in the system path, which is different from what CF can use.
Based on this, I've attempted to update my jvm.config file so that the java.home variable is now /Library/Java/JavaVirtualMachines/jdk1.7.0_65.jdk/Contents/Home/jre but even after restarting CF, it reverts to the default of 1.6.0_65 as shown below.
One interesting thing is that if I look at the Adobe_Coldfusion9_Install_Log.log, I do see the following variables (among other things) set during the installation.
java.ext.dirs:
1.) /Library/Java/Extensions
2.) /System/Library/Java/Extensions
3.) /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext
java.version: 1.6.0_65 (Java 1)
java.home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
The true question is how can I get CF to recognize changes to these if it's not looking at my jvm.config file??? How can I force it to use the "/Library/" path instead of the "System/Library" path?
This is very similar to the crazy4mustang's question posted below but it is unanswered. The only real differences is that he is running Mavericks and I'm on Mountain Lion.
Can't update Coldfusion to Java 1.7 on OSX 10.9
Disclaimer: I am not running OSX
I found a couple of articles referring to three files that need to be updated in order to change the Java path for ColdFusion running on OSX. There is this reference which is regarding ColdFusion 10 but I would assume similar locations for ColdFusion 9.
/Applications/ColdFusion10/cfusion/bin/jvm.config
/Applications/ColdFusion10/cfusion/bin/coldfusion
/Applications/ColdFusion10/cfusion/runtime/bin/wsconfig_jvm.config
In each of these, there was a setting to set the Java home path. It was set to the old location for Java 6. I updated these to point to Java 7.
Read this note from Adobe regarding ColdFusion 9.0.2, Java 1.7 and OSX
JDK 1.7 is only supported on Mac OS X 10.7 and above. See this article for more details. As ColdFusion 9.0.2 does not support Mac OS X 10.7, Cumulative Hot fix 1 does not certify ColdFusion 9.0.2 with JDK 1.7 on Mac OS X.

Install and switch from Java 6 and 7

I'm new on mac and I need to install both Java 6 and Java 7.
My Mac's version is Mac OS X Lion 10.7.5 (11G63)
The problem is I have found already installed Java 7 and I need to install Java 6 and switch between them because I have some projects needed 6 and others need 7.
I normally go on oracle web site and download the version's Java that I need to install on Linux or Windows.
The problem is that I couldn't find the version for Mac on http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR
Could someone explain me how I can get Java 6 and how I can switch between them?
Thanks a million
Welcome to Mac world !! You need to download Java from this site and install it on your system. After that, open your terminal and type
javac -version
You will see that it still shows your java version 1.7.
What you need to do next is using java_home to check the path of the java 1.6
$ /usr/libexec/java_home -v 1.6
/Library/Java/JavaVirtualMachines/1.6.0_45-b06-451.jdk/Contents/Home
$ /usr/libexec/java_home -v 1.7
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
So, whenever you need 1.6 or 1.7, you can set the path of the particular version in /User/<your-account>/.bash_profile. For example:
export JAVA_HOME="/Library/Java/JavaVirtualMachines/1.6.0_45-b06-451.jdk/Contents/Home"
# export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home"

Trouble getting Elasticsearch to run

I am trying to get Elasticsearch to run but unable to. Running ./bin/elasticsearch yields the following error:
Initialization Failed ...
- MissingResourceException[Can't find bundle for base name org.elasticsearch.common.joda.time.format.messages, locale en]
I'm running Mac OSX 10.8.2 and java -version yields:
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
Any ideas on what the problem is? I also trying running the ./bin/elasticsearch.in.sh script before but nothing has worked
It turns out the file on the elasticsearch website was messed up or had a bad download. I downloaded the tar.gz version and it worked.
I had the similar issue with both Elasticsearch 1.7 & Elasticsearch 2.0 on Mac OSx 10.10 Yosemite. I messed around with installing Java 8's JRE without success.
I ended up installing the Java 8 JDK in addition to the JRE based on this answer.
Additionally here's Elasticsearch's instructions

What Java version comes with Mac OS X?

I have created a Java Swing application using JDK 1.6. Many customers are asking if my application can run on Mac OS X 10.5 and 10.6, so I wanted to add this question to my website's FAQs section, and I wanted an accurate answer. I am trying to answer this:
What Java version comes with Mac OS X 10.6 ?
What Java version comes with Mac OS X 10.5 ?
I know Mac OSX 10.5 comes with a Java version less than 1.6, so is there a simple way to update it to 1.6 so my program can run fine on it?
10.6.7 has:
jonatan:~ $ java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode)
for 10.5 here is the update
http://support.apple.com/downloads/Java_for_Mac_OS_X_10_5_Update_4
This release updates Java SE 6 to
version 1.6.0_13, J2SE 5.0 to version
1.5.0_19, and J2SE 1.4.2 to 1.4.2_21.
The update process is easy - the user should run: "Software Update..." from the "Apple" menu.

Resources