Is there a way to the hide win32 launch console from a Java program (if possible without JNI)(有没有办法从 Java 程序中隐藏 win32 启动控制台(如果可能没有 JNI))
问题描述
您从控制台启动一个 java 程序(可能使用 .bat 脚本).我不想让控制台保持可见,我想隐藏它.
You launch a java program from a console (maybe using a .bat script). I don't want the console to remain visible, I want to hide it.
有没有简单的方法来做到这一点?没有 JNI 吗?
Is there a simple way to do this ? Without JNI ?
推荐答案
使用javaw.
http://java.sun.com/javase/6/docs/tooldocs/windows/java.html
javaw 命令与 java 相同,只是 javaw 没有关联的控制台窗口.当您不希望出现命令提示符窗口时,请使用 javaw.但是,如果由于某种原因启动失败,javaw 启动器将显示一个包含错误信息的对话框.
The javaw command is identical to java, except that with javaw there is no associated console window. Use javaw when you don't want a command prompt window to appear. The javaw launcher will, however, display a dialog box with error information if a launch fails for some reason.
这篇关于有没有办法从 Java 程序中隐藏 win32 启动控制台(如果可能没有 JNI)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:有没有办法从 Java 程序中隐藏 win32 启动控制台
基础教程推荐
- 存储 20 位数字的数据类型 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
