One way is to bundle the runtime with the program. So there's a subfolder (or it's directly bundled into an executable) in the application directory that gets used.
For instance you could use launch4j to bundled a java program & the runtime into an exe
Another way is to cross-compile to a different language or use an alternative compiler that compiles directly to machine code, which exists for some languages, e.g. Excelsior JET for Java.
If you want a completely stand-alone program (i.e. they don't even need to have java installed), there are various tools that will bundle a JRE with your jar. I've used Launch4j before, and it seems to work pretty well.
Java console applications can't be started with double-click, because Sun/Oracle stupidly didn't implement something into the JVM that would optionally open a console.
The standard suggestion here is to make a batch file which executes "java -jar myprogram.jar" and just deliver that with the application.
Another way is to use a launcher utility. I have made very good experiences with http://launch4j.sourceforge.net/ which e.g. allows you to deliver your own JVM with the program without requiring an install on the user-side. You just copy your JVM in (and possibly strip a few things, e.g. JavaFX if not needed, and once Java 9 is out, you'll probably have a blast stripping it down to the bare minimum you need). It also turns your jar into an exe with icon, so that it integrates flawlessly with Windows like any other application. Optionally, you can even show a spash screen while the application loads.
Finally, I just created a Java class that enables double-click for console applications, all you have to do is add the class and add one call at the start of your application.
It currently only works on Windows, but it is prepared for other systems, so if you know the necessary command line strings, you can just put them in and it should work. Please let me know if you have any so that I can extend this.
It should create a METAINF/MANIFEST.MF which contains a Main-Class entry. If you have installed the JVM (JRE or JDK) you can double click on the jar and it executes (unless *.jar extentions is not associated with "Java(TM) Platform SE binary").
If you want to bundle the runtime with your application and create native platform binaries (*.exe, *.dmg, ...) you can use Launch4j (maven plugin)
There's also a relevant JEP upcoming.
You can't convert a .jar into an .exe, but you can place a JAR within an executable wrapper.
http://launch4j.sourceforge.net/ http://jsmooth.sourceforge.net/
Here's a lengthy article on the topic too http://www.excelsior-usa.com/articles/java-to-exe.html
I use a utility called Launch4J to bundle the JRE for EverSector. Only supports Windows executables, but the utility itself can be run from any platform. If you come across any good bundling tools for other platforms, I'd be interested in hearing about them!
Any Java program you make will run on the JVM. There were some attempts in the past to compile Java programs all the way to machine code, like the Gnu Compiler for Java, but I don't think any of them are still in active development. The one thing you can do is essentially make an executable that contains your program and the JVM and then runs your program when you double click it. You can use something like Launch4J to do the heavy lifting for you. I'm not aware of any similar tools for Mac, but since Mac programs are just folders with a specific structure, it shouldn't be too hard to do on your own (a .dmg file is a disk image- just a collection of files. Applications on a Mac are folders with the .app extension)
Yep, AV software is snakeoil, constantly giving false alarms and ironically that seems why people trust it so much.
My entire System is Linux based, that .exe file never saw a windows host on which it could have been infected. I use launch4j to wrap the jar in an executable and apparently thats what your scanner dislikes
If in doubt, just use the JAR version.
The Java VM needs to be available on your PC to run Java programs, there's no way around that. You can install it or it can be embedded in the program, like minecraft does. The Java runtime is still there in that case, but it's just hidden away within the program files
Java exe wrappers can wrap your jar file into an exe so it has an installer and looks like a regular windows program and stuff, but behind the scenes it's still java code running on a Java VM
To release on Steam the only hard requirement is that you have an .exe file that runs the game. You can wrap libGDX game into .exe with Launch4j:
http://launch4j.sourceforge.net/
XBox360 controllers reportedly work:
> Unless a jar has been specifically packaged to run on click (Maven-assembly dependancy)
Nope, all you need is to put the compiled class files in the correct directory structure (Just like the sources were, the package names being the directory names.) plus a MANIFEST.MF file in the correct formatting that points to the Main class, zip the whole thing, rename it to .jar and you're done. Example for the manifest:
Manifest-Version: 1.0 Main-Class: com.dreamspacepresident.stupidlittleminesweeper.Main .
Like this, except the "." line is actually EMPTY. These are for some imho super stupid reason necessary. So, the file with these two information lines would have overall four lines.
EDIT: This applies to GUI programs and console programs alike, but if you want to start a console program without java -jar myProgram.jar
, you either have to use one of the various packagers that turn it into an EXE (or something else for other systems), of which I prefer Launch4j which is very powerful and easy as pie, or you could use this class I made, which solves the problem at least for Windows, but it's prepared for other systems, some just has to fill in the blanks.
Launch4j if it's a desktop app.
There are a few different products like this, but L4J is free and works well enough. You can wrap your app and resources in an executable container, along with the JRE if you like.
My experiences with Launch4j have been very good, e.g. you can (manually) put a copy of your installed JRE (leaving of JavaFX, if you don't need it, saves 30 MB or so) in a subfolder of the tree you want to distribute and insist that this JRE will be used for running. All the user would have to do is to unpack the tree (which in turn you could let an installer or an executable archive do), no JRE-installation required.
That's just one of a lot of features, though an important one. Took me like half an hour with no prior l4j experience to make this work.
The jar will optionally be inside the exe instead of separate, and it will not be unpacked for running.
Launch4j is free, no trial version that I'm aware of.
> This program is free software licensed under the BSD license, the head subproject (the code which is attached to the wrapped jars) is licensed under the MIT license. Launch4j may be used for wrapping closed source, commercial applications.
Usually, when threads like this pop up (Happens every few months in this subreddit.), it is said that the deal with Ask had been made by Sun, Oracle inherited it. I think they could do something against it if they really wanted. No idea about the income vs costs involved.
There are ways (Registry entries, I think.) to prevent the "Install Ask?" from being checked by default. There's also the software Unchecky. Or is it un-checked now by default?
But you're right: It drags the software down. What also poisons it is the browser plugin, though I have no idea if its installation is still default or not, probably yes. People don't install Java because of "security problems", and the only thing they can be referring to is the browser plugin. I tell those people to install the JDK instead, because 1) its JRE doesn't come with the plugin, 2) it doesn't have the Ask toolbar, and 3) it does not nag you for updates (which could be seen as a negative, though).
It's really too bad about the toolbar and the plugin, but it's also bad that people are so badly informed that they don't know what exactly they fear about Java. And you can easily create a Java application (e.g. with Launch4j) that comes with its own JRE: This will not require an already installed JRE, and it will also not install one! It's just some of the files of the installed JRE copied into a subfolder, referenced by Launch4j. So, it might be best to not even tell people that Java is used.
Yes this is possible through the use of the jar wrapper. There's a few pieces of software out there that can do this for you but one I remember off the top of my head is Launch4j. If you just look around for 'jar wrappers' then you should find something that you can use :).
I find it's easiest for users to launch Java applications if you provide a native executable. I use launch4j to generate them now (note: although it runs cross-platform, it only generates .exe files), and I've actually used it for a console app before - here's my launch4j config file. I also integrated it into the build process with ant, buildfile.xml here. Hope that helps!
You actually can use something like Launch4j to bundle just the JRE and it only adds a few tens of MB (plus however big your dependencies are, of course.) I don't know if there are any gotchas for Kotlin but I can't think of a reason offhand there would be.
You can create an executable with Launch4j.
You could create a batch file that launched the program and pin that one.
The main thing is that memory is there to be used. If you aren't on a constrained environment don't worry about memory.
Just distribute a JRE with your program. Maybe try something like http://launch4j.sourceforge.net/index.html for distribution? One of the first results from googling.
Also, do you intend to put this on GitHub?
In case you do not need to stick to just Java, Launch4j is a rather easy to use tool to turn your Java program into an EXE (But supports other platforms, not just Windows.) with optional splash screen. You can even deliver your own already installed JRE (which of course blows up the size a lot). E.g. you could deliver a 7z archive with a directory tree, and the EXE inside (With icon built-in. Proper application.) just needs to be started, even if Java isn't installed, and the user doesn't have to install anything for this.
Adding the splash screen is as straighforward as it gets: Select the option, supply the image.
If it weren't for SourceForge's behavior to inject shit into installers these days, I would heartily recommend Launch4J http://launch4j.sourceforge.net/ because without any prior experience with turning .jar files (Which are runnable by themselves.) into .exe files, this tool got me going all the way in half an hour. It has a lot of upsides:
You can choose which JRE is to be used, and you can even supply your own: Just copy the installed JRE of your choice into a subfolder of your installation package, and the audience doesn't have to install a thing, they just unpack what you give them and run your EXE. Downside: This makes the package a lot larger (by about 70 MB - you can strip unnecessary stuff out, which I successfully did - dropped all the JavaFX stuff - but since you explicitly need it ...).
You can supply your own icon which will be inside the EXE. You can add a splash screen. And a lot of other options.
I just wish they would move away from SourceForge. HAHA, forge. Not just the place where you make swords, but the word also suggests forgery. How fitting.
While I'm at it, I can't resist to link to my Java 8 (not FX) version of Battleship (with source, but it's far from exemplary), and to my FileRenameEditor which allows to open a directory like a text in a special editor, so you can block-select, multiline-edit, copy/paste etc. instead of having to put up with the retarded editor that's built into the OS. This Battleship version even has sound, synthesized in realtime. In case you want to start working on that front, too.
As others have said, you can not set the settings from inside the jar (like from the manifest, for example).
You could look into launch4j as a user friendly alternative. It basically bundles your jar with a custom launcher.
You can also create actual EXEs, but that's not the intended/native Java way. It will give you a lot of advantages over regular runnable JARs though. I've successfully used http://launch4j.sourceforge.net/ for this, you can e.g. deliver your own JRE with it (which then does not need to be installed!) in case the user doesn't have the right (or any) Java version, you can use a proper icon, the jar is optionally hidden inside the EXE so that it doesn't look like Java etc. - with half an hour of trial and error and doc-reading, you'd get just the desired result. First you need the runnable JAR that you now already have, though, it's not a replacement for that step.
To create a jar file from Eclipse, I recommend using Ant. Here's a shortened version of an Ant script I use. To run it from Eclipse, go to Run -> External Tools -> Run As -> Ant Build... From there, check the targets you want to run and hit Run.
As for making an exe, I recommend using launch4j. The Ant script I linked uses launch4j, but you'll need to make a build preferences file first.
The question is always "what is enough?". This tools will find all instances of the vulnerable classes in jar, war, ear, zip and jmod files that it can read. This unfortunately doesn't mean that there are no other instances of log4j floating around.
I have found some cases where developers copied the log4j source code into a project and made some changes. These changed files were vulnerable and will not necessary be found by the tools.
If the developer used something like http://launch4j.sourceforge.net/ you will not find it either.
So protecting your environment will take a combination of upgrading libraries, removing vulnerable classes, blocking egress traffic, setting up WAF filters and so on.
I don't know there is a "definitive" answer. There are definitely multiple options available.
I have used Launch4j [1] with good success previously. Maybe check it out and see if it does what you need.
How DID you do it indeed? Just kidding, I don't remember the exact details but this is the basic breakdown:
- First you create a .jar file from your package. There are options in IDEs to do this. Basically you need to "build" your project and you will get a .jar file in your project folder somewhere(maybe in dist directory)
- Then you need to combine your file with a wrapper. I googled for you and came up with Launch4J. From there it does not seem too difficult to create your executable.
Although i feel like a batch file could also do the trick provided that you have java on your PATH. basically just call jre with your file.
All that Launch4J does is to package the application .jar with a Java runtime environment into an .exe
The second line on the web page clearly states that:
> The executable can be configured to search for a certain JRE version or use a bundled one, and it's possible to set runtime options, like the initial/max heap size.
So, it can be either: with or without the Java runtime depending on how you let Launch4J build the exe.
Perhaps something like launch4j that packages up the jre and jar into a single executable, though it's not been updated for 2 years now. It sounds like it supports Java 9 and later.
For an easy-to-create-and-distribute package, you'll want to create a .jar file. Netbeans can do this automatically when you compile your project if you enable a setting (see here). Note that .jar files require the end user have a compatible Java Runtime Environment installed on their system (most people do, but still). If you absolutely need a .exe, you should look into Launch4j.
I've used launch4j in the past, and it was pretty useful since it will take care of the missing JVM. Other than that, I find that packaging for the distro is the best route, and including any dependencies that are required in the packaging config.
I believe launch4j is cross-platform though, but i've only ever tried it on windows.
For downloadable apps, I recommend itch.io for your free games. Most people use windows, so you'll need a windows packager.
For Java, your code can be packaged into a JAR and then you can use http://launch4j.sourceforge.net/ to wrap it inside a windows executable
For C, I would recommend using Visual Studio to build an executable, and then distribute that.
Basically yes. You need to have the JDK installed to compile your Java code and to create a runnable jar whereas the computer where the jar is to be executed needs the JRE with the respective version of the used JDK. There are tools like Launch4J which wraps your jar into a Windows executable (http://launch4j.sourceforge.net/) but I don't know if there are similar tools for other operating systems.
I think the questions you are looking for is how to deploy Java applications. Here are some hints https://stackoverflow.com/questions/80105/whats-the-best-way-to-distribute-java-applications
There are utilities you can use which generate a small .exe file which just launches your java application. You can even include the java runtime so that doesn't have to be installed on the system. For example http://launch4j.sourceforge.net/
VirusTotal reports fine though (for the GW2Navi_2D.exe file). Was your antivirus flagging the zip or a particular file? I used a popular Java wrapper to make the .exe. You can use the .bat file in the /bin/ folder as an alternative.
I would consider using something like http://launch4j.sourceforge.net/ to build .exes and Mac Applications, as well as proper instructions for download/installation (even if they're braindead simple). Needing to download and run a .jar file just feels janky.
Looks like there's already four classes, a variety of skills and attributes, so the actual game content is definitely there. That's awesome, I'd like to explore that! But it was hard for me to figure anything out. I had a lot of trouble reading the words, they were way too spaced out. I wish I could click things/see feedback for what I was doing. Getting sent to the level-up screen was jarring and I easily could've mis-skilled not knowing the screen was going to pop up. I hate needing to press i just to see what a skill does, it'd be nice if it gave me a description while I was "hovered" over the skill. Also I had 4 skill points, then used them, and then had 4 more for something else? Would be nice to have a progress bar or something so I can understand "where I am" in levelling up (or better yet, make it a pop-out panel so I can do level-up stuff when I want to, and can also look at my inventory/other stats when deciding what to level up).
After I finished levelling up I didn't know what buttons to press/what to do. How could I see my items/use spells/etc? I literally mashed all the buttons on my keyboard and it looked like nothing happened, so I gave up there.
That google credential identifies the application, and is associated with your own google account for billing purposes. The OAuth page gives you an additional credential that gives your application access to another user's google account (limited to the specific rights you asked them for). It's possible to use APIs in a standalone application without publishing the secret part of the credential (see https://developers.google.com/identity/protocols/OAuth2InstalledApp). Don't publish your full credential anywhere - it contains both an id and a password-equivalent, the password should obviously never be distributed publicly.
If you give them all the java code they'll need to install the JDK and compile themselves. A jar with compiled classes can be executed with just a JRE (which will usually already be installed). Self-executing jars are a thing, or you can provide a simple .bat with the jar, or you can use something like http://launch4j.sourceforge.net/.
I've used http://launch4j.sourceforge.net/ in this way. Took about half an hour from download to having my application work like this (because of the learning/readingup). And I copied my installed Java environment into a subfolder of my application (and deleted JavaFX files which I didn't need, saving 30 MB or so - Java 9 will be fun in this regard, because you can reduce it to just what you need). Then I put this whole tree onto another machine via a 7z archive, unpacked, run. Worked like a charm (and that other computer didn't have Java 8, that's why I did this whole thing in the first place). There was no jar, there was only the EXE with icon-look and splash screen.
LibGDX is perfectly capable of doing a KOF-style game. If JRuby is proving a performance issue, there should be no trouble in dropping down to Java for the performance-heavy bits.
I don't know how JRuby works but one thing to be careful of is garbage collection. If you are playing recklessly with object allocation in your render loop you can end up having a game that stutters from repeated GC.
You'd probably have to bundle JRuby up with the JVM in order to give the game to people. Consider what size the JRuby runtime will add to the jar and whether that will affect people's willingness to download it. As for bundling itself, LibGDX has packr. For Windows at least you can use Launch4J.
I've used http://launch4j.sourceforge.net/ with about 20 minutes of learning time to get my GUI jar running on a computer that had no Java installed. You can copy your installed JRE into a subfolder of your application and have l4j use that. No install required on the user's end! l4j can also put your jar into a nice EXE with icon. You can optionally use a splash screen.
Is this the LaunchJ you're talking about? I've not heard of LaunchJ before but I like the sound of it. Got any info links? (Turns out "LaunchJ" is difficult to google for.)
So it sounds like you are going to want to create an executable file with launch4j (http://launch4j.sourceforge.net/) from your jar (instructions should be on that site or just google it) and then adding it to your powerpoint with the following info https://support.office.com/en-au/article/Start-a-program-during-your-presentation-8aee10fa-eb5b-4e8f-a805-d9c899e4e23e also take a look at https://support.office.com/en-ca/article/Start-a-program-during-your-presentation-3f52973d-55aa-413d-9ebd-ffe0b0b4d492
There's also http://launch4j.sourceforge.net/ which I have used with no prior knowledge quite successfully (e.g. I added my installed JRE8 so that the user would not even have to have Java installed).
>
Turning that .jar file into a proper .exe file is only a buttonclick away (and I doubt that linux and mac users really mind): http://launch4j.sourceforge.net/ If that's a problem I'm sure that the WowDoge dev is happy to fix that.
Seems there's a free version (v3.0.3) And the paid one linked above (v5) Are these the same?