Solved

determine java version for windows installer

Posted on 2013-05-18
4
414 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
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…
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 learn how to clear a vector as well as how to detect empty vectors in C++.

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now