Use the following command Will the current python All third-party packages in the environment Export to txt file
pip freeze > requirements.txt
Use the following command to txt Third party packages in files
pip install -r requirements.txt
Environmental Science :python 3.6.8 + jpype1 0.6.3 + jdk 1.8
""" The basic development process is as follows : ①、 Use jpype Turn on jvm ②、 load java class ③、 call java Method ④、 close jvm( Not really closed , Unload the previously loaded class ) """
# ①、 Use jpype Turn on virtual machine ( In the open jvm Before loading the classpath )
# Just loaded jar file
path = r"C:\Users\Administrator\Desktop\my_floder\software_match\software_data\jwtdemo-with-dependencies.jar"
jarpath = os.path.join(os.path.abspath('views'), path)
# obtain jvm.dll File path
jvmPath = jpype.getDefaultJVMPath()
# jvmPath = 'C:/Program Files/Java/jdk1.8.0_291/jre/bin/server/jvm.dll'
# Turn on jvm
jpype.startJVM(jvmPath, "-ea", "-Djava.class.path=%s" % (jarpath))
# ②、 load java class ( Parameter is java Long class name )
javaClass = jpype.JClass("com.it.zty.JwtUtils")
# Instantiation java object
# javaInstance = javaClass()
# ③、 call java Method , Because I write static methods , Methods can be called directly using the class name
user_id = javaClass.getUserId(token)
# ④、 close jvm
jpype.shutdownJVM()
Pay attention to is :python Number of digits and jdk The number of digits must remain the same , Otherwise it will throw
Process finished with exit code -1073741819 (0xC0000005)
Error of .