jar

1 分类

可执行jar 有main java -jar XXX.jar

不可执行jar 没有main 只能作为依赖

vim jar

2.下载jar包

https://www.cnblogs.com/Marydon20170307/p/9149256.html

3.环境导入jar包

1 命令行

https://blog.csdn.net/weixin_30681615/article/details/99745369

https://blog.csdn.net/chencaw/article/details/78884107

https://blog.csdn.net/j_bean/article/details/75095337

例子:

####目录结构

test

​ lib

​ spark-assembly_2.10-1.6.0-cdh5.16.1.jar

​ src

​ demo.java

​ bin

#

在test路径下

1.编译

javac -cp ./lib/spark-assembly_2.10-1.6.0-cdh5.16.1.jar -d ./bin/ ./src/demo.java

2.运行

java -cp ./lib/spark-assembly_2.10-1.6.0-cdh5.16.1.jar:./bin/ com/yzy/spark/demo

注意:1 -cp 需要列出所有jar包,ide也是全部列出了 2 window上,用;分隔;linux上是:分隔

2 idea

https://www.jianshu.com/p/9762b7098b76

https://www.cnblogs.com/mracale/p/10493823.html

4.代码引用jar包

import

5.怎么生成jar

https://www.cnblogs.com/swordfall/p/11359370.html

https://blog.csdn.net/smgsn01/article/details/108038046

1 命令行

2 maven

Author

Lavine Hu

Posted on

2024-04-14

Updated on

2024-04-14

Licensed under

# Related Post
  1.java编译
  2.gc
  3.java性能优化
  4.java内存泄露
  5.java debug
  6.java io
  7.java学习网站
  8.JDK、JRE、JVM
Comments

:D 一言句子获取中...