rholder / gradle-view

The Gradle View IntelliJ IDEA plugin shows a split tree rollup of the dependencies for each Gradle configuration in use by a project.
Apache License 2.0
179 stars 14 forks source link

gradle-view 3.0.0: MOSX: org.gradle.tooling can't find `java` inside IntelliJ #20

Open Brent-Knight-BL opened 6 years ago

Brent-Knight-BL commented 6 years ago

Summary

org.gradle.tooling throws an exception trying to find the java executable inside the IDEA application bundle. It seems to be looking for it at a slightly incorrect path. Specifically, it is looking for it at this path:

/Applications/IntelliJ IDEA 2017.3.app/Contents/jdk/Contents/Home/bin/java

But it seems to actually exist at this path (note the jre path component):

/Applications/IntelliJ IDEA 2017.3.app/Contents/jdk/Contents/Home/jre/bin/java

System version info:

gradle-view 3.0.0

IntelliJ IDEA 2017.3.2 (Ultimate Edition)
Build #IU-173.4127.27, built on December 25, 2017
JRE: 1.8.0_152-release-1024-b8 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.9.5

Details

directory layout inside IntelliJ

summary

$ ls -1F '/Applications/IntelliJ IDEA 2017.3.app/Contents/jdk/Contents/Home/bin/java'
ls: /Applications/IntelliJ IDEA 2017.3.app/Contents/jdk/Contents/Home/bin/java: No such file or directory

$ ls -F '/Applications/IntelliJ IDEA 2017.3.app/Contents/jdk/Contents/Home/jre/bin/java'
java*

full

