Java jdk tools jar

Не удалось найти tools.jar. Пожалуйста, проверьте, что C: \ Program Files \ Java \ jre1.8.0_151 содержит правильную установку JDK

Несмотря на то, что я вручную настроил файл структуры проекта JDK /структуру проекта, он все еще показывает эту ошибку. FAILURE: Build failed с исключением. «Что пошло не так: Execution failed for task»: sample: compileReleaseJavaWithJavac ‘.

Не удалось найти tools.jar. Убедитесь, что C:\Program Files\Java\jre1.8.0_151 содержит действительную установку JDK. ‘

Каково текущее значение переменной среды JAVA_HOME ? И выше ли JRE в вашем PATH ? Зачем даже устанавливать JRE (JDK включает один)?

Это не отвечает ни на один из моих трех разных вопросов. Также c:/windows/program Files/ ? Уверены ли вы?

i.stack.imgur.com/VxQ2W.jpg , а для второго JRE такой же, как упомянуто в терминале C: \ Program Files \ Java — это мой каталог, в котором остается JDK, по умолчанию в Android-студии этот каталог был настроен в моей студии C: \ Program Files \ Android \ Android Studio \ jre

Для JAVA_HOME это C: \ Users \ viswesvar> echo% JAVA_HOME%% JAVA_HOME% Для echo% JAVA_HOME% C: \ ProgramData \ Oracle \ Java \ javapath; C: \ Program Files

6 ответов

Наконец, здесь я нашел решение.

Я добавил путь org.gradle.java.home=C:\\Program Files\\Java\\jdk1.8.0_144 в файл gradle.properties и выполнил перестройку. Это работает сейчас.

Читайте также:  Stdin stdout python это

Это работает как шарм. Файл gradle.properties находится в корневом каталоге проекта. Если нет, создайте новый файл gradle.properties. Для Windows это сработало. Org.gradle.java.home = C: \\ Program Files \\ Java \\ jdk1.8.0_171

ERROR: Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_121 contains a valid JDK installation 

Скопируйте tools.jar из C:\Program Files\Java\jdk1.8.0_121\lib в C:\Program Files\Java\jre1.8\lib .

Я только что обновил свою Android Studio с версии 3.2 до версии 3.3, а затем столкнулся с этой проблемой. После нескольких часов поиска в Google ваше решение, наконец, помогло мне. Спасибо!

Попробовав так много решений (смена редакторов, установка новых плагинов . ), это решило мою проблему, спасибо.

Просто это случилось со мной.

По-видимому, Java-программа обновления автоматически установила и настроила новую версию JRE для меня, оставив старый JDK неповрежденным. Поэтому, даже несмотря на то, что у меня был JDK, он не соответствовал текущей «активной» JRE, которая вызывала ошибку.

Загрузите соответствующую версию JDK в JRE, который вы сейчас установили (в случае OP 151). Это должно сделать трюк.

Источник

3 JDK and JRE File Structure

This chapter introduces the JDK directories and the files they contain. The file structure of the JRE is identical to the structure of the jre directory in the JDK.

This chapter covers the following topics:

Demos and Samples

Demos and samples that show you how to program for the Java platform are available as a separate download at Java Downloads.

Development Files and Directories

This section describes the most important files and directories required to develop applications for the Java platform. Some of the directories that are not required include Java source code and C header files. See Additional Files and Directories.

jdk1.8.0 bin java* javac* javap* javah* javadoc* lib tools.jar dt.jar jre bin java* lib applet ext jfxrt.jar localdata.jar fonts security sparc server client rt.jar charsets.jar

Assuming the JDK software is installed at /jdk1.8.0 , here are some of the most important directories:

Root directory of the JDK software installation. Contains copyright, license, and README files. Also contains src.zip , the archive of source code for the Java platform.

Executables for all the development tools contained in the JDK. The PATH environment variable should contain an entry for this directory.

Files used by the development tools. Includes tools.jar , which contains non-core classes for support of the tools and utilities in the JDK. Also includes dt.jar , the DesignTime archive of BeanInfo files that tell interactive development environments (IDEs) how to display the Java components and how to let the developer customize them for an application.

Root directory of the Java Runtime Environment (JRE) used by the JDK development tools. The runtime environment is an implementation of the Java platform. This is the directory referred to by the java.home system property.

Executable files for tools and libraries used by the Java platform. The executable files are identical to files in /jdk1.8.0/bin . The java launcher tool serves as an application launcher. This directory does not need to be in the PATH environment variable.

