What is i4jdel.exe doing in EXE4J-wrapped java-applications? - java

If I run a java-application wrapped in EXE4J to make native Windows app then on the startup it will create and run an executable called i4jdel.exe from within user's temp-folder. Unfortunately, some antiviruses classify this program as malware.
What this i4jdel.exe is really about? What does it do, and, most importantly, are there any official sources confirming its genuineness?

Related

Netbeans RCP application not working outside the IDE when built as OS independent zip

I am building a statistical analysis application on Netbeans RCP for solving tests faster and with less effort https://github.com/PaulMaxAvalosAguilar/Statistikos-Klubas.
The thing is very simple:
1.-There's a module called TrabajosViewer which uses the nodes API to display workspaces where you can organize your samples with some meaningful name, first you create a workspace and then you add some data to it.
2.- You open editor top component which calculates some descriptive satistics stuff for all the sample you entered
3.- All stuff you need for a test is done! Samples are stored in an embedded H2 database(datos module) and results are calculated each time you click on a TrabajosNode.
However when I was testing the app I had to add the following sample:
https://1drv.ms/t/s!AkZmosJJMvdIu3c_IiVkD6JAVVgk (3344 elements); as the app had multithreading capabilities everything was fine, except that after building a release as OS independent zip the app froze from the swing Top Component which was very rare as that wasn't happening on inside Netbeans IDE. I think it has something to see with the build script since I built a Gradle version an everything worked fine https://github.com/PaulMaxAvalosAguilar/Statistikos-Klubas2
If you have an app - any Java app really, not just NetBeans RCP - and it freezes then what you want to do is obtain a thread dump. The thread dump will almost always give the clue as to why there's a freeze.
Java has 5 or 6 different ways to obtain a thread dump for a running application (just google it). Out of these methods, the one preferred is the so-called Ctrl-Break method because it is the one which gives most information. The downside of the method is that you need to have started your application from a console window. But if you can consistently replicate the freeze, then I don't think that's a problem for you. Here's what you would do if you are on Windows:
Start cmd.exe
From the command window, start your application, e.g. bin\sillyapp64.exe.
Wait for the freeze to happen on your application
Now press Ctrl-Break in the command window. This will give you a thread dump printed into your command window.
Upload the thread dump as part of your question. (or host it somewhere if it is too big)
Instructions for Linux/MacOSX are similar albeit in step 4 you would instead send your process a QUIT signal using the kill command.

Install and uninstall a java application in ms-windows