$ tree -F '/Applications/IntelliJ IDEA 2017.3.app/Contents/jdk/Contents/Home'
/Applications/IntelliJ\ IDEA\ 2017.3.app/Contents/jdk/Contents/Home
├── jre/
│   ├── ASSEMBLY_EXCEPTION
│   ├── LICENSE
│   ├── THIRD_PARTY_README
│   ├── bin/
│   │   ├── java*
│   │   ├── jjs*
│   │   ├── keytool*
│   │   ├── orbd*
│   │   ├── pack200*
│   │   ├── policytool*
│   │   ├── rmid*
│   │   ├── rmiregistry*
│   │   ├── servertool*
│   │   ├── tnameserv*
│   │   └── unpack200*
│   └── lib/
│       ├── applet/
│       ├── calendars.properties
│       ├── charsets.jar
│       ├── classlist
│       ├── cmm/
│       │   ├── CIEXYZ.pf
│       │   ├── GRAY.pf
│       │   ├── LINEAR_RGB.pf
│       │   ├── PYCC.pf
│       │   └── sRGB.pf
│       ├── content-types.properties
│       ├── currency.data
│       ├── ext/
│       │   ├── cldrdata.jar
│       │   ├── dnsns.jar
│       │   ├── jaccess.jar
│       │   ├── jfxrt.jar
│       │   ├── localedata.jar
│       │   ├── meta-index
│       │   ├── nashorn.jar
│       │   ├── sunec.jar
│       │   ├── sunjce_provider.jar
│       │   ├── sunpkcs11.jar
│       │   └── zipfs.jar
│       ├── flavormap.properties
│       ├── fontconfig.bfc
│       ├── fontconfig.properties.src
│       ├── fonts/
│       │   ├── DroidSans-Bold.ttf
│       │   ├── DroidSans.ttf
│       │   ├── DroidSansMono.ttf
│       │   ├── DroidSansMonoDotted.ttf
│       │   ├── DroidSansMonoSlashed.ttf
│       │   ├── DroidSerif-Bold.ttf
│       │   ├── DroidSerif-BoldItalic.ttf
│       │   ├── DroidSerif-Italic.ttf
│       │   ├── DroidSerif-Regular.ttf
│       │   ├── LICENSE.txt
│       │   ├── font.conf
│       │   └── fonts.dir
│       ├── hijrah-config-umalqura.properties
│       ├── images/
│       │   └── cursors/
│       │       ├── cursors.properties
│       │       ├── invalid32x32.gif
│       │       ├── motif_CopyDrop32x32.gif
│       │       ├── motif_CopyNoDrop32x32.gif
│       │       ├── motif_LinkDrop32x32.gif
│       │       ├── motif_LinkNoDrop32x32.gif
│       │       ├── motif_MoveDrop32x32.gif
│       │       └── motif_MoveNoDrop32x32.gif
│       ├── javafx.properties
│       ├── jce.jar
│       ├── jfxswt.jar
│       ├── jli/
│       │   └── libjli.dylib*
│       ├── jspawnhelper*
│       ├── jsse.jar
│       ├── jvm.cfg
│       ├── jvm.hprof.txt
│       ├── libAppleScriptEngine.dylib*
│       ├── libattach.dylib*
│       ├── libawt.dylib*
│       ├── libawt_lwawt.dylib*
│       ├── libdecora_sse.dylib*
│       ├── libdt_socket.dylib*
│       ├── libfontmanager.dylib*
│       ├── libfreetype.dylib.6*
│       ├── libfxplugins.dylib*
│       ├── libglass.dylib*
│       ├── libglib-lite.dylib*
│       ├── libgstreamer-lite.dylib*
│       ├── libhprof.dylib*
│       ├── libinstrument.dylib*
│       ├── libj2gss.dylib*
│       ├── libj2pcsc.dylib*
│       ├── libj2pkcs11.dylib*
│       ├── libjaas_unix.dylib*
│       ├── libjava.dylib*
│       ├── libjava_crw_demo.dylib*
│       ├── libjavafx_font.dylib*
│       ├── libjavafx_iio.dylib*
│       ├── libjawt.dylib*
│       ├── libjdwp.dylib*
│       ├── libjfxmedia.dylib*
│       ├── libjfxmedia_avf.dylib*
│       ├── libjfxmedia_qtkit.dylib*
│       ├── libjfxwebkit.dylib*
│       ├── libjpeg.dylib*
│       ├── libjsdt.dylib*
│       ├── libjsig.dylib*
│       ├── libjsound.dylib*
│       ├── liblcms.dylib*
│       ├── libmanagement.dylib*
│       ├── libmlib_image.dylib*
│       ├── libnet.dylib*
│       ├── libnio.dylib*
│       ├── libnpt.dylib*
│       ├── libosx.dylib*
│       ├── libosxapp.dylib*
│       ├── libosxkrb5.dylib*
│       ├── libosxui.dylib*
│       ├── libprism_common.dylib*
│       ├── libprism_es2.dylib*
│       ├── libprism_sw.dylib*
│       ├── libsaproc.dylib*
│       ├── libsplashscreen.dylib*
│       ├── libsunec.dylib*
│       ├── libunpack.dylib*
│       ├── libverify.dylib*
│       ├── libzip.dylib*
│       ├── logging.properties
│       ├── management/
│       │   ├── jmxremote.access
│       │   ├── jmxremote.password.template
│       │   ├── management.properties
│       │   └── snmp.acl.template
│       ├── management-agent.jar
│       ├── meta-index
│       ├── net.properties
│       ├── psfont.properties.ja
│       ├── psfontj2d.properties
│       ├── resources.jar
│       ├── rt.jar
│       ├── security/
│       │   ├── blacklisted.certs
│       │   ├── cacerts
│       │   ├── java.policy
│       │   ├── java.security
│       │   └── policy/
│       │       ├── limited/
│       │       │   ├── US_export_policy.jar
│       │       │   └── local_policy.jar
│       │       └── unlimited/
│       │           ├── US_export_policy.jar
│       │           └── local_policy.jar
│       ├── server/
│       │   ├── Xusage.txt
│       │   ├── libjsig.dylib*
│       │   └── libjvm.dylib*
│       ├── sound.properties
│       └── tzdb.dat
└── lib/
    └── tools.jar

17 directories, 144 files

Full Exception

Build

