zoukankan      html  css  js  c++  java
  • java 与 javaw不同之处[转]

    There are more ways to run Java programs (either .class or .jar). One is to use the executable named java and the other is to use javaw.\ So what is the difference?

    java (java.exe on Windows) runs the program in a console window. If you run the command

    java -jar Application.jar

    then a console window appears (if not already done in a console) and the program uses it for the input and standard output and standard error streams.

    On the contrary, javaw or javaw.exe runs the program without console window appearing, and all input and output (using e.g. System.out.println() or System.err.prin­t()`) is silenced.

    So, if you have the same problem I had, that is, running the .jar file in a windows console (cmd.exe) and having no output, then you can fix that by changing the Windows registry value HKEY_CLASSES_ROOT\jarfile\shell\open\command. In my case, its value is:

    HKEY_CLASSES_ROOT\jarfile\shell\open\command = "C:\sw\Java\jre1.6.0_07_32bit\bin\javaw.exe" -jar "%1" %*

    Just change the javaw.exe to java.exe. After changing, you will see the output in the console when running .jar files just by „double-clicking“ it.

  • 相关阅读:
    输出菱形
    for语句输出三角形
    阶乘倒数的和
    变量赋值判断奇偶
    928作业
    各种主流数据库的比较(所以说我觉得Oracle这个keng?入的不错?)
    Oracle创建表
    (转载)全球唯一标识GUID
    (转载)Java基础知识总结
    两天以来对plsqldev操作的记忆
  • 原文地址:https://www.cnblogs.com/jjj250/p/1793831.html
Copyright © 2011-2022 走看看