 Hey everybody, it's Brian. Today we'll be discussing converting JAR files into EXCs. Why would you want to convert a JAR file in the first place? It's already been converted. Well, let's say you want to hand this off to your friend and they don't really understand command lines or JARs or Java or anything. They just want it to run. Well, in Windows you have an EXC. They just want to double click it and run it. Now doing a simple search for Java EXC shows a huge list of things and a lot of these cost money. Today we'll be looking for one of my personal favorites called Launch for Java and you see it's launch4j.sourceforge.net and you go to the site and just download. I've already downloaded it but I'm just kind of showing you the website where you can kind of expect. Just click download now and this is a cross-platform compiler, meaning it can go on just about any operating system. Now I've already created a JAR file and this is the JAR we're going to work with. Now this JAR file just is simply print out, you know, hello from Java. Here's Launch for Java. I'm using 3.01. It's a zip file. Just extract it and then go into the folders. You see a lot of these things. Really what you need to know is that it comes in JAR format and EXC. I believe they actually created this EXC using Launch4j. So yes this is a Java program. This is just an example of what Java programs can do. So double click Launch4j and it comes up with this big ominous looking window. We're going to go over some of these things here. All these tabs are different variables you need to set. We're going to go over them real quickly. So output file, this is what you're building. What do you want to make? We'll call it test.exe and the JAR file you want to use. There's our WinTest.jar and you have the option of don't wrap the JAR Launch only. What are they talking about here? Well basically what you're doing is you're taking the JAR file and wrapping it inside of an EXC so the user never sees the JAR file. You have the option of not doing that and just making an EXC that calls the JAR file. You can specify, manifest an icon, change the directory, give it command line arguments, set the process priority. I mean you can do a lot of different things. We're not going to really go over these. We're just going to keep it basic for this tutorial. Class path, I don't recommend you mess around with this. This is if you want to override the class path. Header, this is something we should talk about. Header type. You're actually compiling something here. These are O files or object files meaning you're actually calling a compiler in the background and generating an EXC. This is a GUI or a console. We have a console. What you're looking at here is a GUI. When we run our Java program it's in a console. So we're going to select console. Don't worry about single instance. Now JRE, if we try to just compile this right now, notice how it says specify minimum JRE version. You can't just type 1.0 because it wants a specific format. Should be x.x.x. So it's looking for 1.0.0. That's the minimum JRE you don't want. You can set environmental variables, a splash screen, version information, and different messages the user will see. We're just going to stick with the basic settings for this tutorial. Go ahead and hit compile. Now it's going to want you to save it. I've already done it. Now you notice down at the bottom here it says Compile Resources Linking Wrapping. What does all this mean? Well it creates the resources out of the jar file, links it all together, and then wraps it into an EXC, and then it creates our EXC, in this case test.exe. So when we go back here, now we suddenly have test.exe, and you run that and well window popped up and disappeared so fast you couldn't really see it. So we're going to just copy cd, paste, and you see there's our test.exe. So when we type test, hello from Java. So you can, you know, just proof of concept here. You can actually delete these and see that just test.exe is there, and when you run it, it runs fine. Now you will know, you will need to have your end user have a Java runtime environment installed. You can't just hand them the EXC expected to run. They have to have Java installed. So that's something to note. This is Brian, and today we covered converting a jar file into an EXC. I hope you found this video educational and entertaining. Thanks.