Run java bundled in .app from command-line

The inquiry is just how do I run some application created in java and also packed right into . application plan from command - line?

The major objective of this is to run an application under JDK7. So I will certainly start it with the java packed in JDK7 as opposed to default one.

I require something like https://apple.stackexchange.com/a/10253/15553 yet with java, so I can run it with a various JDK.

1
2022-06-07 14:39:28
Source Share
Answers: 2

To switch over to an additional JVM, attempt to change the JAVA_HOME and also PATH covering setting variable in ~/. account.

# in ~/.profile
# switch to another JVM (here, 1.7)
unset JAVA_HOME PATH
export JAVA_HOME="$(/usr/libexec/java_home -F --version 1.7 2>/dev/null)"
export PATH="${JAVA_HOME}/bin:${PATH}"

# general info on Java preferences
open -a 'Java Preferences'
1
2022-06-07 15:07:00
Source

Or open the.app documents and also modify or add the JVMVersionvalue in the Info.plist thus

<key>JVMVersion</key>
<string>1.6+</string>
1
2022-06-07 15:06:21
Source