org.gradle.tooling.GradleConnectionException: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.4-bin.zip'.
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:55)
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
    at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41)
    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
    at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter.run(DefaultBuildActionExecuter.java:60)
    at com.github.rholder.gradle.dependency.DependencyConversionUtil.loadProjectDependenciesFromModel(DependencyConversionUtil.java:109)
    at com.github.rholder.gradle.intellij.DependencyViewer$1$1.doInBackground(DependencyViewer.java:106)
    at com.github.rholder.gradle.intellij.DependencyViewer$1$1.doInBackground(DependencyViewer.java:103)
    at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at javax.swing.SwingWorker.run(SwingWorker.java:334)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.internal.jvm.JavaHomeException: The supplied javaHome seems to be invalid. I cannot find the java executable. Tried location: /Applications/IntelliJ IDEA 2017.3.app/Contents/jdk/Contents/Home/bin/java
    at org.gradle.internal.jvm.Jvm.findExecutable(Jvm.java:130)
    at org.gradle.internal.jvm.Jvm.getJavaExecutable(Jvm.java:151)
    at org.gradle.internal.jvm.Jvm.forHome(Jvm.java:110)
    at org.gradle.launcher.daemon.configuration.DaemonParameters.getEffectiveJavaExecutable(DaemonParameters.java:100)
    at org.gradle.launcher.daemon.client.DefaultDaemonStarter.startDaemon(DefaultDaemonStarter.java:73)
    at org.gradle.launcher.daemon.client.DefaultDaemonConnector.startDaemon(DefaultDaemonConnector.java:109)
    at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connect(DefaultDaemonConnector.java:87)
    at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:117)
    at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:77)
    at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:44)
    at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:31)
    at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:62)
    at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:34)
    at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:113)
    at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:107)
    at org.gradle.tooling.internal.provider.DefaultConnection.run(DefaultConnection.java:186)
    at org.gradle.tooling.internal.consumer.connection.CancellableConsumerConnection$CancellableActionRunner.run(CancellableConsumerConnection.java:99)
    at org.gradle.tooling.internal.consumer.connection.AbstractConsumerConnection.run(AbstractConsumerConnection.java:62)
    at org.gradle.tooling.internal.consumer.connection.ParameterValidatingConsumerConnection.run(ParameterValidatingConsumerConnection.java:53)
    at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter$1.run(DefaultBuildActionExecuter.java:71)
    at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:84)
    at org.gradle.tooling.internal.consumer.connection.CancellableConsumerActionExecutor.run(CancellableConsumerActionExecutor.java:45)
    at org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:58)
    at org.gradle.tooling.internal.consumer.connection.RethrowingErrorsConsumerActionExecutor.run(RethrowingErrorsConsumerActionExecutor.java:38)
    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:55)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
    ... 3 more

java.lang.RuntimeException: org.gradle.tooling.GradleConnectionException: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.4-bin.zip'.
    at com.github.rholder.gradle.dependency.DependencyConversionUtil.loadProjectDependenciesFromModel(DependencyConversionUtil.java:115)
    at com.github.rholder.gradle.intellij.DependencyViewer$1$1.doInBackground(DependencyViewer.java:106)
    at com.github.rholder.gradle.intellij.DependencyViewer$1$1.doInBackground(DependencyViewer.java:103)
    at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at javax.swing.SwingWorker.run(SwingWorker.java:334)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.tooling.GradleConnectionException: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.4-bin.zip'.
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:55)
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
    at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41)
    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
    at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter.run(DefaultBuildActionExecuter.java:60)
    at com.github.rholder.gradle.dependency.DependencyConversionUtil.loadProjectDependenciesFromModel(DependencyConversionUtil.java:109)
    ... 8 more
Caused by: org.gradle.internal.jvm.JavaHomeException: The supplied javaHome seems to be invalid. I cannot find the java executable. Tried location: /Applications/IntelliJ IDEA 2017.3.app/Contents/jdk/Contents/Home/bin/java
    at org.gradle.internal.jvm.Jvm.findExecutable(Jvm.java:130)
    at org.gradle.internal.jvm.Jvm.getJavaExecutable(Jvm.java:151)
    at org.gradle.internal.jvm.Jvm.forHome(Jvm.java:110)
    at org.gradle.launcher.daemon.configuration.DaemonParameters.getEffectiveJavaExecutable(DaemonParameters.java:100)
    at org.gradle.launcher.daemon.client.DefaultDaemonStarter.startDaemon(DefaultDaemonStarter.java:73)
    at org.gradle.launcher.daemon.client.DefaultDaemonConnector.startDaemon(DefaultDaemonConnector.java:109)
    at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connect(DefaultDaemonConnector.java:87)
    at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:117)
    at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:77)
    at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:44)
    at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:31)
    at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:62)
    at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:34)
    at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:113)
    at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:107)
    at org.gradle.tooling.internal.provider.DefaultConnection.run(DefaultConnection.java:186)
    at org.gradle.tooling.internal.consumer.connection.CancellableConsumerConnection$CancellableActionRunner.run(CancellableConsumerConnection.java:99)
    at org.gradle.tooling.internal.consumer.connection.AbstractConsumerConnection.run(AbstractConsumerConnection.java:62)
    at org.gradle.tooling.internal.consumer.connection.ParameterValidatingConsumerConnection.run(ParameterValidatingConsumerConnection.java:53)
    at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter$1.run(DefaultBuildActionExecuter.java:71)
    at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:84)
    at org.gradle.tooling.internal.consumer.connection.CancellableConsumerActionExecutor.run(CancellableConsumerActionExecutor.java:45)
    at org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:58)
    at org.gradle.tooling.internal.consumer.connection.RethrowingErrorsConsumerActionExecutor.run(RethrowingErrorsConsumerActionExecutor.java:38)
    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:55)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
    ... 3 more