Redian新闻
>
how to add my own class into a jar file?
avatar
how to add my own class into a jar file?# Java - 爪哇娇娃
c*t
1
for example, the structure in the jar file is
edu.cc.ffm. The name of the jar file is bc.jar
suppose my java file is hell.java
at the beginning of hell.java, I add
package edu.cc.ffm;
then use javac -classpath bc.jar hell.java to get hell.class
next I extract bc.jar and move hell.class to edu\cc\ffm
finally use jar cf bc.jar *.* to create a new bc.jar
My question is, when I use import edu.cc.ffm.hell;
it generates error saying import arguments are not correct.
can any expert tell me what's wrong
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。