Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm going to study java via the Book "Head First: Java".. So im going to use Eclipse, when I was in 3rd year college, we do very basic Java programming, we only used Notepad++ and command prompt for compiling.
I like to know if I can make exe using eclipse and java alone. What about GUIs? I only done application in android, so I code using "button.setText"" things, but what about Java application for desktop, how can I make GUIs? EXEs? Are there other programs I will use?
I would start creating simple PC apps like a calculator. How can I do that?
Launch4j is a cross-platform tool for wrapping Java applications distributed as jars in lightweight Windows native executables. 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. The wrapper also provides better user experience through an application icon, a native pre-JRE splash screen, a custom process name, and a Java download page in case the appropriate JRE cannot be found.
I would say launch4j is the best tool for converting a java source code(.java) to .exe file You can even bundle a jre with it for distribution and the exe can even be iconified. Although the size of application increases, it makes sure that the application will work perfectly even if the user does not have a jre installed.
If you only want to use Eclipse and java, then you probably should use SWT and, optionnally, RCP.
SWT is a native widget toolkit allowing you to build applications and RCP adds a framework layer to build complex applications like Eclipse itself and package them as exe (on windows).
But note that building desktop applications as exe is demanding. Before you dive into RCP you might want to look for other solutions, even if they require additional frameworks or tools you don't have in Eclipse.
To make GUIs Eclipse has Window Builder Pro, which allows you to make GUIs easily
https://developers.google.com/java-dev-tools/download-wbpro?hl=pt
For make an executable (jar, in Java case), Eclipse is enough. If you really want to build an ".exe" there are many plugins you can use, such as Launch4j
For making drag and drop GUI, eclipse doesn't provide functionality. For drag and drop GUI, you have to go with Netbeans. For creating .exe, you have to use some third party jar to exe converter tool.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I have several questions about dockers for freshers, could somebody help me please?
As I learned, containers don't have OS inside of them, they all share one OS of the cloud server.
But what if I want to deploy app that was written from diff platform?
For example I have Linux on server, but on my own machine I've Windows.
So I develop java app, using JDK for windows..
Now I use docker to build the image (as I understand I should pack my app, its libs and JDK for windows at one container with help of docker file and put it to Linux Server...so how my app will work on Linux inside of container?)
Please help me to understand how does it work, becouse I miss something here
Scalability. Why we want to copy the applications on server (as written, the containers are very lightweight and easy to copy), why not to use multithreading?
Containers do have OS's - for example you can run AlpineOS or Fedora containers on Ubuntu. The package space and libraries are not shared with the host.
Java doesn't care where you run it; Docker is not a requirement. In any case, you can package the app with a Windows JDK (no container) and copy it into a container with only a JRE (you should only need a JDK to compile). Or you use multi-stage Docker builds to use a Linux JDK to compile and package your artifacts, then copy that into the same JRE runtime layer
Containers and multithreading aren't exclusive. Besides, I think you meant multi-processing which would require an external supervisor process (which is specific to the OS), compared to using a container orchestrator. Also copies of the application artifact shouldn't be needed, only memory space needed for the process(es)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
There is a way to put a computer program with .exe extensions in the Android program and then run them through the program.
I have read about ndk and win, but I do not know exactly how to use them
Please describe with an example or give full reference
You are trying to run a binary application (intel x86 .exe for windows) on a different architecture and platform (android running on ARM or Arch64).
I can think of three options:
Option 1: Emulation
The traditional approach to running binaries for different architectures is emulation, for example using Qemu.
However, that still leaves the different platform. If your exe file uses a GUI and a filesystem, for example, you suddenly also need to emulate parts of the operating system it expects, or ship a copy of some Windows variant with your application, which would have all kinds of copyright constraints.
Finally, keep in mind that Android devices have completely different input mechanism than a traditional Windows PC, so you would have to link the Android virtual keyboard (and touch events) to a keyboard and mouse for the emulated Windows PC.
This is not impossible, but will require a tremendous amount of supporting code.
If you choose to go this route, I suggest you first buy a desktop-like ARM device like a Raspberry Pi and get it working there.
Option 2: Decompilation and porting to Android
You can find decompilers that turn the .exe file back into a set of compilable C or C++ files. This would allow you to carefully extract the functionality you need and wrap it in Android native code. This was how OpenRCT2 and Diablo were ported to other platforms like Linux and macOS, years later.
You should not expect the decompiled source code to resemble anything you would write yourself, but with enough time you can end up with something Android-native (or linux, or macOS, or even iOS).
Option 3: Host the application elsewhere
Finally, you could opt to NOT port the application to Android at all, but rather host it on a Windows machine you can run 24/7, and make it accessible on your phone. Depending on the application, this could take the form of a web service that runs the .exe with input from the web, or a full-blown remote desktop/VNC session where you can interact with the application using your phone's input methods.
This question already has answers here:
How to make an executable JAR file?
(5 answers)
Closed 6 years ago.
I've got a bunch of data stored in tables through Mysql on which I've done some analysis and also export microsoft excel to make graphs and such but the customer wants it to be a desktop application which I have never done before. Currently working in Eclipse. What is the simplest (or any really) way to make a desktop application?
EDIT: I don't think I was clear and that is my fault. I know how to make a GUI in Eclipse I just don't know how to make the desktop icon that will bring up the GUI I make.
For beginners you can start with Swing or JavaFx. It's easy to learn plus they have some excellent tutorials or you can look use more mature Java Frameworks such as Apache Struts, Spring MVC etc.
You can also try netbeans IDE. It has native support for building JavaFX Application and Swing application.
Just make sure you install required plugin to setup your environment in eclipse. For JavaFX you'll need JavaFX plugin: e(fx)clipse.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I was looking for java plugin in Vim. Yesterday I came across Eclimd. After going through the guide to install Eclimd from http://eclim.org/ I am able to run eclimd.
For running eclimd, eclipse is required and has to run as server.
My question is, why to run eclimd over eclipse? What gains do eclimd over eclipse give?
Also, (it's been only few hours that I have used eclimd) it seems Eclipse is more friendly.
Could anyone suggest reasons for the preference of eclimd over eclipse.
Vim is much better at text editing than Eclipse, even with a Vi-emulation plugin.
Eclipse is much better at understanding your code and interacting with the Java toolchain than Vim, even with all the Java plugins you can find on vim.org.
Eclim is a way to combine the distinctive powers of Vim and Eclipse. If you don't care, by all means don't use it and keep doing what you did before.
Vi doesn't have features for auto complition or code validation afaik for any programming language. It does provide syntax highlighting capabilities , but that's all.
Eclipse provides these features to Eclimd.
Eclimd is a client to Eclipse, that's why you can't run it without eclipse.
I hope that clarified it.
BTW: Eclipse does its syntax checking by running the javac (when used for Java programming),
while vi(m) usually doesn't support direct calls to other tools in its extensions.
But if you are focused on Java Development, you should, imho, use an ide. Eclipse is a good one, there are others such as JDeveloper oder Netbeans.
That's not only because the clear structure of projects, the integration into the build process but also because due to the different stages a Java - Project usually has.
It often starts with a desigining period, where you model your application in UML.
While developing, automated functional test will usually be developed, too, they should be designed also. After that there come the integration tests. Most ides suit much better for this when a vi - plugin could.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have been looking everywhere, and being a novice at Java and lacking proper terminology it seems impossible to find this.
I assume the correct term is "wrapping", but looking at other Java applications, such as: Minecraft, and seeing how pretty the launcher is and custom buttons, it seems impossible to accomplish such a feat with JFrame.
Do they code their own sort of frame? I've heard that you can "wrap" Java code in like C++ to make the launcher, and after passing the screen is launches the game (minecraft.jar).
Also, how is the exe file created? That once it is run it checks for a patch from the server, that installs the necessary files in a given directory and checks there for save files?
Is it another language? if so which? Which do You recommend? A resource for learning all of this?
These are the main aspects that I've been struggling to learn as no one seems to ask a similar question as I.
Also, considering Java is cross-platform, my main targets are Windows > Mac, for now I can't be bothered to worry about Linux considering I'm already struggling so much here; so for now, how to create a Exe file, if need be, in C++ or any other language, then perhaps DMG for Mac.
You have a lot of things to consider. I would suggest that for now you use Java WebStart to launch your application. This gives you things like:
Easy distribution - put files on a web server somewhere and a JNLP file describing how to glue your files together.
No messing with EXE-wrappers and multiple distributions - this is in the standard Java installation.
Easy updates - just create a new set of files (don't update jars in place) and a new JNLP and thats it.
A sandbox without any effort. Full access to the machine needs code signing which these days is a moving target. Sandbox should be enough for quite a bit though.
Then when you find you have enough users to warrant platform-specific distributions, you can add these as needed instead of getting everything working up front, where you should be concentrating on your application instead.
If you do not want to go the JNLP route, there a number of tools which can do what you ask for.. my favorite is launch4j, which is easy to use via the launch4j-maven-plugin, see e.g. this launch4j-demo illustrating how to use it.
PS: Alternatives include http://sourceforge.net/projects/jsmooth/ or http://www.ej-technologies.com/products/exe4j/overview.html (.com). Note that similar Qs to this with more have been asked on How can I convert my Java program to an .exe file?, How Can I convert Java To Exe, Best free tool to build an exe from Java code?