java 发布exe程序 java生成exe可执行文件 |
您所在的位置:网站首页 › asm文件生成exe › java 发布exe程序 java生成exe可执行文件 |
1. 将项目生成 jar 包: 项目右键 - export - Java - Runable JAR file 。(注:选择Runable JAR file,才是可执行的jar文件) next: a. Launch configuration: 选择主文件 (注:为了解决最后执行 exe 时报错:NoClassDefFoundError) finish 解释: (1)Extract required libraries into generated JAR。 把所有的import JAR都拆开来,包含在JAR的各个目录中,ex. net/org/xxx.class (2)Package required libraries into generated JAR。 把所有的import JAR都包在JAR的根目录下 (3)Copy required libraries into a sub-folder next to the generated JAR。 把所有import JAR放在JAR外面独立的一个文件夹 2. 下载 exe4j 软件,具体步骤请度娘 3. 但是我最后执行exe的时候,报了错误:The JAVA_HOME environment variable does not point to a working 32-bit JDK or JRE. a. 在第 4.Executable info 时,选择 Advanced Options 选择 32-bit or 64-bit。 b. Generate 64-bit executable 前打 √ 。 (估计所有的错误都让我一个人遇到了 /(ㄒoㄒ)/~~) 4. 执行 exe 时报错:NoClassDefFoundError 的解决方案 a. 验证成功 eclipse export 时选择:Package required libraries into generated jar exe4j 第5.java invocation,就要选: org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader ------------------------------------------------------------------------------------------------------ b. 没有验证过,不懂,不会用 eclipse export 时选择:Copy required libraries into a sub-folder next to the generated jar exe4j 第5.java invocation,就要将所有 jar 添加入class path,这时可以选原来程序里的 main class
|
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |