Opened 9 years ago

Closed 9 years ago

#769 closed defect (fixed)

eepget.bat on Windows fails to find java

Reported by: DISABLED Owned by: killyourtv
Priority: major Milestone: 0.9.4
Component: apps/other Version: 0.9.3
Keywords: windows, eepget Cc:
Parent Tickets: Sensitive: no


Full I2P installation completed, running.. eepget.bat invoked, complains that it can't find Java.


Change History (4)

comment:1 Changed 9 years ago by zzz

Windows version?
Java version?

comment:2 Changed 9 years ago by killyourtv

Owner: set to killyourtv
Status: newaccepted

The problem came up because, unlike on *NIX, java.exe isn't always added to the system path in Windows (I've always manually added it when I'm stuck on a Windows box).

I'll brush up on Windows batch files and see what I can do to resolve this…

comment:3 Changed 9 years ago by killyourtv

Ok, I think that by querying the registry for the location I've got a decent way around this, but I'm going to test the hell out of it in various versions of Windows & Java before checking it in. I also need to confirm that the key will always exist and/or that this method will fail gracefully if it does not.

'java' is not recognized as an internal or external command,
operable program or batch file.

Runtime is 1.6
Determined the path is: C:\Program Files\Java\jre6

Let's try running "C:\Program Files\Java\jre6\bin\java.exe" -version :

java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)

Here it's working with Java x64 v1.6.0_37 in x64 Win7, but it *should* work with any version from XP and newer…

comment:4 Changed 9 years ago by killyourtv

Resolution: fixed
Status: acceptedclosed

I assume you're probably using a 32 bit JRE in a 64bit version of Windows. In my testing I found that:

  • 32 bit windows —> Java in the path
  • 64 bit Windows & 64 bit JRE —> Java in the path
  • 64 bit Windows & 32 bit JRE —> Java not in the path

Fix committed in revision 885da6062c98bd45f9c332c3ee0d6f23ac128340 that queries the registry to determine the location of java.exe in case it's not found in the system path or it's not set manually.

If you want to try the updated script you can fetch it from http://pastethis.i2p/show/Spt3RozzXQFSHd5mVUbC/. Be sure to change the _I2PHOME variable to point to your I2P installation (and if you try it, feel free to report success (or otherwise)).

Note: See TracTickets for help on using tickets.