MAC: Gradle issues with finding/using JDK 7 - the usual answers to this question aren't working. Expert required

Andrew, according to Peter, the java.home is as expected.

I think it could be some snafu with the upgrade to Mavericks or possibly some evil s/w I have installed that has done something to that java setup on the machine.

The Auskey s/w is something java-based that I distrust that I installed - does that mean anything to you?

Steven, I upgraded to maverics as one of the measures to try and fix this problem and it did not.

Perhaps Auskey is a common thread?

I am also deeply mistrusting of using auskey on a Mac. I remember some weird problem with the auskey install putting a non standard bouncy castle jar in some system library directory.

But did install it on this laptop st some point, before giving up and submitting paper activity statements (:slight_smile:

Thanks Thad i dont suppose Auskey means anything to you?

hmmmmmm

Steven, got it working!

I suspect that the auskey install must have dumped a whole lot of junk jar files (some dating back to 2006) into /Library/Java/Extensions. If I move these aside, maven works on the command line and I can finally build apps with Android Studio.

My /Library/Java/Extensions directory contained the following jar files:

Andrews-MacBook-Air:Extensions andrew$ pwd /Library/Java/Extensions Andrews-MacBook-Air:Extensions andrew$ ls -l

-rwxr-xr-x 1 root

admin

368759 31 Aug 2011 DBusJava.jar -rwxrwxrwx 1 andrew staff

233527 14 Aug 2012 KeyStoreBE.jar -rw-r–r-- 1 andrew staff

112185 21 Feb 2006 RXTXcomm.jar -rwxrwxrwx 1 andrew staff

62983 14 Aug 2012 activation.jar -rwxrwxrwx 1 andrew staff

220733 14 Aug 2012 bcmail-jdk15-143.jar -rwxrwxrwx 1 andrew staff

103515 14 Aug 2012 jaxb-api.jar -rwxrwxrwx 1 andrew staff

866992 14 Aug 2012 jaxb-impl.jar -rwxrwxrwx 1 andrew staff

46047 14 Aug 2012 jsr173_1.0_api.jar -rwxr-xr-x 1 andrew staff

326432 21 Feb 2006 librxtxSerial.jnilib -rwxrwxrwx 1 andrew staff

434812 14 Aug 2012 mail.jar -rwxrwxrwx 1 andrew staff 7056159 14 Aug 2012 tools.jar

Removing tools.jar and bcmail-jdk15-143.jar fixed my problem, although I’m tempted to get rid of the lot as I can’t see them doing any good.

Thanks for your help, and I hope the same solution works for you.

Of course I mean that gradle works on the command line (:slight_smile:

FFFFFfffffffffuuuuuuuuuuuuuuuuuuuuuuu

Clearing out the java extentions directory worked.

drwxr-xr-x+ 65 stef staff

2210 6 Jul 10:05 … -rwxrwxrwx

1 stef staff

233527 14 Aug 2012 KeyStoreBE.jar -rwxrwxrwx

1 stef staff

62983 14 Aug 2012 activation.jar -rwxrwxrwx

1 stef staff

103515 14 Aug 2012 jaxb-api.jar -rwxrwxrwx

1 stef staff

866992 14 Aug 2012 jaxb-impl.jar -rwxrwxrwx

1 stef staff

46047 14 Aug 2012 jsr173_1.0_api.jar -rwxrwxrwx

1 stef staff

391834 14 Aug 2012 log4j-1.2.15.jar -rwxrwxrwx

1 stef staff

434812 14 Aug 2012 mail.jar -rwxrwxrwx

1 stef staff 7056159 14 Aug 2012 tools.jar

We have some similarity in a couple of those. Must be effing AUSKEY BS I hate those guys. I dont believe how many hours they have cost me.

So Gradle is picking up some jar from those above and that is messing with its ability to find a JDK.

Thanks for your help Andrew!

The Java runtime will put all those jars on the classpath automatically… likely tools.jar is interfering with the real java tools from the JDK, activation, and jaxb stuff shouldn’t be there either. Generally it’s a bad idea to use the extensions directory. You need to be very careful. Definitely tools.jar should never have been placed there.

What the heck is AUSKEY?

What is AUSKEY?

There were 2,079,666 actively trading businesses in Australia at June 2013, and any of these that want to communicate with the Tax office electronically need to run a carefully crafted piece of software called AUSKEY (:-).

yeeees. “carefully crafted”.

Feel my hate, Australian government IT department.

Had the same problem with Eclipse and Google App Engine - removing those files and restarting Eclipse finally fixed. Thank you Andrew and thank you Steven for not giving up.

Thank you guys - this is a gem that’s so hard to find

“Do you have anything odd set for the GRADLE_OPTS environment variable?”

Thanks for pointing this out; as it helped me realize that my environment $PATH was pointing to a “local” system lib location for gradle (which was very much outdated). Upon further inspection of the Android-Studio directory, specifically in

'$(install_root)/plugins/gradle/lib'

, I noticed the up-to-date gradle version files that android-studio downloads/installs/uses.

BTW: removing the entry from the $PATH environment variable did not resolve the issue with the error; However, after deleting the outdated cache in

$HOME/.gradle/cache/

along with the directories of old gradle versions, the issue was resolved.

Issue ------- Using the eclipse -> gradle -> select task to execute and

error “…cannot find system java compiler…”

Solution -------- Go to the path where your build.gradle path is…and using the cmd manual type gradle build <- this will be work.

Done.

Back to eclipse and execute the gradle task. It will work back!!!