Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I find out the version number of the Flash player installed on my system in Java?

I currently run OS X, but the solution should be OS-agnostic.

share|improve this question
1  
Javascript is run in the browser that displays the website. It'll read the script and evaluate it line by line. You can't do that from Java, at least not run it in the context of that website. Can you please elaborate on what you're really doing? Why would you need to get the version number in Java? I just think you're approaching this the wrong way. –  slhck Jun 13 '12 at 20:47
    
I just need to get the version number of the flash player. I could not think of another way to do it using only java. –  Kevin Doherty Jun 13 '12 at 20:49
    
Well, that depends on which operating system you're on. Does the question make more sense to you now? –  slhck Jun 13 '12 at 20:51
    
Im using a mac but the program should run regardless of the OS –  Kevin Doherty Jun 13 '12 at 20:52
    
Do you have the XY problem? meta.stackexchange.com/questions/66377/what-is-the-xy-problem –  ChimneyImp Jun 13 '12 at 20:55

1 Answer 1

up vote 2 down vote accepted

You can try to read the plug-in's configuration/helper files. This depends on where they're stored on each OS.

OS X

For the system-wide Flash, read the following XML file:

/Library/Internet Plug-Ins/Flash Player.plugin/Contents/version.plist 

The version number is the text value of the first occurrence of <string> in the <dict> element. For example:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>CFBundleShortVersionString</key>
        <string>10.2.159.1</string>
        <key>CFBundleVersion</key>
        <string>10.2.159.1</string>
        <key>ProjectName</key>
        <string>FlashPlayer</string>
</dict>
</plist>

Google Chrome on the other hand ships with its own version of Flash, to be found here:

/Applications/Google Chrome.app/Contents/Versions/21.0.1171.0/Google Chrome Framework.framework/Internet Plug-Ins/Flash Player Plugin for Chrome.plugin/Contents/Info.plist

Replace 21.0.1171.0 with the newest folder you can find in there. In the Info.plist, look for the first <string> child following the <key> with CFBundleShortVersionString as its text:

...
<key>CFBundlePackageType</key>
<string>BRPL</string>
<key>CFBundleShortVersionString</key>
<string>11.3.300.257</string>
<key>CFBundleSignature</key>
<string>MOSS</string>
...
share|improve this answer
    
If anybody knows where to find this in Windows or Linux, go ahead. –  slhck Jun 13 '12 at 20:58
    
Does this work if all they have installed is the latest version of Chrome? I know Chrome ships with Flash internally, but I don't know if it registers it in the usual places. –  Darth Android Jun 13 '12 at 21:11
1  
Ah, of course. It's buried within the application bundle. I added that to my answer. –  slhck Jun 13 '12 at 21:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.