Include (bundle) a JRE within the NetBeans Installer? - installation

I developed a Java Swing application on the NetBeans Platform (RCP). I want to include the Windows JRE with the installer that NetBeans generates in case a PC does not have JRE installed, but I do not know how to do this. I have tried to follow the following instructions but failed (I find that the instructions assume that you know absolutely everything on JDK and JRE, for example I would get the message 'pack200' is not recognized as an internal or external command...it would seem that some paths are wrong or outdated):
How to bundle JVM (JRE/JDK) in the installer bundle?
Including the JRE in a NetBeans Platform Installer
Installing the JRE via an Application's Installer via Windows
I am trying to pack the JRE version 7u7
My JDK folder structure is the following:
C:\Program Files\Java\
in here I have the following two folders:
jdk1.7.0_07 and jre7
Please help me...Thank you so much

I have followed "Installing the JRE via an Application's Installer via Windows" in your link to successfully create a Windows installer for my Netbeans platform application.
What are the problems you encountered?
"'pack200' is not recognized as an internal or external command" is because %JAVA_HOME%/bin is not in your PATH (environment variable). You can run pack200 with
"C:\Program Files\Java\jdk1.7.0_07\bin\pack200" -J-Xmx1024m rt.jar.pack.gz rt.jar
Btw, it seems like "app.conf=nbproject/my.conf" part in the article is outdated. I have to modify directly the file "build/launcher/etc/app_name.conf" in my project.

Maybe this guide can help you:
Self-Contained Applications: Package non-JavaFX application
https://blogs.oracle.com/talkingjavadeployment/entry/packaging_improvements_in_jdk_7#3
One of popular questions people ask about self-contained applications - can i package my Java application as self-contained application? Absolutely.
This is true even for tools shipped with JDK 7 update 6. Simply follow steps for creating package for Swing application with integrated JavaFX content and they will work even if your application does not use JavaFX.

Related

How to Fix: An assembly specified in the application dependencies manifest was not found:package: 'System.Data.SqlClient'

We are new to .Net Core and are trying to deploy our first application that uses it. We are deploying to a Windows server which has .NET Core Windows Server Hosting Module (2.2.0), the .NET Core Runtime (2.2.0) and I even installed the SDK (2.2.103) to see if that could solve the problem, which it did not.
Error:
An assembly specified in the application dependencies manifest (accesslog.deps.json) was not found:
package: 'System.Data.SqlClient', version: '4.5.1'
path: 'runtimes/win/lib/netcoreapp2.1/System.Data.SqlClient.dll'
So, here is my issue...the above error is being generated when we try to run a .NET Core application via the "dotnet filename.dll" method. We "publish" the application to generate all needed dependencies, or so I thought. The publish (and thus application) folder contain "A" version of this file (System.Data.SQlClient.dll), but apparently not the right one (version in publish path shows 4.6.26606.5), but yet that is the one being generated by Visual Studio.
Oddly, we also have an ASP.NET application on this same server which runs fine and references the same file.
Any help, guidance, troubleshooting steps, etc would be GREATLY appreciated.

issues with WS2_32.dll behavior between windows 10 vs windows7

Did not find any suitable solution with existing questions so asking new question here.
We use log4cxx which has WS2_32.LIB as dependency. WS2_32.LIB is present in Windows SDK version 10.0.16299.0.
When using this log4cxx.dll on windows7 WS2_32.dll and all its dependencies gets loaded properly and application start normally.
but in windows 10 environment WS2_32.dll expects dependent dll's like API-MS-WIN-CORE-CRT-L1-1-0.DLL which are not part of windows10 or any of the microsoft visual c++ Redistributable which results in application error.
difference in WS2_32.dll and its dependencies between Windows7 and windows10 are clearly visible via dependency walker.
WS2_32.dll on windows 10:
whereas
WS2_32.dll on windows7 is
as shown here API-MS-WIN-CORE-CRT-L1-1-0.DLL is not a dependent dll in windows7 where as its in windows 10 which is not present in the system resulting in application error.
So what should be the way to make the application run successfully? what alternate dependency should be provided instead of WS2_32.LIB while compiling log4cxx.dll to avoid this issue in windows 10? Also where to find documentation about such changes between windows OS versions?
Please suggest.
The old depends.exe doesn't support those API sets and shows wrong data.
use the open source replacement called Dependencies:
Dependencies is a rewrite of the legacy software Dependency Walker
which was shipped along Windows SDKs, but whose developement stopped
around 2006. Dependencies can help Windows developers troubleshooting
their dll load dependencies issues.

