Forums

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

Attempt to install Atlassian SDK fails on Windows 10

Steve May 31, 2023

Hi,

I've been trying to install the Atlassian SDK without success.

I followed the tutorial here: https://developer.atlassian.com/server/framework/atlassian-sdk/install-the-atlassian-sdk-on-a-windows-system/

And have successfully installed and verified java 1.8 - with the command  

$ javac -version
javac 1.8.0_361

And after running the Atlassian SDK install, I see an error message when I try to run the version command to verify the install was successful.

$ atlas-version
bash: atlas-version: command not found


I read the plugin docs here: https://marketplace.atlassian.com/apps/1210950/atlassian-plugin-sdk-windows?tab=installation&hosting=server

and double-checked I have the expected version of JAVA (v8) which is also specified in the tutorial.

I have also attempted to install the Atlassian SDK as an admin but without success.
To be "belts and braces" I also rebooted my PC to be sure the SDK was running as expected but am still seeing command not found when I run atlas-version

 

Thanks in advance for any help to assist me in resolving this issue. 




 

2 answers

0 votes
Graham Twine
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.
June 7, 2023

Hi Steve,

 

good news indeed. :)

Make the question as answered if you think it is complete.

Thanks for also posting the additional info for the git terminal

0 votes
Graham Twine
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.
June 1, 2023

Hello @Steve

 

Where are you running this from?

$ atlas-version

I see the error you have is coming from bash so I assume this is on a linux system?

This along with your heading and the error confuses me though.

"I have also attempted to install the Atlassian SDK as an admin but without success."

 

None the less the SDK needs to be on the PATH for both linux and windows.

In step one the documentation describes how to configure the JAVA_HOME environment variable. This needs to be done for the SDK as well.

 

To confirm this is indeed the issue you can execute a quick test.

In your terminal (bash / powershell) navigate into the $ATLAS_HOME/bin directory and run atlas-version again.

 

If this works you can make the change permanent by setting the ATLAS_HOME variable and adding $ATLAS_HOME/bin to your path

 

Above ATLAS_HOME is just a synonym for the folder where you have installed the SDK

In windows one would write this as %ATLAS_HOME%

 

Extract of my .bashrc file. Note the PATH variable


export JAVA_HOME=/usr/lib/jvm/default
export MAVEN_HOME=/home/graham/Applications/atlassian-plugin-sdk-8.2.7/apache-maven-3.5.4
export ATLAS_HOME=/home/graham/Applications/atlassian-plugin-sdk-8.2.7

export PATH=$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin:$ATLAS_HOME/bin

 

Steve June 2, 2023

Hi @Graham Twine 

Thank you for your suggestions.

I did as you indicate and navigated to the bin folder of the plugin and attempted the command again without success.

Steve@WorkPc MINGW64 /c/Applications/Atlassian/atlassian-plugin-sdk-8.2.7/bin
$ atlas-version
bash: atlas-version: command not found


I also ensured I added the env vars as you suggested. I've only shown images for ATALS_HOME and MAVEN_HOME as the java install works as expected.

 Screenshot 2023-06-02 173102.pngScreenshot 2023-06-02 173034.png

Any other suggestions would be gratefully received.

Thanks

Graham Twine
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.
June 2, 2023

Hi Steve,

 

When running the command from the local folder can you try the following:

$ ./atlas-version

 

If you echo the path variable do you see the ATLAS_HOME is set?

$ echo $ATLAS_HOME

$ echo $PATH

 

In both of the above I would expect to see this below somewhere in the output

/c/Applications/Atlassian/atlassian-plugin-sdk-8.2.7

 

Try the following from your command line

$ export ATLAS_HOME=/c/Applications/Atlassian/atlassian-plugin-sdk-8.2.7

$ export PATH=$ATLAS_HOME/bin:$PATH

$ atlas-version
 

 

NOTE: The above will only work for the current session so if you close your terminal and open it again or open a new terminal the above settings are gone.

 

The contents of  atlassian-plugin-sdk-8.2.7/bin are shell scripts so you can open them in your favorite text editor or print them to the screen.

 

What is the output of these?

$ cd /c/Applications/Atlassian/atlassian-plugin-sdk-8.2.7/bin
$ ls -lart
$ cat atlas-version

 

 

 

Steve June 5, 2023

Hi @Graham Twine

Thanks for your suggestions.
I tried them all.

If I echo the path, I see the expected result.
And I see the expected files when I execute command

ls -lart


Noticing the file was named atlas-version.bat, I thought I'd try giving that a whirl in the terminal from inside the /bin directory.

It runs fine. :-) 

Steve@WorkPc MINGW64 /c/Applications/Atlassian/atlassian-plugin-sdk-8.2.7/bin

$ ./atlas-version.bat

ATLAS Version: 8.2.7
ATLAS Home: C:\Applications\Atlassian\atlassian-plugin-sdk-8.2.7
ATLAS Scripts: C:\Applications\Atlassian\atlassian-plugin-sdk-8.2.7\bin
ATLAS Maven Home: C:\Applications\Atlassian\atlassian-plugin-sdk-8.2.7\apache-maven-3.5.4
AMPS Version: 8.1.2
--------
Executing: "C:\Applications\Atlassian\atlassian-plugin-sdk-8.2.7\apache-maven-3.5.4\bin\mvn.cmd" --version -gs C:\Applications\Atlassian\atlassian-plugin-sdk-8.2.7\apache-maven-3.5.4/conf/settings.xml
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T19:33:14+01:00)
Maven home: C:\Applications\Atlassian\atlassian-plugin-sdk-8.2.7\apache-maven-3.5.4\bin\..
Java version: 1.8.0_361, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_361\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"




So, I guess we can verify the files are not corrupt. This leaves the conundrum of why the .bat file isn't recognised as a .bat file and treated accordingly.

Windows eh?!? [sigh]


Graham Twine
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.
June 5, 2023

@Steve  good to hear that you have made progress :)

 

I not very familiar with ms windows at all and you did leak a little info that i saw when responding here last time but felt I should at least let you test and confirm the the issue is related to the path.

You may want to research how mingw processes the systems environment when it is started up.

I suspect but may be wildly off track here, that java is in the system variables but the ATLAS_HOME is not?

If you attempt to launch things from power shell? (Of course if this is not power shell)

The part of that command that made it work was the two characters in bold below

./atlas-version.bat

 

Loosely speaking  execute the file found here ./atlas-version

Rather than the global application atlas-version which the terminal expects to find in $PATH

 

You can confirm if you see the ATLAS_HOME folder when running

$ echo $PATH (I suspect it will not be in there)

Steve June 5, 2023

Hi @Graham Twine 

$ echo $PATH
/c/Program Files/PowerShell/7
/c/Program Files/Java/jdk1.8.0_361/bin
%ATLAS_HOME%/bin:%MAVEN_HOME%/bin
...

It's there. Pls note I separated the lines which are usually combined into a single line to make them easier to read

Steve

Graham Twine
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.
June 5, 2023

mmm maybe the syntax of the variable?

$SOME_VAR (Linux syntax) vs %SOME_VAR% (Windows syntax)

 

If a variable is in the path then the following should be valid from any location in a terminal.

%ATLAS_HOME%/bin/atlas-version

Steve June 6, 2023

Hi @Graham Twine 

Interesting discovery!
From any location, I can run "atlas-verison.bat"  (no quotes) and successfully execute the file. But it won't run without the file extension being specified.
Hopefully, this indicates it was installed correctly and the system vars are also correct.

Not sure what's missing in the registry or elsewhere to allow it to run without specifying the file extension. 

Hopefully a little progress
Thanks for your continued help

Steve June 6, 2023

FIXED IT!!

I discovered the issue [sigh]

I dislike the cmd terminal, probably due to so many years spent developing on a Mac or other Linux type environment where everything is seamless and not a struggle.

On Windows, I prefer to use the git bash terminal and that was the point of failure.
Why?
(adding this part for others who fall into the same trap)
Only the cmd terminal executes the files using the correct syntax in the background, the cmd.exe file :-( 
Refer here: https://superuser.com/questions/625222/batch-file-gives-the-system-cannot-find-the-file-specified-but-commands-run-fi

Once you've installed Atlassian SDK, tested the vars are OK and successfully run the command atlas_version.bat (using the file extension) to verify it works using your git bash terminal, try running the same command from the cmd terminal.

To say this has been frustrating is an understatement and reinforces my love/hate relationship with developing things on Windows. But it's been a learning curve and that's always a good thing!

Happy coding and thanks for all your help

Suggest an answer

Log in or Sign up to answer