This content has been marked as final. Show 8 replies
Read this article:
The article is excellent and will allow you to understand how to set the java environment for Mac.
Also, it's lion not loin, though lions like loins :-)
export JAVA_HOME=`/usr/libexec/java_home -v 1.7` java -version java -jar application.jar
When I run -
It's showing me -
Lions-Mac:Java User$ export JAVA_HOME=`/usr/libexec/java_home -v 1.7`
This may be because I have downloaded the JRE 1.7 not Java 1.7.
Unable to find any JVMs matching version "1.7".
Where Jre1.7 installed on mac machine because */Library/Java/JavaVirtualMachine/* showing me blank folder?
Only */Library/Internet Plug-ins/JavaAppletPlugin.plugin* has been updated showing version - Java7 Update 10.
Do I need to download the whole JAVA 1.7 on MAC to run the JAR?
Can not I run the Jar file with Jre7?
Do I need to download the whole JAVA 1.7 on MAC to run the JAR?No
Can not I run the Jar file with Jre7?Yes, you can.
This may be because I have downloaded the JRE 1.7Yep, that's correct, the java_home command only works for jdk's - sorry for the confusion.
For jre7+ versions, only a single Oracle jre version is allowed to be installed on the machine at a time - making a tool like java_home redundant for jre checking.
Weirdly, jre7u10 does not supplant the Apple Java on the command line path by default. If you just type java -v, then the Apple java version will displayed if you have an old Java 6 from Apple and a new Oracle jre7+.
The Oracle jre is always located under (also somewhat strangely):
To test jar launching, I used the willow JavaFX browser pre-release jar available here:
Then I launched the jar from the command line using:
The JavaFX jar ran fine on jre7 with the above machine.
/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -jar Willow-0.1-prerelease.jar
The test machine was running Mac OS X 8 with Oracle jre7u10 installed as well as the Apple Java 6 runtime, but no Oracle jdk7+ installed.
Thanks. Now made a small progress but still not able to the the JAR as I am getting Fatal Error now.
Would like to know - Is this fatal error related to system environment or because I have build that JAR on Window O.S.? Will the JavaFx application Jar work on MAC that build on Window O.S.?
FYI - I am running MAC OSX Lion Image on VM Player 5.0.0 build -812388 and I have installed JRE7 on this virtual machine.
Lions-Mac-2:~ User$ cd Desktop/mac/ Lions-Mac-2:mac User$ /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -Xmx512M -jar Application.jar # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007fff87f5afdf, pid=208, tid=19203 # # JRE version: 7.0_10-b18 # Java VM: Java HotSpot(TM) 64-Bit Server VM (23.6-b04 mixed mode bsd-amd64 compressed oops) # Problematic frame: # C [libobjc.A.dylib+0x9fdf] objc_msgSend_fixup+0x5f # # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again # # An error report file with more information is saved as: # /Users/User/Desktop/mac/hs_err_pid208.log # # If you would like to submit a bug report, please visit: # http://bugreport.sun.com/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Abort trap: 6 Lions-Mac-2:mac User$