All Questions
5,777
questions
1375
votes
38
answers
1.7m
views
How to set or change the default Java (JDK) version on macOS?
How can you change the default version of Java on a mac?
1290
votes
34
answers
1.4m
views
How to install Java 8 on Mac
Editors note: This question was asked in 2014, and the answers may be outdated.
I want to do some programming with the latest JavaFX, which requires Java 8. I'm using IntelliJ 13 CE and Mac OS X 9 ...
881
votes
21
answers
1.1m
views
Where is Java Installed on Mac OS X?
I downloaded Java 7u17 on Mac OS 10.7.5 from here and successfully installed it. To do some JNI programming, I need to know where Java is installed on my Mac.
I thought that inside the /Library/Java/...
591
votes
27
answers
570k
views
Where is JAVA_HOME on macOS Mojave (10.14) to Lion (10.7)?
Java is an optional package on the latest versions of macOS.
Yet once installed it appears like the JAVA_HOME environment variable is not set properly.
490
votes
11
answers
429k
views
How do I install Java on Mac OSX allowing version switching?
I want to install OpenJDK Java on Mac OSX and have it work alongside other JDK's since it is a newer release. Currently, I downloaded the tar.gz and placed it in my path but that is hard to maintain. ...
487
votes
22
answers
489k
views
Mac OS X and multiple Java versions
How can I install an additional java on MacOS? I installed jdk8 and that works fine. But now I need a jdk7 installation for development purposes. When trying to install the old version via DMG file, ...
463
votes
15
answers
318k
views
What should I set JAVA_HOME environment variable on macOS X 10.6?
Many Java applications that use shell scripts to configure their environment use the JAVA_HOME environment variable to start the correct version of Java, locate JRE JARs, and so on.
In macOS X 10.6, ...
405
votes
5
answers
812k
views
What is path of JDK on Mac ? [duplicate]
Im using Mac only at work and I need to set JAVA_HOME to proper path of JDK. I downloaded JDK, installed it and now I can't find it anywhere. I was looking at the internet for the solution, but there ...
397
votes
27
answers
355k
views
Installed Java 7 on Mac OS X but Terminal is still using version 6
I've installed JDK 7u7 downloaded from oracle's website. But after installation, the terminal is still showing java version 6
$java -version
java version "1.6.0_35"
Java(TM) SE Runtime Environment (...
365
votes
13
answers
325k
views
How to increase IDE memory limit in IntelliJ IDEA on Mac?
I'm using IDEA 12 Leda on Mountain Lion. I wanted to increase the maximum memory that IDE can use. I set the VMOptions in Info.plist file to be
-Xmx2048m -ea -XX:+HeapDumpOnOutOfMemoryError -Xverify:...
357
votes
20
answers
920k
views
How to set JAVA_HOME environment variable on Mac OS X 10.9?
I just purchased a brand new MacBook Pro.
This is my first MAC ever and I'm still trying to get the hang of navigating my way around.
Anyway, I'm also new to Java and I've been practicing on my ...
337
votes
7
answers
144k
views
Intellij Idea: Importing Gradle project - getting JAVA_HOME not defined yet
Intellij Idea 14.1.4
Mac OS X Yosemite 10.10.3 and later.
From the IDE:
Import Project ->
(Chosen directory to import) ->
Import project from external model, Gradle ->
Gradle Home: /usr/...
321
votes
11
answers
411k
views
Installing Java on OS X 10.9 (Mavericks)
I have installed the JDK on Mac OS X v10.8 (Mountain Lion). When I upgraded it to Mac OS X v10.9 (Mavericks) and ran java -version in the terminal, it showed:
No Java ...
316
votes
16
answers
286k
views
MacOS Catalina(v 10.15.3): Error: “chromedriver” cannot be opened because the developer cannot be verified. Unable to launch the chrome browser
I have recently upgraded my mac machine to OS Catalina(v 10.15.3). After this upgrade I am unable to launch the chrome driver using selenium.
I am facing the below error when I run the selenium code ...
309
votes
7
answers
214k
views
Class JavaLaunchHelper is implemented in two places
Today I upgraded my Intellij Idea on macOS Sierra, and now, when I run apps in console I have this error:
objc[3648]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/...
308
votes
14
answers
463k
views
Removing Java 8 JDK from Mac
So I installed the beta of JDK 8 a while ago to look at some of the examples. I thought for sure by now, it's easy to change between versions.
Doing some Play development with IntelliJ. For some ...
286
votes
16
answers
518k
views
Java/JDK for the Apple Silicon chips
Will there need to be a special release of OpenJDK to support the new Apple Silicon chips?
I see that there are currently downloads of the JDK for macOS/OS X, but these seem to only be for x86 ...
280
votes
12
answers
127k
views
Class JavaLaunchHelper is implemented in both ... libinstrument.dylib. One of the two will be used. Which one is undefined
I upgraded to the latest Java 7u40 on MacOS X and started getting the following message on the console when launching my application using Eclipse. The app works fine but I would like to find out the ...
221
votes
10
answers
351k
views
How to brew install java?
I'd like to setup java on a new OS X machine, and prefer to use brew for OS X package management. How can I install latest java using brew?
211
votes
28
answers
148k
views
Android Studio was unable to find a valid Jvm (Related to MAC OS)
I am unable to start my Android Studio for Android development on Mac OS (10.10.1 - Yosemite)
208
votes
22
answers
340k
views
Access restriction: The type 'Application' is not API (restriction on required library rt.jar)
Here is the code:
package mscontroller;
import javax.swing.*;
import com.apple.eawt.Application;
public class Main {
public static void main(String[] args)
{
Application app = new ...
200
votes
17
answers
301k
views
How to install a specific JDK on Mac OS X?
I want to install a specific JDK (the latest for example). For this, I went to the JDK download homepage: http://java.sun.com/javase/downloads/index.jsp.
I looked for a Mac version, but I'm a bit ...
196
votes
11
answers
298k
views
How do I check if the Java JDK is installed on Mac?
How do you check if Java SDK is installed on a Mac?
Is there a command line for this?
166
votes
9
answers
146k
views
Why Maven uses JDK 1.6 but my java -version is 1.7
I have setup maven in my terminal, and when getting the version settings (using mvn -v) it seems it uses JDK 1.6, while I have JDK 1.7 installed. Is there anything wrong?
The commands I enter are ...
161
votes
3
answers
218k
views
How to run Gradle from the command line on Mac bash
I have a very simple question. I am brand new to Mac and I am trying to get my Java project moved over to my new Mac. The project has a Gradlew file that I thought I could run from the command line to ...
157
votes
7
answers
348k
views
How to tell if JRE or JDK is installed
I have one computer that I intentionally installed JDK on. I have another computer with JRE, for, among other things, testing. However, when I got a java application working on this computer, and then ...
146
votes
5
answers
279k
views
Add a dependency in Maven
How do I take a jar file that I have and add it to the dependency system in maven 2? I will be the maintainer of this dependency and my code needs this jar in the class path so that it will compile.
143
votes
15
answers
164k
views
How can I change Mac OS's default Java VM returned from /usr/libexec/java_home
(Wasn't sure if this should go on SU... migration is certainly an option, but more programmers read questions here, so here goes).
I am running Mac OS X 10.8.4, and I have Apple's JDK 1.6.0_51 ...
141
votes
12
answers
105k
views
Using JDK that is bundled inside Android Studio as JAVA_HOME on Mac
I tried to open Android Device Monitor and the Studio showed me this message =-O :
It surprised me, because how have I been able to develop Android apps if I didn't have any Java installed?! Actually,...
134
votes
42
answers
407k
views
PySpark: "Exception: Java gateway process exited before sending the driver its port number"
I'm trying to run PySpark on my MacBook Air. When I try starting it up, I get the error:
Exception: Java gateway process exited before sending the driver its port number
when sc = SparkContext() is ...
132
votes
6
answers
92k
views
Android Studio needs JDK 7 for Android-L mac
I was trying to look how my app looks in material design and I would like to use the new cards lib.
My Problem is, that it's giving me this error within my gradle file and I need to fix that.
Error:...
124
votes
23
answers
297k
views
How to set JAVA_HOME in Mac permanently?
I am trying to set JAVA_HOME by entering export JAVA_HOME=/Library/Java/Home at terminal.
It sets the JAVA_HOME for current session.
How can I set it permanently?
121
votes
20
answers
136k
views
java.lang.IllegalArgumentException: Malformed \uxxxx encoding while mvn install
While running mvn install in my project, I end up with this error. While a lot of answers and resources point out errors in / vs \, I want to mention that I have no local changes and this repo just ...
119
votes
12
answers
266k
views
macOS - How to install Java 17
Could someone please let me know the steps to install Java on a Mac.
I did brew install java
I get this
Warning: openjdk 17.0.1 is already installed and up-to-date.
To reinstall 17.0.1, run:
brew ...
118
votes
9
answers
99k
views
After Installing Java JDK 7 For Mac OS X - mvn -version still shows java version 1.6.0_31
Oracle released Java JDK 7 on April 26 for Mac OS X. I followed the install instructions and when I do java -version in a terminal window I get:
java version "1.7.0_04"
Java(TM) SE Runtime ...
115
votes
6
answers
367k
views
How do I compile and run a program in Java on my Mac?
How do I compile and run a program in Java on my mac?
I'm new.
Also I downloaded a program that was suggested to me on here called text wrangler if that has any bearing on the situation.
114
votes
6
answers
101k
views
Maven Installation OSX Error Unsupported major.minor version 51.0
I installed maven by following this steps:(a tutorial)
JAVA_HOME=/Library/Java/Home
export M2_HOME=/Users/steven/zimmermann/maven
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
echo $JAVA_HOME
echo $...
109
votes
16
answers
217k
views
How do I use JDK 7 on Mac OSX?
I would like to use the WatchService API as mentioned in this link:
http://download.oracle.com/javase/tutorial/essential/io/notification.html
After reading around, I found out that WatchService is ...
108
votes
11
answers
121k
views
Spark Error - Unsupported class file major version
I'm trying to install Spark on my Mac. I've used home-brew to install spark 2.4.0 and Scala. I've installed PySpark in my anaconda environment and am using PyCharm for development. I've exported to my ...
89
votes
10
answers
90k
views
Maven 3.3.1 ECLIPSE: -Dmaven.multiModuleProjectDirectory system propery is not set
I just installed Maven 3.3.1 on Mac OS X, and building a Maven Project with Eclipse is giving me this error:
-Dmaven.multiModuleProjectDirectory system property is not set.
Check $M2_HOME environment ...
87
votes
6
answers
24k
views
maven ignoring jenv settings
I had OSX with Java 1.6 installed, and I just installed jenv along with Java 1.7:
$ jenv local '1.7'
$ jenv versions
system
1.6
1.6.0.65
* 1.7 (set by /Users/me/workspace/.java-version)
1.7.0....
86
votes
5
answers
76k
views
How do I run IDEA IntelliJ on Mac OS X with JDK 7?
I use Mac OS X 10.8.2, and use JDK 7. Now I downloaded the latest version of IDEA IntelliJ, 11. But it doesn't seem to start without JDK 6. Is there any workaround?
How can I run IDEA IntelliJ on Mac ...
85
votes
13
answers
132k
views
Unable to install java8 with homebrew
Installing java8 with Homebrew seems to no longer be working. After running:
brew install caskroom/cask/java8
I get the following error:
Error: Cask 'java8' is unavailable: '/usr/local/Homebrew/...
76
votes
6
answers
34k
views
How do I tell IntelliJ about groovy installed with brew on OSX
I'm running:
IntelliJ Ultimate 2016.3
Homebrew 1.1.2
OS X 10.11.5 El Capitan
I ran brew install groovy which resulted in groovy being installed in /usr/local/Cellar/groovy/2.4.7/. Brew also added ...
73
votes
6
answers
135k
views
Determining the version of Java SDK on the Mac
I have a MacBook Pro running Snow Leopard; how can I see what version of the Java SDK is installed on my Mac?
71
votes
8
answers
53k
views
Setting up scala with IntelliJ
I have Intellij ultimate 11.1, with the scala plugin installed.
I installed scala 2.9.2 using homebrew, which put scala in:
/usr/local/Cellar/scala/2.9.2>
>which scala
/usr/local/bin/scala
&...
71
votes
8
answers
162k
views
Unable to locate an executable at "/usr/bin/java/bin/java" (-1)
I am having a pathetic issue with Java in my mac osx 10.7.3 .
Previously I installed it and it was working fine.
After some changes in the .bash_profile and .profile file in the course of time,
I am ...
68
votes
11
answers
38k
views
Source code for Mac OS X Java Updates [duplicate]
Java for Mac OS X 10.6 Update 3 upgraded to java 1.6.0_22. However, they did not include the source code or JavaDoc. Does anyone know if Apple provides the source, and if so, where to find it?
I'd ...
68
votes
3
answers
198k
views
How to install JRE 1.7 on Mac OS X and use it with Eclipse? [closed]
I want to use the JRE 1.7 that I downloaded from Oracle website.
So I correctly install the .pkg file, and when I try /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -...
67
votes
5
answers
103k
views
JDK on OSX 10.7 Lion
I've instaled the Java for Developer package provided from Apple for 10.7 and java apps are running fine
but eclipse cannot find the JDK root path and I cant either.
Anybody any ideas?