类文件d:\test2.java

package b;

public class test2 {
    public static void main(String[] args) {
        System.out.print("hello world!");
    }
}

操作步骤(wi7下cmd命令模式):

1.使用javac test2.java 正常

2.然后在d:\下新建目录b,然后将生成的test2.class文件剪贴到d:\b\目录下

3.将当前目录设置成d:\,执行java b.test2,成功显示hello world

相关文章:

  • 2022-03-04
  • 2021-08-18
  • 2021-10-19
  • 2021-11-18
  • 2021-11-18
  • 2021-11-30
  • 2021-11-13
猜你喜欢
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-06-13
相关资源
相似解决方案