简体   繁体   中英

Incorrect slashes in java path

I am trying to run unit tests for an Android application using Robolectric, via Android Studio. However, whenever I run the tests I get the following error:

A problem occurred starting process 'command 'C:\\Program Files\\Java\\jre1.8.0_60/bin/javac''

Notice that the path uses backslashes for the first half, and forward slashes for the second half. I'm running Windows 8, so I believe these the forward slashes are the cause of the issue. However, I'm unable to find where these slashes are coming from.

I've run these tests on another Windows 8 computer, and they work there, so I'm convinced it's a local issue. I've checked all locations I can think of which might be define this path - Gradle files, system environment variables, Android Studio project settings - and they're all using the correct (back) slashes. I've also tried reinstalling Java and Android Studio, and deleting and replacing my local copy of the project, but no luck.

Where else should I check, or what else should I try?

Edit I was using jre1.8.0_65 but had the path set to _60. This has been corrected, but I still get the same error (now referring to _65).

The error seems to indicate that AndroidStudio is trying find the javac.exe file in the jre's bin folder. jre/bin folders does not contain the javac.exe file, jdk/bin does. So I'm guessing you incorrectly setup the environment variable. Posting them would help fix the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM