执行导出 CLASSPATH 后重置 CLASSPATH
我试图做一
setenv CLASSPATH /somethig/foo/junit-4.9.jar
件事。进行一些搜索后(未检测到命令 setenv)。我发现我必须改用
export CLASSPATH=/folder/junit-4.9.jar
Which 没有标记错误或任何东西。问题是它似乎搞乱了其他曾经有效的事情,就像如果我这样做的话,
javac -Xlint FooTest.java
它会说类似的话
找不到符号变量 Foo
Foo.start()
Foo 来自 Foo.java 和 Foo.class 文件
在执行导出类路径之前我能够做到这一点。有办法恢复吗?
我在哪里通过执行export CLASSPATH= bla bla删除刚刚添加的内容?
我想回到开始添加junit路径之前的“事情本来的样子”
谢谢!
更新 如果我对我得到的值进行回显:
echo $CLASSPATH .:/folder/junit-4.9.jar:/junit-4.9.jar
没关系,我通过设置 CLASSPATH="" 删除了我放置的整个内容,现在这些内容可以编译。
I was trying to do a
setenv CLASSPATH /somethig/foo/junit-4.9.jar
kind of thing. After doing some searching (the command setenv was not detected). I found that I had to use instead
export CLASSPATH=/folder/junit-4.9.jar
Which didn't mark an error or anything. The problem is that it seemed to mess up other things that used to work like if I do
javac -Xlint FooTest.java
it says something like
cannot find symbol variable Foo
Foo.start()
Foo comes from Foo.java and Foo.class files
And before doing the export classpath thing I was able to do this. Is there anyway to revert that?
Where do I erase what i just added by doing the export CLASSPATH= bla bla?
I want to return to "the way things were" before I started adding the junit path
Thanks!
UPDATE
if I do an echo of the value I get:
echo $CLASSPATH .:/folder/junit-4.9.jar:/junit-4.9.jar
Nevermind I erased the whole thing I put by setting CLASSPATH="" and now the stuff compiles.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用,
Use,
您可能必须再次重建类路径,因为旧的类路径已被
export CLASSPATH=/folder/junit-4.9.jar
覆盖。请记住在设置新类路径时包括旧类路径:You probably have to rebuild your classpath again as the old one has overwritten by
export CLASSPATH=/folder/junit-4.9.jar
. Remember including the old classpath when you setting a new one:你可以做
导出 CLASSPATH=/folder/junit-4.9.jar:$CLASSPATH
所以你将拥有类路径的旧值加上新值。
如果你真的想恢复它,你可以将它存储在临时变量中
导出 TMP_CLASSPATH=$CLASSPATH
然后
导出 CLASSPATH=/folder/junit-4.9.jar
然后
导出 CLASSPATH=$TMP_CLASSPATH
You can do
export CLASSPATH=/folder/junit-4.9.jar:$CLASSPATH
So you will have the old value of classpath plus new value.
if you really want to revert it, you can store it in a temp variable
export TMP_CLASSPATH=$CLASSPATH
then
export CLASSPATH=/folder/junit-4.9.jar
then
export CLASSPATH=$TMP_CLASSPATH