Code libraries, property settings, and resource files used by the JRE. For example rt.jar contains the bootstrap classes, which are the run time classes that comprise the Java platform core API, and charsets.jar contains the character-conversion classes. Aside from the ext subdirectory, there are several additional resource subdirectories not described here.

Default installation directory for extensions to the Java platform. This is where the JavaHelp JAR file goes when it is installed, for example. This directory includes the jfxrt.jar file, which contains the JavaFX runtime libraries and the localedata.jar file, which contains the locale data for the java.text and java.util packages. See The Extension Mechanism.

Contains files used for security management. These include the security policy java.policy and security properties java.security files.

JAR files that contain support classes for applets can be placed in the lib/applet/ directory. This reduces startup time for large applets by allowing applet classes to be preloaded from the local file system by the applet class loader and provides the same protections as though they had been downloaded over the Internet.

Font files used by the platform.

Additional Files and Directories

This section describes the directory structure for Java source code, C header files, and other additional directories and files.

jdk1.8.0 include man src.zip

Archive that contains the source code for the Java platform.

C-language header files that support native-code programming with various libraries including:

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_221 contains a valid JDK installation. #575

Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_221 contains a valid JDK installation. #575

Comments

When running the following command:

`:versionTxt
:compileJava FAILED

FAILURE: Build failed with an exception.

Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_221 contains a valid JDK installation.

  • Try:
    Run with —stacktrace option to get the stack trace. Run with —info or —debug option to get more log output. Run with —scan to get full insights.
  • Get more help at https://help.gradle.org

BUILD FAILED in 13s
2 actionable tasks: 2 executed`

The text was updated successfully, but these errors were encountered:

@dikokob, I had the same problem. I just had to modify my JAVA_HOME to point to the jdk instead of the jre:
SET JAVA_HOME=C:\Program Files\Java\jdk-12.0.2

JRE is the Java Runtime Environment, it does not include a compiler.

You need the JDK: Java Development Kit.

You can install a JDK from a lot of sources. Here is one: https://adoptopenjdk.net

this fixed my android build after and up grade to bug sur — just in case someone is looking for this answer

I have jdk 1.8, for making 1.8.9 mods, but build fail too for
«Execution failed for task ‘:compileJava’.
Could not find tools.jar»
I have JAVA_HOME(C:\Program Files\Java\jdk1.8.0_281), I edited Path to add «%JAVA_HOME%\lib» but it always do that 🙁

Launching lib\main.dart on Android SDK built for x86 in debug mode. Running Gradle task 'assembleDebug'. Parameter format not correct - FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:validateSigningDebug'. > java.util.concurrent.ExecutionException: com.android.builder.utils.SynchronizedFile$ActionExecutionException: java.io.IOException: com.android.ide.common.signing.KeytoolException: Failed to create keystore. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 2m 1s Exception: Gradle task assembleDebug failed with exit code 1 

@dikokob, I had the same problem. I just had to modify my JAVA_HOME to point to the jdk instead of the jre: SET JAVA_HOME=C:\Program Files\Java\jdk-12.0.2

To Solve ERROR: Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_151 contains a valid JDK installation Error You Just need to add java home JDK path in gradle.properties Just like this: org.gradle.java.home=C:\Program Files\Java\jdk1.8.0_144 Then try to rebuild project. Now your error must be solved. Second solution is You just need to add tools.jar file to C:\Program Files\Java\jre1.8\lib this Path. First of all Copy tools.jar file from C:\Program Files\Java\jdk1.8.0_121\lib and then Paste in C:\Program Files\Java\jre1.8\lib Here. Now your error must be solved

jdk1.8 does not contained the tools.jar file go to the other versions.

jdk1.8 does not contained the tools.jar file go to the other versions.

can u tell me how to do that?

To Solve ERROR: Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_151 contains a valid JDK installation Error You Just need to add java home JDK path in gradle.properties Just like this: org.gradle.java.home=C:\Program Files\Java\jdk1.8.0_144 Then try to rebuild project. Now your error must be solved. Second solution is You just need to add tools.jar file to C:\Program Files\Java\jre1.8\lib this Path. First of all Copy tools.jar file from C:\Program Files\Java\jdk1.8.0_121\lib and then Paste in C:\Program Files\Java\jre1.8\lib Here. Now your error must be solved

but there is no tools.jar file.Can u please help me am trying to solve this error from 2 days

Источник

Оцените статью