how to package JRE with jar file so as to run on Java independent machine - jar

I have to run my jar file on a machine which does not have java installed. I went through this link:
http://www.java.net/node/655012
but I dont know how to do it. Can anybody tell me the steps that are required to be done to achieve this?
Thanks.

Wrap with launch4j to get an EXE file or deploy with java Webstart to get a clickable link on a web page (which prompt you to install Java)

Related

Codelite Sample code Executable

I am just started exploring codelite. I have written a sample program hello.c to create a window and it will display "Hello World". Executable hello.exe is available under Debug directory. When i execute that from my system its working fine.
I have copied the hello.exe to my other system and tried to execute from there and i got error message "The Application was unable to start correctly. Clock OK to close the application".
Is it not possible to run the executable created in one PC to other PC? Do i need to any specific option during compilation?
Also i have installed MingW 64 bit and GTK 3.6.4 in the PC.
You are missing some information in your report, for example: when the error dialog was shown, did it say which error code or why it failed to launch?
Did you try using dependency walker to check whether you are missing some DLLs that exist on your computer but not on the other PC?
If you are building using a MinGW-64, then try to use dependency walker for 64 bit applications to see which DLLs are missing

Qt program does not run and exits immediately when run on another computer

I want to deploy my QT program and I can't find the reason it doesn't work, maybe you guys can help me ?
I work with visual studio 2010, windows 7, QT 5.0.2.
I have tested my deployment tree on my own computer and it works fine.
When deploying my application I ship every necessary dll that I am aware of. Depends.exe does not complain. I also deployed the plugin I know of, and since it still did not work I moved my entire plugin folder in the exe folder.
When I execute it on any other computer than my development computer, the program exits instantaneously with no message whatsoever.
Any idea where I should look now ?
How can I debug that kind of issue ?
Did you try deploying the debug version of the program and then starting it from the command line. The debug version will output more information to the console which could help you resolve the issue.
You will have to also deploy the debug versions of the MS c-runtime libraries.
Deploying the debug version is not a permanent solution, so you should not adopt that as normal routine for distributing your software. I am just suggesting that you try running the debug version one time on that particular machine until you figure out the issue. Then remove the installed program and install the release version again.
You can run your application using QtCreator:
Debug > Start Debugging > Start and Debug External Application...
This can give you more information about what's going on.

Location of the program in the JDK that opens .jar files(double-click)

I would like to know the LOCATION of the .exe in the JDK that opens .jar files. What I mean is this: Which .exe in C:\Program Files\Java\jdk*version number*\jre\ opens the .jar files, so that they can be opened using a double click? I used to be able to do that, when I newly installed the JDK+JRE. Unfortunately, Nokia PC Suite has made itself the default program for opening .jar files, so that it can install them on my Symbian. Which program do I 'Open With' to get back the old functionality? I already know how to do it from the command line, but this is easier.
There is no specific program to run jar files.
It is java.exe only with the -jar option
For eg.--> java -jar "foo.jar"
Right Click on a jar file and go to its properties. Change the default opening program to java.exe.
I hope that should work.
use javaw.exe if you don't want the command window.
This convention is widely followed by others like perl/python/ruby as well.
I know how frustrating this issue is. I looked all over the internet forums before I finally found the problem...Here is the answer below :
"The root cause for the problem above is, that a program has stolen the .jar association. If you have installed the Java Runtime Environment the first time, the file type called "jar" is assigned to javaw.exe correctly. "jar" is an abbreviation for "java archive" and javaw.exe is the correct program to execute a .jar. However, on Windows any program can steal a file type at any time even if it is already associated with a program. Many zip/unzip programs prefer to do this, because a jar is stored in the .zip format. If you doubleclick on a .jar, your pack program opens the file, rather than javaw runs the program, because your pack program ignores the meta information which are also stored in a .jar."

SQLite deployment fails unable to locate system.data.sqlite.dll vb.net

Hoping that I do this corectly.
I am having the above issue. My development machine is win7 64. Im developing x86 application,(x86 set in compile options). I have downloaded sqlite-netFx40-setup-bundle-x86-2010-1.0.81.0 as my app will be on .net4. I have referenced the above dll, set it to copy local. Can confirm that its in the deployed dirrectory. Tests OK on development machine both as a debug and a fully instaled app. When I put the app on a separate win 7 64bit it wount run due to the Dll. It installs ok into ProgramFiles(x86) and runs untill the database is required. The dll is in the instaled dirrectory when instaled on the other PC. (fresh win instal).
I am using InstalShield and it is also telling me about an error ' -6248: Could not find dependent file system.data.sqlite.dll, or one of its dependencies of component' but it compiles OK.
Im stearing at the Dll in the program , in the references, the intelisence picksup the SQLite name and all the code is right. I have referenced by browse and then finding the dll.
What on earth could I be doing wrong ?
This has had so many views that I decided to answer this so as to help others.
The problem isnt a big deal once you know what it is, despite the error message that sends you almost in the wrong dirrection. The problem isnt the DLL, its one of its dependancies. Basicaly you have to install C++ distributable file on the client machine , even if you are using VB.net. I cant take credit for the find, it comes from here http://justanothersoftwareengineer.blogspot.com.au/2011/08/how-to-make-systemdatasqlitedll-work-on.html.

Problem running Java application

I have developed a Java swing application, then I have deployed it through a .jar package.
I run my application on my PC double-clicking over the .jar file and everything goes fine, everything goes fine from command line (dos prompt) too.
Here my problem.
I have tried to run my app on another PC:
same OS (Windows XP)
same JRE (1.6.0_U13)
but Oracle JInitiator 1.3.1.18 installed (this is the only difference with my PC)
The app works fine only from command line, but not from gui!
Double-clicking over the .jar file I get this error:
`Could not find the main class. program will exit!`
Can this error be due to some conflict between JRE and JInitiator?
Does anybody had the same trouble?
Thanks
edit:
executing .jar files from gui is associated to the "javaw" command
It is probably a conflict with JInit, which changes the association between jar files and the java command used to launch them.
See this thread.
Re-installed java and the problem has gone away.
A quick description might be - jinitiator installs as a fully implemented JRE with some additional features for cached downloads when dealing with applets.
As all the JRE installers I've seen lately do, regardless of if they are new or old, they replace several entries in the registry to become the active JRE. Whatever you installed last will be run unless you provide a full path to java.exe or change the registry to re point at a different JRE.
examine:
HKEY_CLASSES_ROOT\jarfile\shell\open\command
and see if the path to javaw.exe is correct. (or even included)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App
Paths\java.exe and javaw.exe and javaws.exe to check the path there also.
Have you checked your PATH/CLASSPATH/JAVA_PATH variables. It is possible that Jinitiator has installed the wrong version at the front.
Possibly check your manifest entries. See if the MANIFEST.MF in the jar contains the Main-Class attribute set correctly to the class that is supposed to be invoked, if not try setting it.

Resources