为java的包配置环境,如何为Javac设置环境变量以能够找到导入的包?

I am not a java developer. I just want to run a java application (which can be downloaded from:

http://code.google.com/p/k-shortest-paths/downloads/list

, under this name: KShortestPaths_Java_v2.1.zip)

While trying to compile test\edu\asu\emit\qyan\test\YenTopKShortestPathsAlgTest.java

I get "package ... does not exist" and "symbol ... does not exist" which I know are related to path setting. Can you please tell me how I should set environment variables and from which directory compile and run that java file?

(My operating system is Windows XP and I have saved the application in C:\KSh)

Edit:

I resolved the problem with compiling. Now, I have a CLASS file: YenTopKShortestPathsAlgTest. However, when I try to run it with java, I get this error: "could not find the main class... program will exist"

which I guess is again related to the paths other jar files are located. Could you please kindly give me a hint?

解决方案

The zip file contains a .classpath and a .project file. These files are used by the eclipse java IDE.

Perhaps the most easy way would be to download eclipse and import the project there.

If you want to do it by hand, try

javac -sourcepath src;test test\edu\asu\emit\qyan\test\YenTopKShortestPathsAlgTest.java

from your directory C:\KSh.

EDIT:

Download junit.jar and add it to the classpath with

javac -classpath junit.jar -sourcepath....

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值