How make an installer for a java application? - java

I made a netbeans java application (javax.swing), connecting to the mysql database. The connection is made through localhost. Now I would like to create an installer for this application. In order to install my project on other computers.
What do I need to do in order to create an installer?
I'll have to make some kind of change in the database, or connection?
Do you know any simple program? I've been researching this: http://www.clickteam.com/install-creator-2
Thank you all for your help.
If someone did not understand my question, I try to explain better.
I apologize for the inconvenience.
Greetings.

right click in you project;
click on "Clean and Build";
After that go to the netbeans project folder;
It creats a new folder called: "Dist"
In this folder will have a file ProjectName.Jar (Does an executable of your
application);
After that run the program you mentioned, this will transform executable "ProjectName.Jar" into an installer.
For that try this tutorials:
http://www.youtube.com/watch?v=G8ccin6w4JM&list=PLB04B4E5D9B58C13D&index=114
In this videos you will find a very simple way to create an executable and an installer of your application.

Related

How to assure windows that my app is safe to run?

For my college project, I created a MapGenerator to create maps for the project. It is a group project, so I converted my .java files to .exe using Launch4J.
I then shared it to my friends using Google Drive. But then, while downloading, my friends said that Google said that the download is potentially dangerous. They just selected "Keep" and continued the download. The problem came when Windows doesn't let them to run that app at all. We know it's a safe application and does nothing wrong other than creating .csv files.
So, is there any way to assure Windows that this is a safe application and allow it to run the application?
PS: I use IntelliJ without gradle or maven, just IntelliJ (if this is a necessary info)
You can select the exe you want to run --> Click properties --> Under the general tab beside the security option --> check the unblock. Then it should definitely run
To have your exe like other software , you have to get your exe signed but I don't know how to do it. The solution I gave is a duct tape glue solution and I thought it would help.
You can check this link for more info:-
Signing a Windows EXE file

Java application requires Admin Access to run when placed in Program Files

I am working on a Java (JavaFX) desktop app. I am converting it to exe with launch4j tool and then later creating a setup package using Inno Setup Compiler (default installation path set to C:\Program Files (x86))
The application itself don't need any admin privileges and runs fine when I copy the exe on desktop or run it on drives other than C. (Also works fine if I run it in local appdata folder)
But I need to place it in Program Files (x86) directory.
The app doesn't open if I install it in that directory so I had to create a manifest file for launch4j so that it asks admin access each time it opens. It works fine that way but admin access is asked everytime in this case.
I need to make this application run without asking admin access each time.
If there is any solution, please guide me through it.
Any help will be appreciated.
Ok so I kind of figured that out. I guess the jar was having trouble reading from system directories and I had to do some read/write operations on a config file. So I changed the config path to:
String path = Controller.class.getProtectionDomain().getCodeSource().getLocation().getPath() + "\\Data\\";
Now it creates a folder named "Data" inside jar file and read/write from there. I don't know if this is a bad practice or not but it seems to work pretty good for me.
Thanks a lot to #user31601 who gave me some hint that helped me figure this solution out.

How to set a classpath automatically during the installation of an excutable java application?

I am writing down an example of what I was trying to do.
But this is just one example, I am sure there would be many. So I want a generalised answer for this.
I was trying to make a java desktop application which reads the word documents. I realized I need some Apache libraries/APIs that would help me do it.
So I downloaded the library.
But now I need to set the classpath of the files from the library.
I am a developer and I can do it, but imagine giving such instructions of setting a classpath to a complete non-developer user.
I was wondering if when I am over with the making of this java application, I would make it executable (exe) application and when someone installs it, the classpaths are set automatically during the installation and the apache library files are automatically extracted.
How can I do it? Can someone explain me in detail - step-by-step?
Please consider using some development IDE, like (free) eclipse for instance.
Then crate new folder (clled lib for example) in your project, copy the library into it,
then click on your library by the right button and select "add to build path"
As already mentioned - best way to do it is to use Manifest file in your jar. Official documentation: https://docs.oracle.com/javase/tutorial/deployment/jar/downman.html

Full java code from Netbeans Project

How can I get the full java code of a netbeans project? I have created a project for a contest, but need to submit the whole code. In Netbeans alot of the libraries and classes code is hidden. I need to submit all this. Even if a plugin needs to be installed.
Thank You :)
Assuming you have a NetBeans Project named HelloWorld in your system,let's assume that the default directory of storage of NetBeans Projects is in
C:\Users\USERNAME\Documents\NetBeansProjects\HelloWorld // On Windows OS
/home/NetBeansProjects/HelloWorld // On *nix(Linux,Unix) based OS
If it is different from the above,then please switch to the default directory of the Netbeans Projects.
Select your project folder from that,HelloWorld here.
It'll have several directories(folders) inside.
Switch over to src folder. All the .java files are placed in that directory. Those are the source code in Java. You can open and check and verify those files using any text-editor like Notepad,Gedit,etc.
NOTE :- DON'T DELETE ANY OTHER FOLDER/FILES unnecessarily,else,your NetBeans project won't be recognised/won't run properly.

How do I package a Java program for Ubuntu?

I have an application that currently a user downloads and runs an install script. I want to be able to take the JAR file and such that is generated by NetBeans and make it into a package that a user can download through a package manager. It needs to have menus implemented as well (the entries in the Debian menu that the user can click on).
Currently I am following through this tutorial: http://packaging.ubuntu.com/html/packaging-new-software.html
However, I am worried that I am going down some kind of rabbit hole in the wrong direction. Surely this must be something that is common?
What is the standard procedure for getting your JAR file to other people through packages?
I needed to:
Install dpkg.
Create a directory structure similar to how I would like it unpacked.
Create a shell script that would copy it there.
Run dpkg.

Categories

Resources