# -*- coding: utf-8 -*-
import jpype
import os.path
jarpath = os.path.join(os.path.abspath('.'), 'axja')
print("=====>jarpath: " , jarpath)
# jpype=startJVM("D:/devsoft/ultimate/env/jdk/jdk7/Java17017/jre7/bin/server/jvm.dll", "-ea", "-Djava.class.path=%s" % ('D:/pyspace/pyChapter1/test/axja/TesCrypt.jar'))
# startJVM("D:/devsoft/ultimate/env/jdk/jdk7/Java17017/jre7/bin/server/jvm.dll", "-ea", "-Djava.class.path=%s" % (jarpath + 'TesCrypt.jar'))
# startJVM("D:/devsoft/ultimate/env/jdk/jdk7/Java17017/jre7/bin/server/jvm.dll", "-ea")
# startJVM(getDefaultJVMPath(),"-ea", "-Djava.class.path=%s" % (jarpath + 'TesCrypt.jar'))
# startJVM(getDefaultJVMPath(),"-ea", "-Djava.class.path=%s" % (jarpath + 'TesCrypt.jar'))
# JDClass = JClass("jpype.com.azx.crypt.JpypeDemo")
# jvmPath = jpype.getDefaultJVMPath() # 默认的JVM路径
# jvmPath ="D:/envs/jdk/jdk32/jdk7/jdk1.7.0_79/jre/bin/client/jvm.dll" # 默认的JVM路径
jvmPath ="D:/devsoft/ultimate/env/jdk/jdk7/Java17017/jre7/bin/server/jvm.dll" # 默认的JVM路径

print(jvmPath)
# jpype.startJVM(jvmPath,"-ea","-Djava.class.path=%s" % (jarpath + 'TesCrypt.jar'))
# startJVM("C:/Java/jdk1.6.0_10/jre/bin/client/jvm.dll","-ea", "-Djava.class.path=%s" % (jarpath + 'jpypedemo.jar'))

ext_classpath = r'D:\pyspace\pyChapter1\test\axja\TesCrypt.jar'
#jarpath = os.path.join(os.path.abspath('.'), 'F:/sample_Py/') #os not found
jvmArg = '-Djava.class.path=%s'%ext_classpath
print("=====>jvmArg: " , jvmArg)
jpype.startJVM(jvmPath,'-ea',jvmArg)

# JDClass = JClass("jpype.com.azx.crypt.JpypeDemo")
JDClass = jpype.JClass("com.azx.crypt.JpypeDemo")
jd = JDClass()
jd.sayHello("wxxxxxxaw")
#jd = JPackage("jpype").JpypeDemo() #两种创建jd的方法

jpype.java.lang.System.out.println("hello world!")

# jd = JPackage("jpype.com.azx.crypt.").JpypeDemo() #两种创建jd的方法
# jd = JDClass()
# jd.sayHello("hello world")
jpype.shutdownJVM()
# _*_ coding:utf-8 _*_
import jpype

jvmPath = jpype.getDefaultJVMPath() # 默认的JVM路径

print(jvmPath)
jpype.startJVM(jvmPath)
jpype.java.lang.System.out.println("hello world!")
jpype.java.lang.System.out.println("I hate you!")

jpype.shutdownJVM()

python javar send的更多相关文章

  1. python auto send email

    /*************************************************************************** * python auto send emai ...

  2. Python中send()和sendall()的区别

    Python中send()和sendall()的区别 估计每个学习Python网络编程的人,都会遇到过这样的问题: send()和sendall()到底有什么区别? send()和sendall()原 ...

  3. python email ==> send 发送邮件 :) [smtplib, email 模块]

    关于Email的预备知识: 原贴地址:http://www.cnblogs.com/lonelycatcher/archive/2012/02/09/2343480.html ############ ...

  4. python trojan development 1st —— use python to send mail and caputre the screen then combine them

    import smtplib from email.mime.text import MIMEText msg_from='1@qq.com' #发送方邮箱 passwd='bd' #填入发送方邮箱的 ...

  5. python trojan development 2nd —— use python to send mail and listen to the key board then combine them

    请勿用于非法用途!!!!!本人概不负责!!!原创作品,转载说明出处!!!!! from pynput.keyboard import Key,Listener import logging impor ...

  6. python yield: send, close, throw

    send 1. yield可以产出值,可以接收值 2. 在调用send发送非none值之前,我们必须启动一次生成器, 方式有两种 a. gen.send(None) b. next(gen) def ...

  7. Python中send和sendall的区别

    官方文档对socket模式下的socket.send() 和 socket.sendall()解释如下: sock.sendall(string[, flags]) Send data to the ...

  8. python莫名其妙的yield, yield from, yield.send

    练了几行代码, 慢慢找感觉. TASK,多线程,异步,很多地方都用到的呢. #!/usr/bin/env python # -*- coding: utf-8 -*- import time from ...

  9. python之网络编程

    本地的进程间通信(IPC)有很多种方式,但可以总结为下面4类: 消息传递(管道.FIFO.消息队列) 同步(互斥量.条件变量.读写锁.文件和写记录锁.信号量) 共享内存(匿名的和具名的) 远程过程调用 ...

随机推荐

  1. docker+jenkins实现spring boot项目持续集成自动化部署

    一.首先jenkins与docker的安装参考下面链接   安装jenkins:  https://www.cnblogs.com/jescs/p/7644635.html   安装docker:ht ...

  2. Java代码优化,都有哪些常用方法?

    Java代码优化是Java编程开发很重要的一个步骤,Java代码优化要注重细节优化,一个两个的细节的优化,产生的效果不大,但是如果处处都能注意代码优化,对代码减少体积.提高代码运行效率是有巨大帮助的, ...

  3. leecode第一百四十二题(环形链表II)

    /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode ...

  4. JS异步函数 返回值

    1.  js 异步的几种情况 : 1.1 异步操作由浏览器内核的 webcore 来执行: onclick 由浏览器内核的 DOM Binding 模块来处理,当事件触发的时候,回调函数会立即添加到任 ...

  5. 使用git命令行解决冲突

    文章转载自:https://blog.csdn.net/sureSand/article/details/78765727 使用git和提交的代码有所冲突,用IDE自带的git工具功能多了反而不知道怎 ...

  6. Codeforces 1005 E2 - Median on Segments (General Case Edition)

    E2 - Median on Segments (General Case Edition) 思路: 首先我们计算出solve(m):中位数大于等于m的方案数,那么最后答案就是solve(m) - s ...

  7. Visual Studio 2015+InstallShield 2015

    下载Installshield http://learn.flexerasoftware.com/content/IS-EVAL-InstallShield-Limited-Edition-Visua ...

  8. Google Map 谷歌地图

    <script> var map; function initMap() { var position = new google.maps.LatLng(1.539187, 103.647 ...

  9. 第 8 章 容器网络 - 059 - 安装配置 flannel

    安装配置 flannel 1) build flannel flannel 没有现成的执行文件可用,必须自己 build,最可靠的方法是在 Docker 容器中 build. 不过用于做 build ...

  10. (10)进程---Manager数据共享

    Manager  能够实现进程之间的数据共享(dict list),但是必须上锁来确保数据的准确性, 队列则可以实现进程之间数据通信 from multiprocessing import Proce ...