Android studio java_home is not set and no java command could be found in your path.

Android Studio , on windows : JAVA_HOME is not set and no java command could be found in your PATH

Questions : Android Studio , on windows : JAVA_HOME is not set and no java command could be found in your PATH

2022-08-02T02:07:47+00:00 2022-08-02T02:07:47+00:00

2932

I am trying to build my Android app on the anycodings_android command line using Gradle commands. On anycodings_android executing the .gradlew build I am getting anycodings_android the error below:

ERROR: JAVA_HOME is not set and no 'java' anycodings_android command could be found in your PATH.

Please set the JAVA_HOME variable in your anycodings_android environment to match the location of your anycodings_android Java installation.

but I think I have already set the JAVA_HOME anycodings_android Path. If I echo %JAVA_HOME% in a separate anycodings_android cmd.exe window I get:

C:\Program Files\Android\Android Studio\jre

I have to point the JAVA_HOME to the JRE anycodings_android provided by Android and not the system Java, anycodings_android right?

Also, when I run the java command, it shows

'java' is not recognized as an internal or anycodings_android external command, operable program or a anycodings_android batch file

java -version java version "1.8.0_271" Java(TM) SE Runtime Environment (build 1.8.0_271-b09) Java HotSpot(TM) Client VM (build 25.271-b09, mixed mode, sharing)

Please clarify?

Total Answers 2

29

Answers 1 : of Android Studio , on windows : JAVA_HOME is not set and no java command could be found in your PATH

PATH environment variable must indicate anycodings_android to the \bin directory of your JAVA_HOME, anycodings_android for example they should look like this:

JAVA_HOME: "C:\Program anycodings_android Files\Java\jdk1.8.0_301" PATH: anycodings_android "C:\Program Files\Java\jdk1.8.0_301\bin"

Note that the PATH variable has other anycodings_android values too and you must append your anycodings_android value to it.

0

2022-08-02T02:07:47+00:00 2022-08-02T02:07:47+00:00Answer Link

mRahman

3

Answers 2 : of Android Studio , on windows : JAVA_HOME is not set and no java command could be found in your PATH

I understood your problem, add your JDK anycodings_android (Not JRE) path to the PATH variable in anycodings_android environment variables. Then run the java anycodings_android command, and it should run. And whenever anycodings_android you post a question, please do make sure anycodings_android that you mention details like what anycodings_android happens when you run java command :)

0

2022-08-02T02:07:47+00:00 2022-08-02T02:07:47+00:00Answer Link

jidam

반응형

ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

유니티 설치할 때 기본 포함된 SDK외 추가적으로 뭔가가 더 필요하면(더 많은  API Level을 요구한다든지)  유니티에서 자동으로 SDK를 추가 다운로드를 하는데 기존에 환경변수를 셋팅해놓은 PC에서는 괜찮겠지만 환경변수를 셋팅하지 않은 PC에서는 이런 에러가 뜨는 것 같다.

Android studio java_home is not set and no java command could be found in your path.

따로 JDK를 설치하지 않고 Unity 설치할 때 포함된 Open JDK의 경로를 알아보기 위해

유니티 에디터에서 Edit > Preferences > External Tools 의 Copy Path 버튼을 클릭해준다

Android studio java_home is not set and no java command could be found in your path.
Android studio java_home is not set and no java command could be found in your path.
Android studio java_home is not set and no java command could be found in your path.

반응형

방금 복사한 경로를 가지고 환경변수를 셋팅하러 가보자.

윈도우 탐색기에서 내PC 우클릭 > 속성

Android studio java_home is not set and no java command could be found in your path.

우측 고급 시스템 설정 클릭

Android studio java_home is not set and no java command could be found in your path.

환경 변수 클릭

Android studio java_home is not set and no java command could be found in your path.

사용자 변수와 시스템 변수가 있는데 시스템 변수에 만들었다. 각자 본인의 상황에 맞게

새로 만들기 버튼 클릭

Android studio java_home is not set and no java command could be found in your path.

먼저 JAVA_HOME 변수를 만들어 주고 변수 값에다가 아까 복사한 경로를 붙여넣기 후 확인버튼 클릭

Android studio java_home is not set and no java command could be found in your path.

시스템 변수 JAVA_HOME 이 생겼다

Android studio java_home is not set and no java command could be found in your path.

그리고 Path를 선택 후 편집버튼 클릭

Android studio java_home is not set and no java command could be found in your path.

새로 만들기 버튼 클릭

Android studio java_home is not set and no java command could be found in your path.

%JAVA_HOME%\bin 을 입력 후 확인버튼 클릭

Android studio java_home is not set and no java command could be found in your path.

명령 프롬프트창을 열어서 

java -version 명령어를 쳤을 때 버전이 뜨면 정상이다.

컴퓨터 재부팅을 하지 않고 하는 방법도 있지만 버전 확있은 됐는데 다른 게 잘 안돼서 그냥 재부팅하니까 잘됐다

재부팅 하고 유니티 에디터 실행 후 다시 빌드 하면 필요한 SDK 자동으로 다운로드 후 빌드 잘 됨.

두더지게임: 리그 오브 두더지, 게임쿠폰

구글플레이스토어 쿠폰사용 O, 앱스토어 쿠폰사용 X (앱스토어 정책상) 10만골드 가족 20만골드 건강 30만골드 자유 40만골드 행복하자 50만골드 아프지말고 젤리툰 웹툰 소재 전문 사이트 젤리툰

ssscool.tistory.com

Android studio java_home is not set and no java command could be found in your path.

[무료게임쿠폰] 뽑기키우기게임이라 쓰고 이세계 가서 몬스터 때려잡아서 레벨업 후 사차원가서

[무료게임쿠폰] 뽑기키우기게임이라 쓰고 이세계 가서 몬스터 때려잡아서 레벨업 후 사차원가서 짱먹기 라고 읽는다. 다이아 100개 쿠폰 테슬라 다이아 200개 쿠폰 건강 다이아 300개 쿠폰 부자 다

ssscool.tistory.com

Android studio java_home is not set and no java command could be found in your path.
Android studio java_home is not set and no java command could be found in your path.

반응형

저작자표시비영리동일조건

'Unity' 카테고리의 다른 글

[ 기초 ] Unity TextMeshPro - Text (UI) 에 Text 넣기  (0) 2022.06.21
An error occurred while resolving packages: Project has invalid dependencies: com.google.external-dependency-manager: Package [] cannot be found  (0) 2022.06.01
ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.  (0) 2022.05.26
유니티 WWW 대신 UnityWebRequest 사용하기 class UnityEngine.WWW deprecated  (2) 2022.05.09
유니티 에디터에서는 되는데 안드로이드 디바이스에서 파일 관련 동작 안 될 때 unity curl error 7: failed to connect to localhost port 80: connection refused It works in the Unity editor, but the file-related operation does n..  (2) 2022.05.09
유니티 NGUI 사용 프로젝트에서 런타임에서 스크린샷 캡쳐 생성후 PNG 저장 및 Texture2D로 불러오기 (Unity After creating screenshot capture at runtime in NGUI-using project, save PNG and load as Texture2D)  (0) 2022.04.26