Eclipse Indigo for OS X Mavericks launched with Java SE 7 - java-7

I wanted to install eclipe Indigo SR2 on Mac OSX Mavericks and I got this message when I launched ./eclipse in Terminal :
Alert : Failed to create the Java Virtual Machine
And that in the Terminal:
JavaVM: Failed to load JVM: /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/bundle/Libraries/libserver.dylib
JavaVM FATAL: Failed to load the jvm library.
I have that on my System :
java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

What I have done:
cd /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/
sudo mkdir bundle
cd bundle
sudo mkdir Libraries
ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/server/libjvm.dylib libserver.dylib
It works!

What I've done:
cd /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/
sudo ln -s /Library/Java/Home/bundle bundle
It works!

Related

Not able to open iReport Designer in mac

I'm new to Jasper reports and Mac. I have downloaded iReport-5.6.0.dmg. It got saved in downloads. Later I moved to applications. The .dmg didnt install and when I just open the .dmg and right click to open for Jaspersoft report designer, it didnt open.
I just saw some questions, but nothing helped.
I'm using mac os Sierra 10.12.2
My java version is
Alis-MacBook-Air:~ Shah$ java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
Alis-MacBook-Air:~ Shah$
JDK location
Alis-MacBook-Air:~ Shah$ /usr/libexec/java_home -V
Matching Java Virtual Machines (2):
1.8.0_101, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
1.7.0_79, x86_64: "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
iReport.conf
# ${HOME} will be replaced by user home directory according to platform
default_userdir="${HOME}/.${APPNAME}/5.6.0"
default_mac_userdir="${HOME}/Library/Application Support/${APPNAME}/5.6.0"
# options used by the launcher by default, can be overridden by explicit
# command line switches
default_options="-J-Xms256m -J-Xmx512m -J-Dorg.netbeans.ProxyClassLoader.level=1000 -J-XX:MaxPermSize=512m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dnetbeans.exception.report.min.level=99999 "
# for development purposes you may wish to append: -J-Dnetbeans.logger.console=true -J-ea
# default location of JDK/JRE, can be overridden by using --jdkhome <dir> switch
#jdkhome="/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home"
# clusters' paths separated by path.separator (semicolon on Windows, colon on Unices)
#extra_clusters=
You should setup JDK 1.7s as JAVA_HOME otherwise you'll see like this error
"The current path is: C: \ Java \ jdk1.8.0The current path is: C: \ Java \ jdk1.8.0Java HotSpot (TM) 64-Bit Server VM warning: ignoring option MaxPermSize = 512m; support was removed in 8.0" and you can setup jaspersoft studio community its working.
Issue was with the JDK version.
If the JDK version is 1.8, Jasperstudio has to be installed. It worked fine.

Error: JAVA_HOME is not defined correctly, when installing Maven on Mac

It is suppose to be easy, but I'm having great difficulty installing Maven on to my mac 10.11.4.
I have created M2_HOME and PATH for Maven, but when I type in mvn --version, the terminal tell me
/Users/justin/apache-maven-3.3.9/bin/mvn: line 53: uname: command not found
/Users/justin/apache-maven-3.3.9/bin/mvn: line 143: which: command not found
/Users/justin/apache-maven-3.3.9/bin/mvn: line 171: which: command not found
Error: JAVA_HOME is not defined correctly.
We cannot execute
Why is this happening?
You need JAVA_HOME to be defined, as covered in installation guide.
Check out this answer for additional details for MacOS.
For macOs Ventura 13.1
If you installed java openJdk version 11 using Homebrew:
brew install java11
Then, your java is installed on:
/opt/homebrew/Cellar/openjdk#11/11.0.17/libexec/openjdk.jdk/Contents/Home
So, you must understand that this is you JAVA_HOME environment variable.
You need to add the java '/bin' folder to your PATH environment variable in order to have it working on your terminal. Also, you need to create the JAVA_HOME environment variable in order to maven to know about your java.
Therefore, you must open:
/Users/<yourUser>/.zshrc
Add
export JAVA_HOME="/opt/homebrew/Cellar/openjdk#11/11.0.17/libexec/openjdk.jdk/Contents/Home"
export PATH="/opt/homebrew/opt/openjdk#11/bin:$PATH"
Save your changes, close the file. Now you can open your terminal and type:
java -version
and then,
mvn -version
and this is what you should get:
example#example441 ~ % java -version
openjdk version "11.0.17" 2022-10-18
OpenJDK Runtime Environment Homebrew (build 11.0.17+0)
OpenJDK 64-Bit Server VM Homebrew (build 11.0.17+0, mixed mode)
example#example441 ~ % mvn -version
Apache Maven 3.8.7 (xxxxxxxxxxxxxxxxxxxxxxxxxxx)
Maven home: /opt/homebrew/Cellar/maven/3.8.7/libexec
Java version: 11.0.17, vendor: Homebrew, runtime:
opt/homebrew/Cellar/openjdk#11/11.0.17/libexec/openjdk.jdk/Contents/Home
Default locale: pt_BR, platform encoding: UTF-8
OS name: "mac os x", version: "13.1", arch: "aarch64", family: "mac"

No CurrentJDK directory

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.

Location of javaw on the Mac

I have a shell script on the Mac which looks for javaw. i.e.:
#!/bin/sh
javaw -version 2> /dev/null
if [ $? == 0 ]; then
javaw -jar some.jar
else
echo "Java Runtime not installed or JRE executable not in PATH"
fi
but it gives this error when I run it:
Java Runtime not installed or JRE executable not in PATH
Clearly it can't find javaw. So, my question is - where is javaw on Mac OS X [Version 10.10.2 (14C109)]?
==== UPDATE
Java is installed. e.g:
$ java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
mac or linux: java -jar xxx.jar &
win: javaw -jar xxx.jar

OS X Mountain Lion Java version

I would like to use java and javac on Mac OS X 10.8.2, but in the terminal when I ask for version with this command: java -version or javac -version it returns the following versions:
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-11M3909)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode)
and
javac 1.6.0_37
When I go to the settings app and tap on the Java icon in the Other section, it opens the Java Control Panel and there the jre version is 1.7.0_10
Which is used? And how can I update the java in terminal, not to use the 1.6.0 version?
Does anybody experienced this problem?
Open Java Preference App, you may find several JDKs, you can drag JDK7 to the top of the list, then re-open the shell, and invoke java -version. It will change to the JDK7.

Resources