I have created a java application.
I also created another java application which install the first application.
The program runs perfectly.
However the program isn't displayed in control panel->programs.
I also want to create an uninstaller (let's say unintaller.bat). But i want to works like any other uninstaller. When someone goes to Control Panel->serach program->uninstall this program it will run the uninstaller.bat
In other words, the concept is how to declare the java application in windows...
Any idea???
Installing an application doesn't necessarily mean registering it with the operating system. For example, for a Mac, I can open an App without having it added to the Applications folder.
Same with Windows. Just because a new file can be added to the Start menu, it doesn't mean it was registered.
Use a Windows installer. There are tons that are open source, and even MS provides a free one: http://support.microsoft.com/kb/942288.
This will allow you to install an uninstall an application using standard tools. Yes. It can be called from a bat file.
Java open source installers: http://java-source.net/open-source/installer-generators

Run Jar file on startup?

I have a Java application that lives in the system tray that I compile to a executable jar file. I would like to add the option within my program to add to the system startup items.
As I do not know of any uniform way to do this for all operating systems I assumed I would have to write code to do it for each one I intend to support so I started with Windows.
When I attempted to add it to the registry at [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run] using the code available here I discovered that under Windows 7 and 8 unless I have administrator privileges (by running from an elevated command prompt) my edits to the registry do not apply.
Then I spent a day trying to figure out how to get the Jar to relaunch itself with admin privileges before I gave up on that hacky workaround.
Can the task I'm trying to achieve even be accomplished and if so how?
For the most part, you're actually looking to add the feature of auto starting on user login, rather than on system startup. For windows, if you add the registry entry under:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
This location does not suffer from permissions issues when run as an ordinary user, and has been supported for a long time under Windows (I'm thinking Windows 95 time frame here), so should be a safe change across all systems.
For Linux, assuming that the operating system is following the Open Desktop AutoStart specification, then you need to create the appropriate .desktop file in $HOME/.config/autostart/ and it should autostart on login in that case.
For Mac OS X, you need to create a launch agent plist in $HOME/Library/LaunchAgents. The Daemons and services documentation details how to construct this file.
Working around user privileges is not a good idea. The registry entry is the preferred way to go. Also keep in mind that the jar by itself is not executable, it requires the jvm, so what you might want to do is use a wrapper and register that.

Installing java program via CD

I have a program (java jar file) that I want to distribute on CDs. My friend told me that there are free/open-source CD installers available that automatically install your program onto the customer's computer.
Now I can't seem to find this on Google. So are there any CD installers that you would recommend that I can use (so I don't need to program one myself).
Outline:
My program consists of class files, sound files, source files (i'm open source) and images (packaged into a jar file).
I only need the installer to work for Windows computers.
I think IzPack does something like that.
You can look into Java WebStart which in Java 6 was enhanced to allow "launch-from-cd-and-install-to-harddrive" which mean that it can work as a very simple installer.
It requires a JVM already present. You can put the redistributable JRE on the cd too.
Launch4J is what I have used as my installer. It is really lightweight and has a nice GUI that makes things simple for the developer (one reason I chose not to use IzPack).
It makes things dead simple for both the developer and the user.
Your jar file is wrapped in a exe launcher.
If an up to date JRE is not detected, a bundled JRE is used or the user is prompted to download via java.com/download
Really, I couldn't have asked for anything simpler/better. Although you might get more functionality out of IzPack, if you want something dirt quick that can do everything the everyday developer needs, go for Launch4J.
P.S. Their splash screen option is a nice bonus :)
After running into numerous end problems, I finished the job with the use of Inno Setup.
Very quick and easy to use. Creates an installer similar to the ones you would see in popular programs. Gives you (and the user) the ability to create Desktop Shortcuts, QuickLaunch Icons and Startup folders. Allows you to add license information etc. Very simple and intuitive interface, I didn't have to read any documentation!
A big con: Only makes installers for windows. That met my requirements, but may not work for everyone.

How can I suppress MATLAB's command window when calling it from Java?

I am calling MATLAB with Java but I want to suppress the command window of MATLAB to make users feel that I use only one program which is Java.
In addition I read about something called standalone executable for MATLAB, but it didn't work; will that help me?
Check out the Matlab Engine. The engine runs in the background (without a GUI or visible command-line) and you call it from your code. The examples are in C and Fortran, not Java, unfortunately. I got it working with Python once but I don't recall the details.
Also see: 2 ways to use the engine with Java.
ETA: 'matlab -r "statement"' on the (Windows) command line will execute "statement" in Matlab. My Python hack was putting my Matlab code in a .m file and my data into a text file referenced by the .m file then sending 'matlab -r myFile.m' to the Windows command line. See the matlab Windows command. Again, there's no visible GUI for Matlab this way.
When you say "calling it from Java", are you shelling out to Matlab for batch computations, or do you want to embed a long-lived Matlab session in your process and call M code repeatedly from Java code? What OSes do you want to run on?
Matlab has some deployment tools that let you embed a Matlab interpreter and a collection of Matlab source code inside a host language, such as C/C++ or Java. This is what the "Matlab compiler" is - not a real compiler, but a tool that packages a Matlab runtime along with .m source code in a package that looks like a DLL or application. A Matlab "standalone application" is Matlab code that has been packaged this way along with a thin C wrapper that calls an application entry point in your M code.
The Matlab Java Builder is a similar thing that bundles this deployed Matlab engine inside a Java class. If you want to get a license for it, that could make it easy and cosmetically clean to embed Matlab inside your Java application. This is probably what you want.
These deployed Matlab apps do not have a command window because they're intended to blend in with your application. They live in the same process. And, importantly, they do not require license fees for running the deployed app. Shelling out to regular Matlab requires all users running it to have licenses for Matlab and each toolbox that is used.
If shelling out, the "matlab -nosplash -nodesktop" command line will suppress the GUI on Unix. But on Windows you'll still get a minimal Matlab command window. The "-automation" switch on Windows will at least make it minimized. I don't know a way to suppress it entirely on startup.
However, once Matlab is running, you can take advantage of the fact that the Matlab GUI is itself implemented in Java, and have it hide itself. Get your Matlab session to run this hidematlab() using the "-r" command line switch or a startup.m. Note that this is a hack using undocumented Matlab internals and is surely unsupported by MathWorks.
function hidematlab()
%HIDEMATLAB Hide the main Matlab desktop window (HACK)
dtWin = desktopwindow();
if ~isempty(dtWin)
dtWin.setVisible(0);
end
function out = desktopwindow()
%DESKTOPWINDOW Find the main Matlab desktop window (HACK)
wins = java.awt.Window.getOwnerlessWindows();
out = [];
for i = 1:numel(wins)
if isa(wins(i), 'com.mathworks.mde.desk.MLMainFrame')
out = wins(i);
return;
end
end
Beware of gotchas when shelling out on Windows, where Matlab is inherently a GUI app. If your M code throws errors that bubble up to the top level or segfaults, you may find your Matlab session hung, waiting for nonexistent user input, instead of returning you an error.
I don't know of a way to do what you're asking entirely. If your script does an exit manually instead of naturally terminating, you may be able to start the script so that the window that pops up is minimized.
See Launch Application in a minimized state from Java
Start the script with
matlab -nojvm -nosplash -nodesktop -wait -r script_name
You will want the "-wait", otherwise MATLAB will immediately return.
See How can I stop MATLAB from returning until after a command-line script completes?
matlabcontrol is a Java API which will allow you to interact with a running session of MATLAB. It will launch the session and then you will be able to invoke eval and feval as well as set and get variables. By default the session of MATLAB will be visible, but it can be hidden. On Windows it will not be entirely hidden because that is not supported by MATLAB, but it will be started minimized and no splash screen will be shown. To get started using matlabcontrol, take a look at the walkthrough.

Categories

Resources