如何用IDEA将Java工程打包成jar并转换成可执行exe文件?
- 内容介绍
- 文章标签
- 相关推荐
本文共计771个文字,预计阅读时间需要4分钟。
第一部分:使用IDEA打包工程jar 1. 准备好一款良好的、可执行的、包含main方法的工程。例如:我随便写的main方法public static void main(String[] args) throws IOException { Properties properties=System...}
第一部分: 使用idea 打包工程jar
1.准备好一份开发好的 可执行的 含有main方法的工程。
例如:我随便写的main方法
public static void main(String[] args) throws IOException { Properties properties = System.getProperties(); String osName = properties.getProperty("os.name"); System.out.println (osName); if (osName.indexOf("Linux") != -1) { Runtime.getRuntime().exec("step:htmlview"); } else if (osName.indexOf("Windows") != -1){ Runtime.getRuntime().exec("explorer www.baidu.com"); } else { throw new RuntimeException("Unknown OS."); } }
2.点击 idea:File->Project Struce...(快捷键 ctrl + shift +alt +s)。
本文共计771个文字,预计阅读时间需要4分钟。
第一部分:使用IDEA打包工程jar 1. 准备好一款良好的、可执行的、包含main方法的工程。例如:我随便写的main方法public static void main(String[] args) throws IOException { Properties properties=System...}
第一部分: 使用idea 打包工程jar
1.准备好一份开发好的 可执行的 含有main方法的工程。
例如:我随便写的main方法
public static void main(String[] args) throws IOException { Properties properties = System.getProperties(); String osName = properties.getProperty("os.name"); System.out.println (osName); if (osName.indexOf("Linux") != -1) { Runtime.getRuntime().exec("step:htmlview"); } else if (osName.indexOf("Windows") != -1){ Runtime.getRuntime().exec("explorer www.baidu.com"); } else { throw new RuntimeException("Unknown OS."); } }
2.点击 idea:File->Project Struce...(快捷键 ctrl + shift +alt +s)。

