Abbas
Abbas

Reputation: 3284

eclipse.ini not detecting jvm on Mac OS

I have a custom eclipse IDE which is based on v4.4.0. I don't have any java pre-installed in my Mac OS (EI Capitan v10.11). I have a jre(1.8.0_20) in a location which I want to start the eclipse with. So, i go and edit the eclipse.ini file with the vm args

-vm 
/Users/abbas/Desktop/jre1.8.0_20.jre/Contents/Home/bin/java

This is before the -vmargs argument

-startup
../../../plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.200.v20140603-1326
-product
com.myos.ide.package.commercial.product
--launcher.defaultAction
openFile
-vm
/Users/abbas/Desktop/jre1.8.0_20.jre/Contents/Home/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Xms40m
-Xmx512m
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:MaxPermSize=256m

Now, when I try to start it by clicking on the .app file still gives me the pop-up

"To open “WebOSIDE” you need to install the legacy Java SE 6 runtime."

I have verified that the java in the path above works

/Users/abbas/Desktop/jre1.8.0_20.jre/Contents/Home/bin/java -version java version "1.8.0_25" Java(TM) SE Runtime Environment (build
1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

I've tried on Mac High Sierra and the behaviour is same.

What could be the problem ?

Update : When I try to launch eclipse by navigating to WebOSIDE.app/Contents/MacOS/WebOSIDE and then clicking on WebOSIDE then it launches and it indeed takes the path of the jre specified in the ini file. But for some reason clicking on .app file isnt launching

Upvotes: 0

Views: 846

Answers (2)

Tony Weddle
Tony Weddle

Reputation: 2091

By default, eclipse will use the ini file with the same name as the executable. Not sure what the name of your executable is. If it is WebOSIDE then, by default, eclipse will look for a WebOSIDE.ini file. I'm not totally up to speed with where eclipse will look for that ini file though it may depend on the release of eclipse that your app is based on. Currently, it seems to be Contents/eclipse).

The location and name of the ini file can be changed using the launcher.ini argument for running the executable (you can also use this on the command line to check it). I'm not too familiar with this but I think the following (as an example) can be added to the Contents/info.plist file:

<key>Eclipse</key>
  <array>
    <string>--launcher.ini</string>
    <string>$APP_PACKAGE/Contents/Profile/eclipse.ini</string>
  <array>

If it's not finding the ini file then MacOS may be prompting you if there is no Java properly installed. Avoid installing the legacy Java runtime as it may be difficult to get rid of.

This is essentially from memory so search for more details on specifying the location of the ini file.

Upvotes: 1

nitind
nitind

Reputation: 20003

For a Mac, install a JDK. It doesn't really have a way of enumerating JREs to applications.

Upvotes: 0

Related Questions