您当前的位置: 首页 >  Java

CheerpJ转换JAVA使用最简教程

柳鲲鹏 发布时间:2021-02-20 10:28:25 ,浏览量:0

  • 参考

https://github.com/leaningtech/cheerpj-meta/wiki/Tutorial

https://github.com/leaningtech/cheerpj-meta/wiki/Getting-Started

  • 下载

https://www.leaningtech.com/pages/cheerpj.html#Download

吾下载了win版本,解压之后看了一下bin目录,发现没有exe,于是就下载了LINUX版本。

  • 解压

解压到用户目录,即~/cheerpj_2.1

  • 下载范例

https://docs.oracle.com/javase/tutorialJWS/samples/uiswing/TextDemoProject/TextDemo.jar

放在:~/cheerpj_tutorial/

  • 安装python3
sudo apt install -y python3
  • 操作
cd ~/cheerpj_tutorial/
~/cheerpj_2.1/cheerpjfy.py TextDemo.jar
  • 新建网页cheerpj_tutorial.html


  
    
    CheerpJ test
    
  
  
  
  
      cheerpjInit();
      cheerpjCreateDisplay(800,600);
      cheerpjRunJar("/app/TextDemo.jar"); 
  
  • 启动服务器
python3 -m http.server 8080
  • 访问页面
http://localhost:8080

http://localhost:8080/cheerpj_tutorial.html

 

关注
打赏
1688896170
查看更多评论

柳鲲鹏

暂无认证

  • 0浏览

    0关注

    4641博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0848s