R
Railway13mo ago
Kurdiez

Java is not found

It seems Java is not available out of the box. How do I configure Railway service to have Java so I can run a Java process?
No description
60 Replies
Percy
Percy13mo ago
Project ID: 1f1e865e-cb58-46db-b427-0b47e5dad0c1
Kurdiez
Kurdiez13mo ago
Product ID: 1f1e865e-cb58-46db-b427-0b47e5dad0c1
Brody
Brody13mo ago
what provider is currently being detected?
Kurdiez
Kurdiez13mo ago
I don't need to build. I just need to run already built Java server How do I check this?
Kurdiez
Kurdiez13mo ago
I don't know how to use that bookmarklets It's confusing
Brody
Brody13mo ago
please follow the instructions
Kurdiez
Kurdiez13mo ago
I did, but when I click on bookmarklet from the bookmarks bar, it just goes to the page you sent me And that makes sense because it's in the bookmarks bar...
Brody
Brody13mo ago
you did not follow the instructions
Kurdiez
Kurdiez13mo ago
I did. I opened the desired service and then clicked on the bookmarklet in the bookmarks bar It looks like your instructions are not detailed enough... What is it that you would like to see? The build log?
Brody
Brody13mo ago
the build logs produced from that bookmarklet
Kurdiez
Kurdiez13mo ago
This is from Railway Build logs
Brody
Brody13mo ago
please use the bookmarklet
Kurdiez
Kurdiez13mo ago
Is there a YouTube video or something that explains how to use bookmarklet?
Brody
Brody13mo ago
there is an arrow and 3 steps on that page please follow the instructions
Kurdiez
Kurdiez13mo ago
Yes... I followed those 3 steps.
Brody
Brody13mo ago
okay send the build logs please
Kurdiez
Kurdiez13mo ago
I got the log from bookmarklet.. that was confusing to me sorry
Brody
Brody13mo ago
that is the deployment logs
Brody
Brody13mo ago
do you have a nixpacks.toml file?
Kurdiez
Kurdiez13mo ago
no
Brody
Brody13mo ago
any kind of config file relating to railway?
Kurdiez
Kurdiez13mo ago
no nothing. First time using Railway
Brody
Brody13mo ago
do you have any service variables set?
Kurdiez
Kurdiez13mo ago
No
Brody
Brody13mo ago
do you have a start command set in the service settings?
Kurdiez
Kurdiez13mo ago
yes bin/run.sh root/config.yaml the run.sh calls java to run the server
Brody
Brody13mo ago
what languages do you need made available, other than java
Kurdiez
Kurdiez13mo ago
Only Java
Brody
Brody13mo ago
what version
Kurdiez
Kurdiez13mo ago
17
Brody
Brody13mo ago
do you need anything else in the container?
Kurdiez
Kurdiez13mo ago
no Just need Java that's all
Brody
Brody13mo ago
would that just be jre?
Kurdiez
Kurdiez13mo ago
Yes just JRE is ok
Brody
Brody13mo ago
untested, but add this to a railway.json file in your project
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"providers": [],
"phases": {
"setup": {
"nixPkgs": ["jdk17"]
}
}
}
},
"deploy": {
"restartPolicyMaxRetries": 3,
"startCommand": "bin/run.sh /app/apps/ib-client-portal/root/config.yaml"
}
}
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"providers": [],
"phases": {
"setup": {
"nixPkgs": ["jdk17"]
}
}
}
},
"deploy": {
"restartPolicyMaxRetries": 3,
"startCommand": "bin/run.sh /app/apps/ib-client-portal/root/config.yaml"
}
}
Kurdiez
Kurdiez13mo ago
Root folder of my project?
Brody
Brody13mo ago
if thats what you have railway deploying from, yes
Kurdiez
Kurdiez13mo ago
It's a monorepo that will have many things deployed from. This Java server is one of them. How can I make it so that only one service is using this railway.json configuration. All the other services don't need Java at all
Brody
Brody13mo ago
are they in subfolders?
Kurdiez
Kurdiez13mo ago
Yeah
Brody
Brody13mo ago
have you set a root directory for this railway service?
Kurdiez
Kurdiez13mo ago
yes that root directory is the subfolder where this Java server is in
Brody
Brody13mo ago
what did you set it to?
Kurdiez
Kurdiez13mo ago
/apps/ib-client-portal This is the root folder that's set in the settings of the service
Brody
Brody13mo ago
then that is where you should put that railway.json file
Kurdiez
Kurdiez13mo ago
ok thank you. testing it out now
╔════════════ Nixpacks v1.17.0 ════════════╗