Runtime error for QT application?

I have developed an application on Qt5.1 for windows 7 and now I want to distribute it. Since I have used the MINGW compiler I cannot build it static. I used dependency walker to find out all the dlls and packaged it. When I run the application on a machine which doesnot have QT development environment installed the application crashes with Microsoft Visual C++ Runtime Library error.
Could anybody please point me out the problem?
The error was
Fixed the problem:
The fix is add a folder platform into the location of your application executable and into that copy qwindows.dll from the loaction 5.1.0-rc2\mingw48_32\plugins\platforms of your QT installation.
Also all the dlls need to be copied!
It seems like you have missed some DLLs. Try again with dependency walker, I have faced the same issue once. The dependency walker did not show missing DLLs but some were missing. Try to search in SO, there are similar questions.
Do I have to include all these Qt dlls with my application?
How to run Qt 5 applications on other computers (Windows 7)

install4j: How to Obtain Old JRE -OR- Convert Installer to .tar.gz?

I accepted a project that consists of a Java-project that is shipped with an installer built by install4j (we have a license for 4.2.8). I'm required to ship a JRE with it. The problem is that the guy who worked on it before me left and I don't have access to his installation of install4j that would have included the JREs that are currently shipped with the final installer of our project (Java 1.6.0_29).
Within install4j I can select a JRE, but 1.6.0_29 is not listed there any more. My obvious option was to simply use the latest 1.6-version, but that was declined. Therefore, now I don't have a JRE. I can't even build a bundle with install4j since none of my colleagues has that version. Besides that, I'd need it for all our target platforms (Windows, Linux and MacOS).
I think the only options I have now is to
find a hidden gem on the internet that holds old JREs in .tar.gz-format (i.e., if you know such a site please let me know)
download the various installers from Oracle's site and somehow convert them into .tar.gz (however, I have no idea how to convert, e.g. an exe, into a .tar.gz)
I tried to figure out where install4j downloads the bundles. I played around with the URLs, but it seems as if only those listed in install4j are available.
Do I have another option? Does anyone have solutions for the two options I listed?
You can use the "createbundle" command line tool to create a JRE bundle from any installed JRE.
This is available since install4j 5.0. You can install the current version with an evaluation key and the created bundle .tar.gz file will work for 4.x as well.
Bundling a JRE for Mac OS X is not supported in install4j 4.x. This functionality was added in install4j 5.1 for OpenJDK on Mac OS X.

Why does Windows application is requiring .Net 3.5 framework

I have the Target Framework set to 2.0 on my windows application, yet when I try to install my app on the server, after publishing it through VS 2008, it is trying to install .Net 3.5 on the server.
I do not want to install 3.5 on my server.
When I copy the files from my local /bin/debug/ to the server and double click on the exe, nothing happens. On my local machine, my app runs.
How can I make this app run on the server without it needing the .Net 3.5 framework?
Do any of your dependencies require .NET 3.5? Do you have anything in any config files which might require .NET 3.5?
I suggest you take a copy of what you've got for safekeeping, and then cut it down to the very smallest app which demonstrates the problem. In fact, you might want to start from scratch with a "no-op" app and see whether that has the same behaviour.
Check unused references, perhaps? Are you actually getting an error about the 3.5 framework?
Try building the application in release mode and deploy it to the server. You will need to grab the application from the /bin/release folder instead of the /bin/debug folder.
Also, check the target framework under the application section of the project properties.
If you're using Visual Studio to build your setup project, open the setup project's properties and look through the settings. One setting says which .Net version will be demanded by the installer package. You have to set that; it doesn't inherit from known properties of your other projects.

Resources