Tag Archives: jdk

Exec format error: Java

welcome to my blog

Problem Description: decompress the jdk8 installation package, configure the environment variables, execute the Java command, and report an error: exec format error: Java

Reason: I didn’t look carefully when downloading the compressed package. As a result, the download is wrong. The download is ARM architecture, and the Ubuntu/Linux I use is x64 architecture

Download the correct compressed package and re operate

Keytool error: java.io.FileNotFoundException : MyAndroidKey.keystore (access denied)

This is the problem I encountered when I used java keytool to generate certificates this afternoon

Cause error:

Keytool error: java.io.FileNotFoundException : MyAndroidKey.keystore (access denied)

Analyze the problem:

When the certificate is generated, the permissions are not enough when writing to disk C. The properties of all the directories under C disk are read-only.

terms of settlement:

Method 1:
the path of JDK is in disk C. you can move JDK to other disk letters.
Method 2:
this method is the simplest to open CMD as an administrator, so that the error will not occur when writing something.

Error running ‘xxxapplication’: no JDK for module ‘xxx’

When I was running the project today, I suddenly found that the project that had been well before could not be started. An error was reported

Error running ‘XXXApplication’: No jdk for module ‘XXX’

Normally, JDK is set in file – & gt; project structure, and there is no problem after checking

Later, after several twists and turns, through a direct search of JDK in settings, we found that there was such a place

The arrow points to the current state. Change this to the normal 1.8, and the project can run happily

 

JDK disable tlsv1.0

Some web servers need to disable some protocols after deployment. Let’s take tlsv1.0 as an example to talk about how to disable them.

Find the JRE directory in your JDK installation directory and JRE/lib/security in the JRE directory/ java.security File, and then in the file

jdk.tls.disabledAlgorithms=SSLv3 , RC4, md5withrsa, DH keysize & lt; 768, add tlsv1.0.

Access restriction in Eclipse: the type ‘xxx’ is not API solution

To report this error, you only need to change the JRE under the JDK path to an external JRE

Project – & gt; properties – & gt; Java build path – & gt; libraries, select JRE system library, and then remove. Then click Add Library – & gt; JRE system library – & gt; next, select alternate JRE, click installed jres, select JRE under the same level directory of JDK, and then click Apply – & gt; OK.

