lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Høydahl (JIRA) <j...@apache.org>
Subject [jira] [Commented] (SOLR-6693) Start script for windows fails with 32bit JRE
Date Tue, 11 Nov 2014 10:24:33 GMT

    [ https://issues.apache.org/jira/browse/SOLR-6693?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14206246#comment-14206246
] 

Jan Høydahl commented on SOLR-6693:
-----------------------------------

Experiencing a weird behavior on a Windows where I have several JVMs installed. When calling
e.g. {{"C:\Program Files\Java\jdk1.6.0_45\bin\java.exe" -version:1.8 -version}} it somehow
finds my 1.8 install and uses that. Shell output:

{noformat}
C:\>"C:\Program Files\Java\jdk1.6.0_45\bin\java.exe" -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

C:\>"C:\Program Files\Java\jdk1.6.0_45\bin\java.exe" -version:1.7 -version
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

C:\>"C:\Program Files\Java\jdk1.6.0_45\bin\java.exe" -version:1.7+ -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

C:\>"C:\Program Files\Java\jdk1.6.0_45\bin\java.exe" -version:1.8 -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
{noformat}

So the {{-version:x.y}} flag cannot be used to detect the version of that particular executable.
Cannot reproduce this behavior on my Mac, probably because there is no central registry listing
all installed Javas. So we have a few choices for Windows:

A) Do not require JAVA_HOME to be set, but instead try simply calling {{java -version:1.7+}}
when starting Solr
B) Use JAVA_HOME and parse Java version from the -version output

Thoughts?

> Start script for windows fails with 32bit JRE
> ---------------------------------------------
>
>                 Key: SOLR-6693
>                 URL: https://issues.apache.org/jira/browse/SOLR-6693
>             Project: Solr
>          Issue Type: Bug
>          Components: scripts and tools
>    Affects Versions: 4.10.2
>         Environment: WINDOWS 8.1
>            Reporter: Jan Høydahl
>            Assignee: Jan Høydahl
>              Labels: bin\solr.cmd
>             Fix For: 5.0, Trunk
>
>         Attachments: SOLR-6693.patch
>
>
> *Reproduce:*
> # Install JRE8 from www.java.com (typically {{C:\Program Files (x86)\Java\jre1.8.0_25}})
> # Run the command {{bin\solr start -V}}
> The result is:
> {{\Java\jre1.8.0_25\bin\java was unexpected at this time.}}
> *Reason*
> This comes from bad quoting of the {{%SOLR%}} variable. I think it's because of the parenthesis
that it freaks out. I think the same would apply for a 32-bit JDK because of the (x86) in
the path, but I have not tested.
> Tip: You can remove the line {{@ECHO OFF}} at the top to see exactly which is the offending
line
> *Solution*
> Quoting the lines where %JAVA% is printed, e.g. instead of
> {noformat}
>   @echo Using Java: %JAVA%
> {noformat}
> then use
> {noformat}
>   @echo "Using Java: %JAVA%"
> {noformat}
> This is needed several places.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message