Unable to compile and run HelloWorld in jdk1.7

陌路散爱 提交于 2019-12-06 07:23:26

JDK 6 in you path and class path appears before JDK 7. I believe this is the problem.

Try first to remove JDK 6 from classpath and path environment variables and then try again. If it will work you probably have to create bat file that sets the environment for java 7 and run it before working with java 7.

Alternatively just remove older versions of java. Why do you need them?

In your classpath you have java 7 at e:\jdk1.7\lib;.;

Note the jdk1.7.

In you path you have java 7 at e:\jdk1.7\bin when you specify the environment vars, but then you set it to e:\javasdk1.7\bin in the line:

E:\>set path=e:\javasdk1.7\bin;.;

Note the javasdk1.7.

Since javac IS running, it seems the new PATH you set must be correct. Your classpath should match it (removing, as others have noted, the reference to your java 7 install):

classpath=e:\javasdk1.7\lib;.;

Make that change and it should be able to find the missing class.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!