简体   繁体   English

如何使用Textpad将org.apache.commons.io jar文件用于Java项目

[英]how to use org.apache.commons.io jar file into Java project using Textpad

I have to implement upload resume feature in my project.I am making Java project using textpad .For uploading ,I have to import org.apache.commons.io jar file.Before running project, I have to set path of org.apache.commons.io at cmd prompt which I have placed in a folder in my project.I have to set path every time I run the project.Is any other solution so that I can get rid of this problem.I am new Java programmer.Suggestions and help is appreciated. 我必须在我的项目中实现上传恢复功能。我正在使用文本板制作Java项目。要上传,我必须import org.apache.commons.io jar文件。在运行项目之前,我必须设置org.apache.commons.io路径org.apache.commons.io我已将cmd prompt org.apache.commons.io放置在项目的一个文件夹中。每次运行项目时都必须设置路径。是否还有其他解决方案,以便摆脱这个问题。我是Java程序员。和帮助表示赞赏。 Thanks! 谢谢!

You can set (or append) system property CLASSPATH to include your commons.io jar, so that the jar is automatically included whenever you run your "java" command. 您可以设置(或附加)系统属性CLASSPATH以包括commons.io jar,这样,只要您运行“ java”命令,就会自动包含jar。

On Linux: export CLASSPATH=$CLASSPATH:/usr/local/lib/commons-io-2.4.jar 在Linux上:export CLASSPATH = $ CLASSPATH:/usr/local/lib/commons-io-2.4.jar

On Windows: see http://www.computerhope.com/issues/ch000549.htm 在Windows上:请访问http://www.computerhope.com/issues/ch000549.htm

More details on using the CLASSPATH system variable can be found here http://docs.oracle.com/javase/tutorial/essential/environment/paths.html or here http://javarevisited.blogspot.fi/2011/01/how-classpath-work-in-java.html 有关使用CLASSPATH系统变量的更多详细信息,请参见http://docs.oracle.com/javase/tutorial/essential/environment/paths.htmlhttp://javarevisited.blogspot.fi/2011/01/how -classpath-工作在java.html

Adding jar to our java code can be done using following command: 可以使用以下命令将jar添加到我们的Java代码中:

SET JRE_HOME=<path to your jre>
%JRE_HOME%\bin\java.exe -jar apache.commons.io.jar

Here you need to mention jre home and need to set path for the jar you want to add is. 在这里,您需要提及jre home,并需要设置要添加的jar的路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM