{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from jpype import *  \n",
    "import os.path  \n",
    "jarpath = os.path.join(os.path.abspath('.'), 'F:/sample_Py/')  \n",
    "startJVM(\"C:/Java/jdk1.6.0_10/jre/bin/client/jvm.dll\",\"-ea\", \"-Djava.class.path=%s\" % (jarpath + 'jpypedemo.jar'))  \n",
    "#ubuntu 中startJVM(\"/home/geek/Android/jdk1.6.0_43/jre/lib/i386/server/libjvm.so\",\"-ea\", \"-Djava.class.path=%s\" % (jarpath + 'XXX.jar'))  \n",
    "JDClass = JClass(\"jpype.JpypeDemo\")  \n",
    "jd = JDClass()  \n",
    "#jd = JPackage(\"jpype\").JpypeDemo() #两种创建jd的方法  \n",
    "jprint = java.lang.System.out.println  \n",
    "jprint(jd.sayHello(\"waw\"))  \n",
    "jprint(jd.calc(2,4))  \n",
    "shutdownJVM()\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