Learn about the role of two jres in Java: (the following is from http://blog.sina.com.cn/s/blog_ 7ffb8dd501011 sgc.html )

1. In the bin directory of JDK java.exe With external JRE java.exe The secret of
JDK java.exe And in JRE java.exe In fact, it’s the same, but we use external JRE in priority when running java.exe (even if we install JDK and configure environment variables).
first of all, let’s see what happened during the installation of JDK:
when installing JDK, you will install a JRE under its subdirectory. At the same time, you will be asked whether you want to install an external JRE during the installation process. If we choose to install, we have two jres at the same time. In fact, there is no difference between the two jres. The main difference is that the JRE in the JDK directory is mainly designed to run the tools that come with JDK (under the bin directory). The external JRE will automatically register to the path of the operating system when it is installed (but the path value of the command is not included in the path in my computer, properties, advanced system settings, environment variables and system variables). In general, it is in the system32 folder (the folder contains: java.exe javaw.exe javaws.exe Three files). Therefore, as long as we install external JRE (even if JDK is not installed and environment variables are not configured), we will use external JRE when running Java programs java.exe Program (even if JDK is installed and environment variables are configured) (the default path of the system has priority).  

2.
in short, JDK is an SDK for developers. SDK is a software development kit, which generally refers to software development kit, including function library, compiler, etc.
JDK (java development kit) provides java development environment and running environment, which is mainly used to develop java programs for Java program developers;
JRE (Java runtime environment) provides Java running environment, which is mainly used to execute Java programs for Java program users.
generally, each JDK contains two sets of jres. With JDK jdk1.6.0_ 22 (the default installation path is e: / / program files / Java), for example, in E: / / program files / Java / jdk1.6.0_ There is a JRE in the directory of 22, and there is also a JRE in the directory of C: program files. Why are there two jres? Because the tools in JDK are also written in Java, they also need a set of JRE when they are running, that is, e: \ “program files \” Java \ “jdk1.6.0_ 22 \ \ JRE under the directory. The JRE in the directory e: program files: Java is used to execute our own Java program. Of course, any one of the two sets of jres can be used to execute our own Java programs, but the tools in JDK can only be used by E: / / program files / Java / jdk1.6.0_ 22 \ \ directory.
since there are at least two sets of jres in our computers (if Borland JBuilder and other advanced development tools are installed, there will be more sets of jres in our computers), who will decide which set of jres to use? The burden falls on us java.exe On my body. (of course, when JDK is installed in 1, the external JRE is executed by default!)
when we enter:
java XXX
on the command line, java.exe Our task is to find the right JRE to execute XXX among the many jres on our computer. java.exe Search for jres in the following order:
(1) whether there is a JRE directory in your own directory;
(2) whether there is a JRE directory in your parent directory;
(3) query the registry HKEY_ LOCAL_ Machine / software / javasoft / Java runtime environment java.exe What is the difference between the results of the implementation and those in our computer java.exe (a search will reveal that there is more than one in our computer java.exe )It has a lot to do with the execution and which JRE will execute the JVA program.
in addition, java.exe After finding the right JRE, there is a verification version of the program, that is java.exe It can only be executed if it is consistent with the JRE version. If there is a version inconsistency problem, we must remember two things:
(1) which one java.exe Executed;
(2) java.exe Find out which JRE.
as long as these two things are determined, we will grasp the whole process of the problem and solve it easily.
3,
JVM (Java virtual machine) is a part of JRE, and JRE is the supplement of JVM. So where is the JVM? We can open C: / / program files / Java / JDK1.5. X / JRE / bin to see two directories: client and server. You can see them in these two directories jvm.dll This is what we call the JVM.

Error loading in flex integration: Java / jdk1.6.0_ 35\jre\bin\server\ jvm.dll

Error loading: \ Java \ jdk1.6.0 _35 \ jre \ bin \ server \ JVM DLL

Error :
complie:
[exec] Error loading: D:\Program Files\Java\jdk1.6.0_35\jre\bin\server\ jvvm. DLL
[exec] Result: 6
Because flash builder is based on eclipse and eclipse is using Java technology and Java needs jre
to run and flash builder needs to run on a 32-bit jre if we have Java installed on 64 then this error will occur

solution
1. Download and install 32 jre
2. Edit FLEX_HOME\bin\jvm.config file and set java.home
for example :
#java.home=
java.home=D:/Program Files/Java/jre6-32

note :FLEX_HOME refers to flex SDK directory, such as D:\Program Files\Adobe Flash Builder 4.6\ SDKS \4.6.0

After compiling. Java, the following appears: Note:checkUser.java uses unchecked or unsafe operations.Note :Recompile with -Xlint :unchecked for details.

 

If it is shown in Chinese, it means:
Note: A.java USES unchecked or unsafe operations.
Note: For details, use -Xlint: Unchecked recompile.
JAVA5.0 generics are used, but the 5.0 generics do not do type checking. For example, ArrayList a =new ArrayList();
a.add(“hello”); There are several solutions to this warning:
1) Prefix a method with @Suppresswarnings (“unchecked”)
2) declare generic types, such as ArrayList< Object> A = new ArrayList< Object> (a);
3) Compile with 1.4 COMPATIBLE JDK, Javac-Source 1.4 test.java
4) You can also view warning messages like Javac Xlint: Unchecked test.java. This will display the detailed warning information

“Error: a JNI error has occurred” and “error of” jvm.cfg To solve the problem

Today in the CMD environment

java Helloworld.java
javac Helloworld

If it doesn’t work, it shows up

Exception in thread "main" java.lang.UnsupportedClassVersionError: helloworld has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Error message.
after thinking about it, I probably made a java8 environment by playing mine craft before. Later, I downloaded and installed jdk13 for development, which caused the problems caused by the difference between javac and Java version.
then reset JAVA_HOME to C:\Program Files\Java\jdk-13 should be solved.
when something weird happens, still report this error. In a rage, I deleted
and reported an error after I deleted
directory which caused the conflict

