Need to check JDK and install it using Swing

Hi,
I need to develop a swing component where it has to automatically check in the users machine whether JDK is installed, if not it has to install the current version of JDK. Can any give some idea on how to move forward on this or any code would be helpful.
Thanks

Velasquez wrote:
I need to develop a swing component where it has to automatically check in the users machine whether JDK is installed, ..Why the JDK, as opposed to a JRE?
Also, why no [Duke stars|http://wikis.sun.com/display/SunForums/Duke+Stars+Program+Overview] offered for this thread? Is it not important to you?
Velasquez wrote:
..if not it has to install the current version of JDK. Can any give some idea on how to move forward on this or any code would be helpful.An earlier reply mentioned how to get the Java version for the currently running JRE. The [java.library.path, java.ext.dirs & sun.boot.class.path|http://pscode.org/prop/all.html?prop=java.library.path%2Cjava.ext.dirs%2Csun.boot.class.path]* properties might help you determine if that JRE is part of a JDK. For most developers running a Java application, that would be the case.
* I checked those properties in an application and each one mentioned 'JDK' somewhere, but that will probably never appear in any applet.
OTOH, I took an entirely different, and much simpler, route when developing the STBC. It is a compiler that requires the tools.jar of the JDK - which is not normally available to applets or webstart applications. Since this tool was aimed at developers, and they can get a JDK free from Sun, I simply offer them a file chooser to browse to the JDK they have already installed.
There was another option that I considered and rejected as 'too much work'. Go to the root directory of the JRE (having got the path from properties) and then go to the parent directory. If both JDKs and JREs are installed, they should hopefully all be under the one directory tree. Then look at the file names for each directory listed, searching for jdk and the string that determines version. Very hackish, but if you can implement it, I guess it would serve for 95% of the time (though I would prompt the user about installing a new JDK and instead offer them a file chooser in case their JDK is hidden somewhere else).
Don't be too afraid to pop a dialog to ask the user for help. After all, if the user is running the program, and it asks them to 'help it to help them', it is not as if they are going to refuse. Most developers (for example) would prefer to be asked than risk having some 'automagic' tool go off and make wrong decisions that they cannot control.

Similar Messages

  • I have a box that will not go away, it says,  "To open JavaApplication, you need to install a Java SE 6 runtime.  Would you like to check for and install one?  If i push not now, it keeps popping up, if I push install, it says it's not available, help.

    I have a dialogue box that will not go away and it seems to have started when I upgraded to Mt. Lion.  the box says, "To open JavaApplication, you need to install a Java 6 SE runtime.  Would you like to check for and install one?  (smaller print)  Note: Usw of this software is subject to the Software License Agreement applicable to the software you are downloading.  A list of Apple SLAs may be found here: htp://www.apple.com/legal/sla/
    Finally there are two boxes to click.  One says not now.  If I click on that the box goes away for 2 to 3 seconds and then pops back up and WILL NOT go away.  If I click on the second box, Install, it says  The software is currently unavailable.  To install a Java SE 6 runtime later, open Java Application again.
    My confusion here is that I have no idea what the java application is, When I click "okay" on that box, the original box pops us again and WILL NOT go away. CGoing to the apple lega web site was no help.  My solution so far has been to drag the dialogue box as far to the lower right and out of the way as far as I can.  Help.

    Does this happen immediately after you log in? If so, one of your login items is probably causing it.

  • I have a mac book pro with Boot Camp that also runs windows.  I upgraded to Lion and somehow it crashes the mac side peridoically.  I am told I need to "clean" it and reinstall lion using the recovery drive.  will that delete the windows partition too??

    I have a mac book pro with Boot Camp that also runs windows.  I upgraded to Lion and now the mac side crashes/freezes periodically, especially iphoto.  I am told by the genius' that I probably need to "clean" it and reinstall lion using the "recovery drive" which resets everything back to default and reinstalls the lion operating system.  My question is will this also delete the "windows" partition drive and all that data too.  If so that will be a huge pain in the ___ to back up and reinstall boot camp and windows. I want to shoot the lion.

    There is no system like Acronis for the Mac platform. You can try using the buiilt in Disk Utility to create an Image of the complete Mac drive but I have found that this does not work very well as on tryiing to restore it gives errors sometimes.
    You can use SuperDuper or Carbon Copy Cloner to create a bootable Clone of your system partition. But that is only for the System partition and not the complete drive.
    If you use Boot Camp to install Windows on your Mac neither of those two programs will clone the Windows side.
    Neither will Disk utility as Mac's can not create or write to a NTFS partition. So some other program is need for that.

  • I just bought a 15" macbook pro, do the cds that come with the mac have the drivers i need to update windows after installing windows using boot camp?

    I just bought a 15" macbook pro, do the cds that come with the mac have the drivers i need to update windows after installing windows using boot camp?

    What DVDs are this ?
    If it is OSX Snow Leopard Installation DVD then yes this disc contains the BootCamp Drivers version 3.x and is needed after the installation of Windows to install the BootCamp Drivers.
    With OSX Lion BootCamp is at version 4.x and the BootCamp Drivers have to be downloaded during use of the BootCamp Assistant in OSX.
    Boot Camp 3.0, Mac OS X 10.6 FAQ
    Frequently asked questions about Lion and Boot Camp 4.0
    Stefan

  • I need help in downloading and installing a previously purchased version of Photoshop Elements 12: AD012822594 1057-0247-4177-3303-6451-8067  or   1057-0904-6949-7119-8323-9165

    I need help in downloading and installing a previously purchased version of Photoshop Elements 12: AD012822594 1057-0247-4177-3303-6451-8067  or   1057-0904-6949-7119-8323-9165

    Please do not share serial numbers  or Order numbers on Forums . Serial numbers and order numbers  are very confidential.
    You can only share serial number with Adobe Customer support staff.

  • I need help in downloading and installing a previously purchased version of Photoshop Elements 12: Serial number removed by moderator

    I need help in downloading and installing a previously purchased version of Photoshop Elements 12: <Serial number removed by moderator>

    Hi There,
    Kindly try: Troubleshoot installation | Photoshop Elements, Premiere Elements | Windows
    Thanks,
    Atul Saini

  • When trying to get onto my email, the following statement comes uip: "We are sorry, but you will need to enable cookies and Javascript to use your Username with this site. I click "here" but nothing happens. How do I enable cookies amd Javascript?

    Trying to get t my email, this comes up: We are sorry, but you will need to enable cookies and Javascript to use your Username with this site.
    How do I do this?
    George Szanto<br />
    [email protected]

    see similar question answered at https://support.mozilla.com/questions/836913
    To be notified of updates to a question whether it is your problem or not simply click on the "Get email notifications" and follow directed choice. Only the original poster can mark as solved, so there should be a slight difference in choice as an original poster and where you latch onto another question. The notifications only apply to the specific question where entered.

  • I have 15" 2010 MacBook Pro running 10.6.8. I need to activate Bootcamp and install Windows 7. I ran software update. Does this update update Bootcamp? Or do I need to comb thru the 4 pages of updates and somehow determine which ones I need?

    My goal is to activate Boot Camp and the install Windows 7 in 64 bit mode on my 15" MacBook Pro (mid 2010 model)
    I have several questions:
    1. I ran software update and am up to date. Does this mean that my yet to be activated Boot Camp ap is also up to date?
    There are 4 confusing pages of updates listed at Apples website for Boot Camp. I am having a hard time understanding what I need and don't need. For example, what version of Boot Camp do I have? I have Boot Camp Assistant version 3.0.4. Does this mean I have Boot Camp ver 3?
    2. The printed Boot Camp instructions do not explain the process of using downloaded Windows drivers; the instuctions only refer to drivers on the original disks. I have the original install disks from around mid 2010 but I am sure many things have been updated by now. Wouldn't the best idea be to download and install? But the instructions only cover using the original disks. How do I use downloaded drivers?

    D_avid wrote:
    1. I ran software update and am up to date. Does this mean that my yet to be activated Boot Camp ap is also up to date?
    There are 4 confusing pages of updates listed at Apples website for Boot Camp. I am having a hard time understanding what I need and don't need. For example, what version of Boot Camp do I have? I have Boot Camp Assistant version 3.0.4. Does this mean I have Boot Camp ver 3?
    You have Mac OS X Snow Leopard, so you are going to use Boot Camp 3 on Windows. After installing Windows 7 on your MacBook, insert the Snow Leopard DVD and install the Boot Camp drivers from here. Then, as the Boot Camp drivers that your Snow Leopard disc contain are outdated, open Apple Software Update on Windows to install the most recent Boot Camp drivers.
    D_avid wrote:
    2. The printed Boot Camp instructions do not explain the process of using downloaded Windows drivers; the instuctions only refer to drivers on the original disks. I have the original install disks from around mid 2010 but I am sure many things have been updated by now. Wouldn't the best idea be to download and install? But the instructions only cover using the original disks. How do I use downloaded drivers?
    On Snow Leopard, you can only download the Boot Camp drivers for the Late 2010 MacBook Air. On Lion and Mountain Lion, you have to download the Boot Camp drivers for all the computers. If you try to download the Boot Camp drivers on Snow Leopard with your computer, you will get a message telling that there aren't any drivers to download for your MacBook Pro

  • I just installed 10.6.3 from the disk and then updated to 10.6.8. After restarting I did a disk verify to make sure all was well and it told me it wasn't and that I needed to erase, reformat and install again. Is there something I am missing?

    I am really tired. I have been working for days to upgrade my 2008 Mac Pro. I purchased 10.6.3 and did all available updates. I then downloaded mavericks which took forever. Once I tried to install mavericks it locked up my computer on the install screen. I eventually reinstalled 10.6.3 after erasing my HD and I worked perfectly. I again installed the combo pack to update to 10.6.8. After doing this I did a disk verify before going any further and again it said there were problems. I tried a disk repair and was unsuccessful and had to erase and reinstall 10.6.3. What am I doing wrong?
    Mike

    Your Boot Drive may be dying.
    Do not wrestle with it now. Instead, take a new drive and Install Mac OS X on it from scratch. If you do not have an available drive, buy one -- they are well under US$100. There is no need to shuffle drives around, your Mac will boot from whatever drive is specified in System Preferences > Startup Drive.
    Once you have a working version of Mac OS X, the full Mac OS X can be applied to resolving those other problems. Solving problems with just the Installer and its Utilities is very difficult.

  • Need help with archive and install

    I'm doing and archive and install. The first try was with a defective retail version of OS X Tiger, which did part of the job then stalled. Now I've been able to get a good DVD of this and was able to do an archive and install,although I couldn't check the box to save user settings etc., On the screen it gives me 3 options transfer info from another mac, transfer info from another partition on this mac or do not transfer my info. I'm new to all this, because of the first failed archive and install do I transfer the info from another partition or not transfer at all and find the old folder later on in the process?

    Hi D,
    I couldn't check the box to save user settings etc.
    I think that is due to the partial previous install moving things to a Previous System folder, but not finshing.
    Let's see if that's what happened... if you have 2 Macs with Firewire this could be a lot easier.
    Oh, do you have a Backup?
    "Try Disk Utility
    1. Insert the Mac OS X Install disc that came with your computer, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu. (In Mac OS X 10.4 or later, you must select your language first.)
    Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.
    3. Click the First Aid tab.
    4. Click the disclosure triangle to the left of the hard drive icon to display the names of your hard disk volumes and partitions.
    5. Select your Mac OS X volume.
    6. Click Repair. Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    After quitting DU, look for Terminal in that Menu Bar, open that and type in this...
    Wait, let's hear if you have another Mac or Boot Disk first...

  • Can I download an update on with one computer and install it using another?

    I want to update my Touch to 3.0 but my Mac at home that the Touch syncs with has a dial up connection so there is no way I can download the update- it's too big. Is it possible to download the update at work on a Windows machine and then somehow transfer it to my Mac and install the update?

    I have the same problem. I wish to download the update for a friend who only has dialup and has tried and failed to download the update himself.
    I'm hoping that the answer has changed (or will, Apple)??
    Alternatively, can he take his iPod Touch to an Apple Centre and have it updated there?

  • I want to make a VBIDE-Like drag and drop programm using Swing

    I am using swing am able to display no.of JInternalFrames on JDesktopPane to achieve an senario as in the VB-IDE we can easy resize and move the VB-components like Label ,Button ...But i want to drag a JButton or JLabel from any JToolBar and when i draw a rectangle,with dotted lines , on some container (may be JDeskTopane) and when i realese the Mouse then that JButton or JLabel will be displayed on the container.Please give me any idea,code,links or hints so that i can complete it.i.e How i can develope a VB-Ide like drag and ide in Java..
    Thanks in advance....

    Hey there buddy!
    You may like to check out the code for some projects on sourceforge if you wish to build something like this. Firstly, it is no easy task you are undertaking, but a good one none the less!
    The projects I have in mind are the following ones:
    Abacus GUI builder:
    http://sourceforge.net/projects/abaguibuilder
    JUIE
    http://sourceforge.net/projects/juie
    Have a look at the code to see how it is done. JUIE uses AWT but is in the process of being upgraded to swing. Abacus is currently Swing based.
    As far as I know, you are going to have to learn about Mouse handlers, in particular public void mousePressed();mouseDragged() etc... You will also need to learn about the layered pane architechture of Swing. When you click on your button it would (presumably) create a new button, add it to one of the thousands of possible layers you can have, and when you drag that component, the mouseDragged event will constantly send updates to the component to re-position it in the GUI...
    Good luck with it and I would be very interested to see how you went about it in the end.
    Take care
    Jason Barraclough.

  • How to pull data from EJB and present them using Swing ?

    Hi all,
    I've written stateful session bean which connect to Oracle database, and now I must write stand alone client application using Swing.
    The client app must present the data and then let users add,delete and edit data and it must be flexible enough to iterate through the records.
    The swing components can be JTextField,JTable etc.
    How to pull the data from EJB and present them to users with the most efficient network trip ?
    Thanks in advance
    Setya

    Thanks,
    Since the whole app originally was client-server app and I want to make it more scalable, so I decide to separate business logic in the EJB but I also want to keep the performance and the userfriendliness of the original user interface, and I want to continue using Swing as the original user interface does.
    I've read about using Rowset and I need some opinions about this from you guys who already have some experience with it.
    Any suggestions would be greatly appreciated.
    Thanks
    Setya

  • Report needed for checking where pers. nr. is used in SAP

    Hello,
    I am currently searching if there is a report available which is checking where in SAP a Pers. nr. is used. e.g. partner in an open order or responsible of a costcenter or appraiser in an appraisel, open workflow document etc. This is needed to confirm that all the tasks of the emplloyee has been transferred to another employee before the leave action is made.
    With kind regards,
    Ronald van Eeuwen

    Hi,
    There are more than 9000 programs and classes where field PERNR is used.
    You have to be more specific with your question.
    You can see all programs where PERNR is used by starting transaction SE11, enter data type PERNR, display and then CtrlShftF3.
    Cheers

  • HT3910 i don't have the Mac OS X Install DVD. What do I do on that case? and I need it to erase and install my computer

    I need help!

    If you have Snow Leopard installed then buy yourself another copy of the Snow Leopard DVD. You can purchase replacements for the original discs from Apple Support:
    Apple Store Customer Service at 1-800-676-2775 or visit online Help for more information.
    To contact product and tech support: Apple - Support - Contact Apple Support.
    Otherwise, for Lion, Mountain Lion, and Mavericks you would use Internet Recovery:
    Computers that can be upgraded to use OS X Internet Recovery
    OS X (Lion/Mountain Lion)- About OS X Recovery
    You can also create a USB flash drive installer for any version of OS X with the appropriate tools.

Maybe you are looking for