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
Related
To get the java version I run this in bash (what I really want is 1.8 or 1.8.0_171)
$ java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
In my test script just getting the first line would be OK so I execute this:
java -version | grep java
echo return is $?
which returns this:
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
return is 1
According to the man page grep's return indicates it had no errors but found no matches even so the results from "java -version" are printed.
I've tried grep with a few different search patterns and have tried sed and aux, using Google for help, as well with the same results.
What am I doing wrong?
java -version writes to standard error, not standard output, so grep isn't receiving any input.
java -version 2>&1 | grep java
should do what you expect.
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.
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!
I'm being very confused by the following happening in my terminal:
my-computer:~$ which java
/usr/bin/java
my-computer:~$ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
my-computer:~$ sudo su
Password:
my-computer:/Users/paulhabfast$ which java
/usr/bin/java
my-computer:/Users/paulhabfast$ 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)
Can anyone explain me what is going on?
The way I understand it so far is that when I switch from the current user to the root user, I'm being served a different executable?
I'm running Mac OSX 10.9, but I thought I had a pretty standard unix environment.
Is there any additional information I can give?
/usr/bin/java is a wrapper that looks at your environment variables, try env to see these variables, for example JAVA_HOME.
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.