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
Solved

determine java version for windows installer

Posted on 2013-05-18
4
438 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
  • 2
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
phoenix5ire earned 500 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Title # Comments Views Activity
Android development question 2 52
DCT of  2D array using fftw in c++ 9 62
FInd Image Control Gridview 3 19
asp.net open new page without popup blocker 8 18
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

809 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