Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 344637

Summary: h2.bat in greenpages sample refers to HOMEPATH environment variable, which fails when HOMEPATH doesn't exist on current drive
Product: [RT] Virgo Reporter: Rick Herrick <rherrick>
Component: samplesAssignee: Glyn Normington <glyn.normington>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: glyn.normington
Version: 2.3.0.RELEASE   
Target Milestone: 2.4.0.RELEASE   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Fixed h2.bat glyn.normington: iplog+

Description Rick Herrick CLA 2011-05-03 16:00:32 EDT
Build Identifier: 

The default HOME on Windows 7 is composed of the HOMEDRIVE and HOMEPATH variables. The HOMEPATH doesn't include the drive name. This will work fine as long as your current drive is the same as your HOMEDRIVE. But if your HOMEDRIVE is C: and you're working on, e.g., D:, the h2.bat will fail with the message "Cannot find H2 jars in .m2 Maven repository".

The solution to this would be to use HOME instead of HOMEPATH.

Reproducible: Always

Steps to Reproduce:
1. Extract greenpages sample onto drive other than that containing the HOMEPATH. E.g. if your home folder is C:\Users\username, put the sample onto D:.
2. Follow the steps for preparing the sample according to this: http://www.eclipse.org/virgo/documentation/virgo-documentation-2.1.1.RELEASE/docs/virgo-getting-started/html/ch03s03.html
3. Observe failure on the step where you try to start run.bat.
Comment 1 Rick Herrick CLA 2011-05-03 16:04:46 EDT
Created attachment 194638 [details]
Fixed h2.bat

I have one Win7 machine that has the HOME environment variable set up and another that doesn't. They both have HOMEDRIVE and HOMEPATH, so I just changed this to use:

"%HOMEDRIVE%%HOMEPATH%\.m2"

The db starts up properly now.
Comment 2 Glyn Normington CLA 2011-05-04 05:44:27 EDT
(In reply to comment #1)
> Created attachment 194638 [details]
> Fixed h2.bat
> 
> I have one Win7 machine that has the HOME environment variable set up and
> another that doesn't. They both have HOMEDRIVE and HOMEPATH, so I just changed
> this to use:
> 
> "%HOMEDRIVE%%HOMEPATH%\.m2"
> 
> The db starts up properly now.

This might seem silly, but to be squeaky clean from an IP perspective, please would you confirm that you made that change yourself and that you have the rights (such as your employer's permission) to donate the change.
Comment 3 Glyn Normington CLA 2011-05-04 05:44:51 EDT
Oh and thanks very much for identifying and fixing this bug!
Comment 4 Glyn Normington CLA 2011-08-23 03:56:24 EDT
Hi Rick

We would like to release your fix. Please would you confirm that you made that change yourself and that you have the rights (such as your employer's permission) to donate the change. This is an essential part of the Eclipse IP process.

Thanks,
Glyn
Comment 5 Rick Herrick CLA 2011-08-24 10:47:28 EDT
(In reply to comment #4)
> We would like to release your fix. Please would you confirm that you made that
> change yourself and that you have the rights (such as your employer's
> permission) to donate the change. This is an essential part of the Eclipse IP
> process.

Yes, I made the change myself. My employer is NRG (http://nrg.wustl.edu) and all of our work is released under Simplified BSD, so there are no IP issues regarding ownership of this fix. Let me know if you need anything else from me!
Comment 6 Glyn Normington CLA 2011-08-25 03:22:51 EDT
Thanks Rick. I've acknowledged your contribution and mentioned your employer in the 3.0 release notes.