Error: could not open `C:\Program Files\Java\jre1.8.0_201\lib\amd64\jvm.cfg

The problem should be clear, because I don’t know which environment variable is still pointing to this folder, I find the same problem in stackoverflow, where Jason Hughes mentioned that this guideline exists in C:\Program Files\Common Files\oracle\ folder, (my word is C:\Program Files(x86)\Common Files\oracle\), delete the directory directly and restart once it comes.
problem solved.

Bug001: error in gradle configuration environment variable: ERROR:JAVA_ Home is set to an invalid directory!

Gradle-v error: Error: Java_home is set to an invalid Directory :C:\Java\jdk1.8.0_05
please set the java_home variable in you environment to match the location of your java installation.
On the Internet turned over again, some people said more than a semicolon, some people said to change this change that, I erase, others try it, My zha change is not in, is really angry evil old man!
Look at the picture first:


But when I looked up, My eyes were fixed on it!

Vonema, how did you automatically leave out the “Program Files “?

Then Windows+R, CMD, gradle-V, and sure enough! Problem solved smoothly!!

 

Error: could not find java.dll Error: could not find Java se runtime environment solution

DLL Error: could not find Java SE Runtime Environment
As title.
my situation is more complicated, and this is just a problem I had when reconfiguring Java environment variables.
My computer was originally configured with the latest JDK13, and the environment variables were set according to JDK13. Later JDK10 and JDK1.8 were downloaded for course reasons
Writing Java using Intellij Idea all the time has not been a problem. But a few days ago on a whim, I wrote a small program to run on the command line, and something went wrong
1. Javac conflicts with Java commands
It’s an error saying that the.class file I compiled with Javac is different from the version of the Java command that followed me. I checked the following with the -version command. My Javac is JDK13, and Java is a mix of JDK10 and 13.
because currently JDK10 is useless, it is removed, resulting in javac and Java command all die.
considering recent course requirements, we decided to simply reconfigure the JDK1.8 environment variable
2. Javac-version is not working properly
After resetting path and so on in accordance with the same configuration method, Java command reported the error as shown in the question, and JavAC was also not good. I searched for a circle on the Internet and finally had no choice but to restart the computer. The result javAC was actually normal, but Java was still abnormal
3. Java Error: could not find Java Runtime Environment
First we open the environment variable (just search “edit environment variable” by Corna on Win10)

We noticed that the path variable has an extra C:\Program Files(x86)\Common Files\Oracle… When executing Java commands on the command line, the default is to execute this Java first instead of adding our own %Java_Home%\bin, etc., so we need to put this added variable in front of the Oracle variable.
The problem is that I always end up with double quotes in front of the variable path, and the command line test still doesn’t work.
Continue searching and find someone said to change the java.exe in the System32 path, just rename it, but there is no Java.exe in my System32 path
Exe

as shown in the figure, j.xe
command line test successful!

After the

To the brothers who encountered simple bind failed 192.168.1.×××: 636

Last time I wrote an article about changing passwords for LDAP users (mainly referring to the other two articles), I noticed a strange phenomenon. The AD server I developed and used is three in one with my own WEB server and certificate server. The password can be successfully changed as described above. The program was packaged into a WAR package and tested on the servers on the 6th floor, 15th floor and 16th floor. They both used a single AD, WEB server and certificate server in one. Both the 6th and 15th floors could normally change the user password of the CONNECTED AD, but the 16th floor did not work. The IP:636 error of simple Bind failed AD was reported all the time, which depressed me very much. Had to search on the net, in the middle because of other task intermittent for a period of time, looked for a few weeks on and off, there is no enable SSL, there is said to be “do not support SSL”, there is said to be your simple binding error (this is nonsense), is not a definite answer. Join several communication groups of LDAP, waffled for a long time, also no solution. During this period, the AD configured by the WEB application on the 15th floor was replaced by another one, but this error also occurred. I found another machine to configure again, but the same error occurred. Xj installed WIN2003 machine, let me test, the same mistake, original WEB applications can be installed on your machine normal change passwords, then even sometimes can’t change, can change sometimes, fifteenth floor originally that one cannot change the password, suddenly can change the password again yesterday afternoon, I asked others, making sure that no one is changed AD or WEB set, same application, the same configuration, perform the same function, can downs about it, that day is my most depressing day. This morning on a sudden impulse, the certificate again guided, the result changed the password successfully. Steps (omit the installation of the certificate service, see the previous section) : 1. Select “Start -& GT; “Run”, enter MMC, enter the console, select “Add Certificate Management Unit” menu item, as before, select “Personal -& GT; After “Certificates”, select the certificate you previously created in the Certificate Services section, and then “All Tasks -& GT; Export “, re-export to a new CER file, and then “start-run-& gt; CMD “into the console, use the CD command to switch to the WEB application under JDK bin directory, enter the command:” the keytool – import – keystore certificate. The keystore file – cer file path “, and to import a new certificate, when we enter the JDK bin directory to be able to see your new name the name extension keystore file, and then set the change password when the certificate path of change to just generate the certificate file path. After restarting the server, test the password change function again, and you’re done. Then I followed suit and did the same on the 14 machine, and the 14 machine was able to change the password successfully. Is too great. I don’t know if this is the exact solution to the simple Bind failure (or did it just happen to cause me to change a setting on my system?). But if any of your brothers have the same problem, try reimporting the certificate and you might be able to fix the problem.