404 when loading http://localhost:2990/jira

I’m trying to get the example HelloWorld project using the Atlassian SDK running but am stuck on http://localhost:2990/jira returning 404.

After running atlas-run in the terminal it appears the app is running on localhost:2990:

But then when I try and load it in the browser I get:

If I go back further in the logs I can see this error:

Any idea what I’m missing? I’m new to Java and using the Atlassian Plugin SDK so there might be something simple I’m missing.

My suspicion is it has something to do with my Java version. The Java version returned when I run java --version appears to be different to what is defined in JAVA_HOME.

Hi @RhysDiab ,

Yes, it seems that your JAVA_HOME is not set properly. Based on your echo $JAVA_HOME result, I think you are trying to do something like

export JAVA_HOME=$(/usr/libexec/java_home -v1.8.0_292)

but I guess you missed out on the $( ) when you exported JAVA_HOME. How did you define the JAVA_HOME environment variable?

Also, to check what java version the Atlassian SDK is using, you can try running atlas-version.

Cheers,
Ian

Hi @iragudo

Thanks for the response.

I defined JAVA_HOME in the .zshrc file. I tried the syntax you suggested above but no Java version is found when I try that.

This is what I get when I run atlas-version:

Hi @RhysDiab ,

Based on the results of your atlas-version call, you are still referencing JDK17. To help troubleshoot further, do you mind sharing the following (kindly open a new terminal just to be sure that the latest exported env vars will be referenced)?

  1. Result of echo $JAVA_HOME
  2. Snippet of how you did the export in your .zshrc
  3. Result of echo $(/usr/libexec/java_home -v1.8.0_292) (with the assumption that this is the one you used for the export)

Cheers,
Ian

Thanks @iragudo . Below is the result of echo $JAVA_HOME and echo $(/usr/libexec/java_home -v1.8.0_292):

Screen Shot 2022-02-28 at 2.39.45 pm

Here is the export from the my .zshrc file:
Screen Shot 2022-02-28 at 2.41.30 pm

Super appreciate your help.

Best Regards,
Rhys

You’re welcome, @RhysDiab .

The way you exported JAVA_HOME is incorrect as it should be (do note of the $ and parenthesis as it is important to evaluate the results of the java_home call)

export JAVA_HOME=$(/usr/libexec/java_home -v1.8.0_292)

Once done, open a new terminal and the results of echo $JAVA_HOME and echo $(/usr/libexec/java_home -v1.8.0_292) should be the same.

Also, if you’ll be using Java via CLI most of the time then you might want to include JAVA_HOME in your PATH by adding the following at the bottom of your .zshrc

export PATH=$PATH:$JAVA_HOME/bin

Cheers,
Ian

2 Likes

@iragudo I’ve updated the JAVA_HOME variable as per your suggestion and added export PATH=$PATH:$JAVA_HOME/bin below it.

Below is a screenshot of echo $JAVA_HOME and echo $(/usr/libexec/java_home -v1.8.0_292)

Screen Shot 2022-02-28 at 3.08.03 pm

Although now java --version returns this:
Screen Shot 2022-02-28 at 3.09.08 pm

But localhost is now working!

Thanks again for your help!

You’re welcome, @RhysDiab . Glad to know it is working now.

The error you got with java --version is expected. For Java 8, the option --version is not present (but it exists in the newer ones like Java 17). To get the version try the -version (notice the single -) and that should work. You can verify the other options by using -h.

Best of luck on your development.

2 Likes