当前位置: 技术问答>java相关
怎样调用自己编写的java类?
来源: 互联网 发布时间:2015-02-21
本文导语: 比如我自己的jdk安装在C:jdk1.3下,而我编写的java类在D:corejava下面! | 把你写的类用包装好,然后设置classpath,在你写的程序开始import你要用的那个类,java编译器会找到的,谢谢。 | ...
比如我自己的jdk安装在C:jdk1.3下,而我编写的java类在D:corejava下面!
|
把你写的类用包装好,然后设置classpath,在你写的程序开始import你要用的那个类,java编译器会找到的,谢谢。
|
java -classpath d:corejava YourClass
欢迎光临Java,J2EE论坛( http://letsjava.yeah.net )。
http://www.minij2ee.com/
欢迎光临Java,J2EE论坛( http://letsjava.yeah.net )。
http://www.minij2ee.com/
|
At first, confirm your jdk setting is allright.
If your OS is Win, add line "SET PATH=d:corejava;%PATH%" in the bottom of file "autoexec.bat"; and then reboot you machine to guarantee that you can run it normally in your every Dos window.
if your OS is Linux, add line "EXPORT CLASSPATH=$CLASSPATH:YOUR DIRECTORY" in the bottom of file "profile" in directory "/etc/"
Good luck!
If your OS is Win, add line "SET PATH=d:corejava;%PATH%" in the bottom of file "autoexec.bat"; and then reboot you machine to guarantee that you can run it normally in your every Dos window.
if your OS is Linux, add line "EXPORT CLASSPATH=$CLASSPATH:YOUR DIRECTORY" in the bottom of file "profile" in directory "/etc/"
Good luck!
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。