║ setup │ jdk17 ║

║──────────────────────────────────────────║

║ start │ bin/run.sh root/config.yaml ║

╚══════════════════════════════════════════╝
╔════════════ Nixpacks v1.17.0 ════════════╗

║ setup │ jdk17 ║

║──────────────────────────────────────────║

║ start │ bin/run.sh root/config.yaml ║

╚══════════════════════════════════════════╝
This showed up in build log so far. So I guess that's good.
Brody
Brody13mo ago
indeed
Kurdiez
Kurdiez13mo ago
Well build was successful and deployment shows this log
running

runtime path : root:dist/ibgroup.web.core.iblink.router.clientportal.gw.jar:build/lib/runtime/*

config file : root/config.yaml

Failed to load configuration file: ../root/config.yaml

java.io.IOException: Stream closed

running

runtime path : root:dist/ibgroup.web.core.iblink.router.clientportal.gw.jar:build/lib/runtime/*

config file : root/config.yaml

Failed to load configuration file: ../root/config.yaml

java.io.IOException: Stream closed
running

runtime path : root:dist/ibgroup.web.core.iblink.router.clientportal.gw.jar:build/lib/runtime/*

config file : root/config.yaml

Failed to load configuration file: ../root/config.yaml

java.io.IOException: Stream closed

running

runtime path : root:dist/ibgroup.web.core.iblink.router.clientportal.gw.jar:build/lib/runtime/*

config file : root/config.yaml

Failed to load configuration file: ../root/config.yaml

java.io.IOException: Stream closed
I think this is an issue I should solve myself. My start command is bin/run.sh root/config.yaml where I pass the config.yaml but it can't find that config file...
Brody
Brody13mo ago
where is the config file relative to the root of your entire project?
Kurdiez
Kurdiez13mo ago
- monorepo-root/apps/ib-client-portal/railway.json - monorepo-root/apps/ib-client-portal/bin/run.sh - monorepo-root/apps/ib-client-portal/root/config.yaml
Brody
Brody13mo ago
should you have written monorepo-root? is that an actual folder within your projects root folder?
Kurdiez
Kurdiez13mo ago
no, i'm just letting you know the relative paths from my monorepo-root That is the root folder in Github repo basically
Brody
Brody13mo ago
okay so you dont actually have a monorepo-root in your root, that is the name of the root folder on your computer?
Kurdiez
Kurdiez13mo ago
yes that's correct
Brody
Brody13mo ago
ive updated this, please update your copy
Kurdiez
Kurdiez13mo ago
Thanks. trying it out
running

runtime path : /app/apps/ib-client-portal/root:dist/ibgroup.web.core.iblink.router.clientportal.gw.jar:build/lib/runtime/*

config file : /app/apps/ib-client-portal/root/config.yaml

Failed to load configuration file: ..//app/apps/ib-client-portal/root/config.yaml

java.io.IOException: Stream closed
running

runtime path : /app/apps/ib-client-portal/root:dist/ibgroup.web.core.iblink.router.clientportal.gw.jar:build/lib/runtime/*

config file : /app/apps/ib-client-portal/root/config.yaml

Failed to load configuration file: ..//app/apps/ib-client-portal/root/config.yaml

java.io.IOException: Stream closed
Brody
Brody13mo ago
im starting to think a dockerfile would be more suitable for this
Want results from more Discord servers?
Add your server