简体   繁体   中英

Embed (internalize) java in your desktop application

I am trying to embed (internalize) java into the installation directory of my application. Looking at the documentation and all other help available that I could go through I copied the java directory to the application one and then set all the environment variables and paths as prescribed. However, when I launch the application using this new java directory it gives java not found error. Can someone give me some tips?

Thanks in Advance!

I wish you good luck in this task but may I ask you why do you want to do this? If you really wish to put java under your application install java there. You can use silent mode of installation. I do not remember the syntax right now but if you are on windows, java is installed by Windows installer, so search for "run windows installer silently" and follow the instructions. I believe that this approach will work on better and easier.

However, when I launch the application using this new java directory it gives java not found error. Can someone give me some tips?

You've obviously not set up the %PATH% environment correctly. That's what is causing whatever is launching Java to say "java not found".

You could:

  • modify whatever is trying launching Java to print out the environment variables, or
  • change whatever is trying launching Java to use the absolute pathname for the "java" command.

将源下载到WinRun4J(在Windows上是javaw的替代),并查看它们如何初始化JVM。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM