Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Config.bat on clean installation does not run on windows server 2008 R2

Janaki Kora August 18, 2011

I have installed JIRA 4.4 on Windows Server 2008 R2 successfully.

When trying to run Config.bat from windows cmd prompt (C:\Windows\SysWOW64\cmd.exe) the following error msg is seen: "Files was unexpected at this time".

I have set the JAVA_HOME variable for 32 bit JDK and also the Path as %JAVA_HOME%\bin

Please advise

6 answers

1 vote
Edward Lazor May 2, 2016

The config.bat file needs to be updated.  Apparently this command doesn't work:

if not "%JRE_HOME%" == "" goto gotJreHome

Instead, it should be:

if defined JRE_HOME goto gotJreHome

 

Reference for more info:

http://www.robvanderwoude.com/battech_defined.php

 

1 vote
Sergey Markovich
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 18, 2011

I'm not sure if this is really the problem but just check it.

There is a common UAC (user account control) issue with Windows 2008 and up when running administrative batch scripts. Try running config.bat from administrator command prompt. To open this prompt right click cmd.exe or "Command Prompt" in start menu and choose "Run as administrator".

Janaki Kora August 18, 2011

I did run the cmd prompt as Administrator.

0 votes
Deleted user December 16, 2016

On running atlas-version while verifying the SDK install, received error "Files was unexpected at this time."

C:\WINDOWS\system32>atlas-version

ATLAS Version: 6.2.9
ATLAS Home: C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.9
ATLAS Scripts: C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.9\bin
ATLAS Maven Home: C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.9\apache-maven-3.2.1
AMPS Version: 6.2.6
--------
Executing: "C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.9\apache-maven-3.2.1\bin\mvn.bat" --version -gs C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.9\apache-maven-3.2.1/conf/settings.xml
Files was unexpected at this time.

C:\Windows\System32>"C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.9\apache-maven-3.2.1\bin\mvn.bat" --version -gs C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.9\apache-maven-3.2.1/conf/settings.xml
Files was unexpected at this time.

This was with %JAVA_HOME% defined as "%SYSTEM_DRIVE%Program Files (x86)\Java\jdk1.8.0_112".

set JAVA_HOME="%SYSTEMDRIVE%\Program Files (x86)\Java\jdk1.8.0_112"

  • Variable %SYSTEMROOT% is not translated, an explicit drive letter is required "C:"
  • Enclosing the value for %JAVA_HOME% in "s is not accepted either

Here is the working %JAVA_HOME%

set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_112

C:\WINDOWS\system32>atlas-version

ATLAS Version: 6.2.9
ATLAS Home: C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.9
ATLAS Scripts: C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.9\bin
ATLAS Maven Home: C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.9\apache-maven-3.2.1
AMPS Version: 6.2.6
--------
Executing: "C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.9\apache-maven-3.2.1\bin\mvn.bat" --version -gs C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.9\apache-maven-3.2.1/conf/settings.xml
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T10:37:52-07:00)
Maven home: C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.9\apache-maven-3.2.1\bin\..
Java version: 1.8.0_112, vendor: Oracle Corporation
Java home: C:\Program Files (x86)\Java\jdk1.8.0_112\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "x86", family: "dos"

Hope that helps someone.

John Smith June 7, 2019

+1

0 votes
Edward Lazor May 2, 2016

There were a couple of problems running config.bat. Here is the updated copy - hope it helps.

-Ed

 

@ECHO OFF
REM -----------------------------------------------------------------------------
REM Run script for the JIRA Configurator
REM -----------------------------------------------------------------------------

REM try to find a JAVA_HOME or JRE_HOME
if defined JRE_HOME goto gotJreHome
set JRE_HOME=%JAVA_HOME%
if defined JRE_HOME goto gotJreHome
echo No JRE_HOME or JAVA_HOME environment variable is set - attempting to just run 'java' command
set _EXECJAVA=java
goto okJavaHome

:gotJreHome
REM Use the java from (1) JRE_HOME or (2) JAVA_HOME; supports spaces in these paths
set _EXECJAVA="%JRE_HOME%\bin\java"

:okJavaHome

REM check for correct java version
if not exist "%~dp0\check-java.bat" goto checkJavaDone
call "%~dp0\check-java"
if errorlevel 1 exit /b 1
:checkJavaDone

REM Change to the bin directory
set ORIGINAL_DIR=%cd%
cd %~dp0

REM Run the Configurator Java class
REM Note we only quote this path once, see JRA-31543
%_EXECJAVA% -classpath jira-configurator.jar;../atlassian-jira/WEB-INF/classes;../atlassian-jira/WEB-INF/lib/*;../lib/* com.atlassian.jira.configurator.Configurator %*

REM batch files would leave me in the bin directory - change back to the original
cd %ORIGINAL_DIR%

 

0 votes
Penny Wyatt (On Leave to July 2021)
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 18, 2011

I bet you the word "Files" in the error message is the second half of "C:\Program Files" and something isn't handling the space in the path correctly.

I've just had a go at running the config.bat from JIRA 4.4 with a space in the JIRA install path and it works fine. Also, searching the web for this results in a fair number of hits from a bunch of different Java apps, so I'd recommend focussing on the JAVA_HOME variable. Perhaps try setting the JAVA_HOME variable to the shortened version of the path - "C:\Progra~1\..." ?

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 18, 2011

Um, why aren't you using the standard command line? What's SysWOW64? Why are you using a command line at all? (The installer creates GUI shortcuts so you shouldn't need a command line). Could you tell us the exact error messages you get if you use the Windows cmd prompt?

(Oh, and what Sergey said applies too, whatever shell you're using)

Janaki Kora August 18, 2011

SysWOW64 will open the 32-bit cmd prompt. But it din't really matter if I was using the 32-bit cmd prompt or the 64-bit. I tried running config.bat on both the command prompts as an Administrator (with Elevated previleges).

"Files unexpected at this time" is the only line I keep seeing every time I try to run 'config.bat'

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events