Executing jar without system java (JRE) on linux
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- cli, operating-systems
Hướng nghiên cứu
Bắt đầu bằng việc xem xét bash launcher và bố cục linuxJdk/bin được mô tả trong issue, bao gồm cách Cube Chaos.jar được gọi. Tái hiện hành vi khởi chạy từ Steam và đường dẫn asset trên Linux, sau đó xác định hoàn thành là khởi chạy bằng Java được đóng gói, duy trì đường dẫn asset của trò chơi và giải thích hành vi bất ngờ của Steam.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
This issue is about a public attempt of transitioning my game on linux to have a bundled java version since systems java is no longer accessable.
Its public to possibly help people at steam to provide better assistance, it may also be usefull as an example. This is mostly due to @TTimo offering/asking about this.
Previous method:
There was a .sh (bash) file
-this bash file checked the systems java version via:
version=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}' | awk -F '.' '{sub("^$", "0", $2); print $1$2}')
-this translated the version into a 2 digit number to then compare it and check if the java version is high enough
-the jar file is then executed via:
java -jar Cube\ Chaos.jar "$@" (the "$@" apparently
-this is a simple jar file produced by a Java IDE (in my case Eclipse) which is the game itself
This is no longer functional because steam launches the bash file without access to the systems java.
Disclaimer:
I have close to no experience with bash scripts, most of this is snippeted together.
Also I am releasing an update on the first of the next month so I may be a little slow to respond or do work on this.
I can only test on linux very slowly due to the virual machine beeing very slow and finicky, as such I have asked one of the people of the community for help, though this is obviouly still messy.
Attempt:
-This whole attempt is on a seperate devtest branch to make sure normal use is not impacted
-I have downloaded the newest linux openjdk jdk (oracle is not free to distribute) and added it to the folder which is the package
-I have modified the bash to be:
#!/bin/bash
cd ./linuxJdk/bin
java -jar ../../Cube\ Chaos.jar
read
-the read command is just there to keep the terminal open for the purpose of testing
-I have attempted it without the cd going into the java bin subfolder but without that the java command does not work, even if changed to /linuxJdk/bin/java -jar Cube\ Chaos.jar to include the path there.
-This does launch the file in some way however this approach has 2 problems so far:
--Presumably due to beeing opened from a different path the game cannot find its own assets, I have no idea how to possibly be in the java path as well as in the main game path, but likely am just missing some bash knowledge. Could also be some other problem who knows.
--For some reason when the bash is executed manually steam automaticly tries to launch as well and adds its log to the bash terminal, this is quite perplexing considering the previous bash file did not do this. I am currently using https://github.com/code-disaster/steamworks4j to connect to steam with the game for stuff like friends list info and achievements, however this shouldent launch steam nor has it in the past. Additionally the game is made to work fine even without steam. This is not strictly required to fix but would make the game more susceptible to future problems.
Questions:
-Is there a common way to launch jar games via steam which doesnt require this messy bash workaround?
-Any ideas on how to resolve the bash folder issue?
-Any idea why manually executing the bash also launches steam?
- Ngôn ngữ chính
- Shell
- Star
- 1.5k
- Fork
- 98
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ValveSoftware/steam-runtime
-
Need Retest Pressure Vessel
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
ValveSoftware/steam-runtime#854 · 4 bình luận ·
-
Need Retest
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
ValveSoftware/steam-runtime#853 · 6 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
ValveSoftware/steam-runtime#851 · 3 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
ValveSoftware/steam-runtime#847 · 3 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
ValveSoftware/steam-runtime#845 · 4 bình luận ·
Tất cả issue của ValveSoftware/steam-runtime
Issue tương tự
-
kind/bug/report meta/needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
docker-mailserver/docker-mailserver#4831 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
bigbluebutton/docker#403 ·
-
Exif extensionĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
getgrav/docker-grav#68 ·
-
Hyprland 0.57: monitor-workspaces reconcile errors on every start and reload when a named workspace exists (workspace.id is nil)Có thể đã có người làm @jasasonc đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
priority middle
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
KATO-Hiro/AtCoderClans#12940 ·
Maintainer thường phản hồi trong vòng 1 ngày