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.