Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Location of javaw on the Mac

Tags:

macos

javaw

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)
like image 376
Snowcrash Avatar asked Sep 07 '25 22:09

Snowcrash


1 Answers

mac or linux: java -jar xxx.jar &

win: javaw -jar xxx.jar

like image 100
远星河 Avatar answered Sep 09 '25 12:09

远星河