Tag Archives: jdk

How to Solve Vue3 jweixin-module Error

Use in vue3:

var jweixin = require('jweixin-module');

It will be compiled with the error: require is not defined, there is no require module, change to import, because jweixin-module does not support export writing, so the introduction can not succeed.

Solution:
Use a third-party wrapper jdk: weixin-js-sdk

npm install weixin-js-sdk -S

import jweixin from 'weixin-js-sdk'

[Solved] Linux java -jar Start Project Error: Unsupported major.minor version 52.0

The error information is as follows:

Caused by inconsistent JDK environment

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/springframework/boot/loader/JarLauncher : Unsupported major.minor version 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

Solution:

First, download the appropriate JDK on the Linux server. I have re downloaded JDK1.8, and the original 1.7 has been installed

Start command:

To find the installation directory of JDK, start the project through the corresponding version of JDK

  nohup /usr/local/jdk8/bin/java -jar -Dspring.profiles.active=test read.jar &

Android 8.1 compilation error Jack server problem

Compile Android 8.1 and report errors related to Jack server
Jack server is an Android source code compilation tool. Used in Android 6.0 ~ Android 8.1 source code. Later versions are obsolete.

Error type 1:
communication error with Jack server (58), try ‘Jack diagnosis’ or see Jack server log
failed to contact Jack server: problem reading/home/user3 /. Jack server/client.pem. Try’ Jack diagnosis’

Error type 2:
Jack server failed to (RE) start, try ‘Jack diagnose’ or see Jack server log

Solution 1:

Open ~ /. Jack settings and ~ /. Jcak server/config.properties to change to other port numbers. Like 8976/8977
note that the two corresponding port numbers in the two files should be consistent


idea 2:
delete ~ /. Jack settings and ~ /. Jcak server/config.properties and recompile

Idea 3: JDK version problem
in my practice, openjdk1.8.0.292 will report that the port is occupied
the test method runs./prebuilds/SDK/tools/Jack diagnosis
printing the log will prompt that the port is occupied. For other unused ports, this is still the case
the solution is to use the JDK provided with the Android source code. Path: prebuilds/JDK/
you can also download other versions of openjdk, such as 1.8.0.141
uninstall the server JDK,
remove the openjdk (if installed). First, check which openjdk package is installed.

dpkg –list | grep -i jdk

To remove the openjdk package:

apt-get purge openjdk*

Check that all openjdk packages have been uninstalled:

dpkg –list | grep -i jdk

Configure the Android directory JDK to ~ /. Bashrc

export JAVA_ Home = {absolute path of your own Android source code} prebuilds/JDK/jdk8/Linux x86
export JRE_ HOME=

J

A

V

A

H

O

M

E

/

j

r

e

e

x

p

o

r

t

C

L

A

S

S

P

A

T

H

=

.

:

{JAVA_ HOME}/jre export CLASSPATH=.:

JAVAH​OME/jreexportCLASSPATH=.:{JAVA_ HOME}/lib:

J

R

E

H

O

M

E

/

l

i

b

e

x

p

o

r

t

P

A

T

H

=

.

:

{JRE_ HOME}/lib export PATH=.:

JREH​OME/libexportPATH=.:{JAVA_ HOME}/bin:$PATH

Effective changes:
source ~ /. Bashrc
recompile.

[Solved] JDK Install Error /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

CentOS 7.6 JDK installation, download the following JDK package

wget https://mirrors.huaweicloud.com/java/jdk/8u201-b09/jdk-8u201-linux-i586.tar.gz

After installation. After configuring environment variables, execute Java – version to report an error

-bash: /root/jdk1.8.0_201/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory


Solution
Just run sudo yum install glibc.i686
Then look at java -version OK!

Error in compiling Android AOSP by Ubantu [How to Solve]

Error:

You asked for an OpenJDK 7 build but your version is

java version “1.7.0_75” Java(TM) SE Runtime Environment (build 1.7.0_75-b13) Java HotSpot(TM) 64-Bit Server VM (build 24.75-b04, mixed mode).

Reason:

AOSP (Android Open Source Project)
) Compilation requires openjdk, not oracle’s JDK version

This environment version.

Versions that can be compiled.

Solution to error reporting in Java @ override

 
Sometimes when the eclipse project of Java is compiled on a different computer, the @ override always reports an error. Just remove the @ override, but it can’t fundamentally solve the problem, because sometimes there are too many @ override places.

This is a problem with JDK. We already have @ override for jdk5, but we don’t support the implementation of the interface. We think it’s not override and report an error. JDK6 fixed this bug. You can add @ override to both the method coverage of the parent class and the implementation of the interface.

To solve this problem, first make sure that JDK 1.6 is installed on the machine,

Then, select the eclipse menu windows – & gt; Preferences–> java-> Compiler–> Select 1.6 for compiler compliance level, refresh the project and recompile.

If the problem is not solved, right-click the project that reported the error and select properties — & gt; Java Compiler–> Select 1.6 from compiler compliance level to refresh the project and recompile.

 

[error record] invalid gradle JDK configuration found

Contents of articles

1、 2. Solutions

1、 Error information


Android studio compile time prompt

Invalid Gradle JDK configuration found

Mistakes;

2、 Solutions


Right click the project root directory in the project panel and select the “open module settings” option,

In the “SDK location” panel of the “project structure” dialog box, switch the setting of “JDK location”;

There are two options to set, one is the default JDK path of the system, and the other is the default JDK path of Android studio. Just switch it;

Report error when using microwave “must either be declared abstract” abstract method “getWXPayDomain()” in WXPayConfig

report errors:

Handler dispatch failed; nested exception is java.lang.AbstractMethodError:“must either be declared abstract   abstract method ‘getWXPayDomain()’ in ‘WXPayConfig

The payment can not work normally

 
 
solve:

You need to download the Java version of the SDK package officially, and then open the wxpayconfig file

Add a public to all the abstract methods, and then package and install them locally to solve the problem

 
 
After watching, Congratulations, I know a little more!!!

The more you know, the more you don’t know!  
~ Thank you for reading,   Your support is the biggest motivation for my study!   come on.  , Strangers work together and encourage each other!!

Note: if there is any improvement or mistake in this article, you are welcome to specify one or two~~

The solution of a Java exception has occurred. And error exception in thread when eclipse runs

This problem is caused by a Java class file compiled by a higher version of JDK trying to run on a lower version of JVM.

1. The solution is to ensure that the versions of JVM (Java command) and JDK (javac command) are consistent. If it is the Linux version, enter the Java – version and javac – version commands in the command line to see if the versions are consistent. I use 1.7.0_ 80。

 

2. The same version still can’t solve the problem. I don’t compile with javac directly from the command line, but with eclipse compiler. Because many compilers come with javac, rather than using the compiler in the operating system. If your compiler is eclipse, you need to set the JDK version in the properties of the project. The method is to right-click the project — & gt; properties — & gt; Java compiler — & gt; enable project specific settings — & gt; and set the compiler compliance level to 1.7, which is the version consistent with the JVM (the version shown by Java – version in the command line). Because of the need to be compatible with other software before, I reduced the Java version from 1.8 to 1.7, but eclipse did not move, so after opening it, I found that the default was 1.8, so I manually reduced it to 1.7, recompiled it, and finally passed!

 

To sum up, if you are compiling with a compiler, make sure that the JDK version of the compiler is consistent with the Java version of the operating system.

The screenshot is as follows: