?
Solved

determine java version for windows installer

Posted on 2013-05-18
4
Medium Priority
?
456 Views
Last Modified: 2013-05-18
I am building a windows installer program.  I need to know the java version so I can load the correct jni.h in the project.  I cannot use a command window, I need to do it in code.  Any ideas?
0
Comment
Question by:dhenderson12
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
phoenix5ire earned 2000 total points
ID: 39177451
0
 

Author Comment

by:dhenderson12
ID: 39177543
thanks, that helped a lot and you get the points.  I a followup question, if you don't mind:
The programs that the installer handles all make reference to the jni.h file (and some other java header files as well).  Now that I know the path to, and current version of, java I can build the individual programs and the installer.  But what happens when java update occurs? do I need to re-build the release again, or is there a way to have an include statement that will read an external value and act accordingly?
0
 
LVL 3

Expert Comment

by:phoenix5ire
ID: 39177592
Thanks for the points. :)
To answer your question(s), I'm assuming Java is require to run your program. Once Java is installed, it has an option to auto-check/update on the computer that it is installed. This update check is independent of your program.

Regarding your 2nd question about recompiling a new release because of new Java version, if I understand your question correctly. If the (intent) code is to check/verify the installed Java version on the local machine, the Java registry key is static in Windows machine, I would continue to use the same key for the installer to check/verify the version of Java. Each time your program is install, the verification will check the same registry key and if the require Java version is met, your program installs, if not, it should prompt the user (installer) to download the current Java version before proceeding, the Java download URL is static for the most part, URL is: http://java.com/en/download/index.jsp
 
Let me know if this answer your questions.

Thanks.
0
 

Author Comment

by:dhenderson12
ID: 39177597
sort of ... I guess it depends on whether or not java plays nice with future versions on the client machine ie.: i build with 1.7.0_6 and the client has 1.7.0_12 (or vice versa).  Thanks, I have more research to do.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall‚Ķ
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question