Using JBuilder9 to make EXE files without public secrets

Source: Internet
Author: User
Tags config

This article is the Borland of the use of the technology, can be jbuilder to make EXE file to start the Java file.

JBuilder does not support local compilation mechanisms. But there is a hidden trick that allows you to start a Java program from an executable file, either appearing or not appearing in the console window. These files are required in the JBuilder Bin directory: JBuilder.exe JBuilderW.exe (optional) jbuilder.config.

Jdk.config JavaLauncher.dll "JBuilder.exe" is a generic executable shell to start the Java program, "JBuilderW.exe" like Javaw.exe, it put "JBuilder.exe "Wrapping up the runtime does not show that Conso le window. The key to using these files is the file name. "JBuilder.exe" looks for a configuration file called "Jbuilder.config" that contains the necessary information to run a Java program.

The same "JBuilderW.exe" looks for "JBuilder.exe" to start a Java program with no console window. If you rename "JBuilder.exe" to "Foo.EXE", then "Foo.EXE" will look for "foo.config" configuration file, the same "JBuilderW.exe" is renamed "FooW.exe", it will look for "Foo.EXE" File.

How do I use JBuilder.exe to start an application? As long as the jbuilder.exe,jbuilerw.exe,jbuilder.config renamed to the appropriate file name, in the Jbuilder.config to specify the main class and classpath, you can through the execution JBuilder.exe ( or renamed EXE file) to start the Java application.

Here is an example:

The Borland JBuilder 8 is installed under the E:\jbuilder8\ directory and a temp directory is established under E:\jbuilder8\bin\. Then copy the Jbuilder.exe,jbuilder.config,javalauncher.dll,jdk.config four files to the E:\jbuilder8\bin\temp\ directory, Then create a hello directory under this directory to generate a Hello.java file, or E:\jbuilder8\bin\temp\hello\hello.java file, in this directory.

//hello.java
package hello;
public class hello{
public static void main(String s[]){
System.out.println("Hello, Exe file!");
}
}

Compile the Java file, and then open the Jbuilder.config file and make the appropriate modifications:

Find the following two lines inside the Jbuilder.config:

# Start JBuilder using the its main class
mainclass com.borland.jbuilder.JBuilder

Modified to:

# Start JBuilder using the its main class
mainclass hello.hello
addpath E:/jbuilder5/bin/temp/

The Addpath command is to add directories to the CLASSPATH, and the commands and other config commands that can be identified inside the Jbuilder/bin directory can be found in the config_readme.txt.

Then modify the Javapath inside the jdk.config to a relative path, such as:

javapath ../jdk1.4/bin/java

Modified into:

javapath ../../jdk1.4/bin/java

Finally, modify the Jbuilder.exe,jbuilder.config to the required file names, such as Foo.EXE and Foo.config files.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.