英文:
Can't run Apache Hop GUI on Linux Fedora
问题
I fixed it, it was a mistake with my Java version. There was a file deeeeeeeeep somewhere in my computer that had the wrong Java path, so I finally found it and when I fixed the Java path and used the correct version everything worked!
我修复了它,这是我的Java版本出现了问题。我的电脑中有一个深层次的文件,它的Java路径错误,最后我找到了它,修复了Java路径并使用正确的版本,一切都正常工作了!
英文:
Edit: fixed it, it was a mistake with my Java version. There was a file deeeeeeeeep somewhere in my computer that had the wrong Java path, so I finally found it and when I fixed the Java path and used the correct version everything worked!
I tried downloading the zip folder from the official link (https://hop.apache.org/download/) both versions. Then I extracted it and opened a terminal and wrote "./hop-gui.sh" (also tried sudo). However I always get this huge error (I'll paste what I think are the important parts):
> 2023/04/19 10:20:30 - SwtSvgImageUtil - ERROR: Error loading image from location 'ui/images/ui/images/database.png'
> 2023/04/19 10:20:30 - SwtSvgImageUtil - ERROR: org.apache.hop.core.exception.HopException:
> 2023/04/19 10:20:30 - SwtSvgImageUtil - Error loading SVG file ui/images/ui/images/database.png
> 2023/04/19 10:20:30 - SwtSvgImageUtil -
> 2023/04/19 10:20:30 - SwtSvgImageUtil -
> 2023/04/19 10:20:30 - SwtSvgImageUtil - org.apache.commons.vfs2.FileNotFoundException: Could not read from "file:///(I'm deleting this part because it shows some private details, but it's the correct path to the folder)/apache-hop-client-2.3.0/hop/ui/images/ui/images/database.png" because it is not a file.
> 2023/04/19 10:20:30 - SwtSvgImageUtil - Could not read from "file:///(I'm deleting this part because it shows some private details, but it's the correct path to the folder)/apache-hop-client-2.3.0/hop/ui/images/ui/images/database.png" because it is not a file.
> Serious error detected in the Hop GUI: Could not initialize class org.apache.hop.core.SwtUniversalImageSvg
> java.lang.NoClassDefFoundError: Could not initialize class org.apache.hop.core.SwtUniversalImageSvg
> at org.apache.hop.ui.hopgui.perspective.explorer.ExplorerPerspective.loadTypeImages(ExplorerPerspective.java:306)
> at org.apache.hop.ui.hopgui.perspective.explorer.ExplorerPerspective.initialize(ExplorerPerspective.java:244)
> at org.apache.hop.ui.hopgui.HopGui.loadPerspectives(HopGui.java:504)
> at org.apache.hop.ui.hopgui.HopGui.open(HopGui.java:400)
> at org.apache.hop.ui.hopgui.HopGui.main(HopGui.java:351)
I'm running Java 11, I also tried with Java 17 after restarting my PC. I haven't found anything about this and there aren't any logs generated. There is no UI folder on the zip file I downloaded from Hop (none of the times). I'm very new to the area so please keep the explanations simple if possible.
What I tried: sudo, other Java versions, restarting the PC, downloading multiple versions, checking for logs (there aren't any)
答案1
得分: 1
在调查了我们的问题跟踪器上创建的一个工单后,得出的结论可能是正在使用无界面的Java来尝试启动应用程序。
在遇到Java版本问题时,避免问题的可能方法是直接下载一个JRE并将其放在方便的位置。然后,您可以使用"export JAVA_HOME=<您的java11路径>"来使应用程序使用此Java版本。如果您不想使用通用的JAVA_HOME变量,还可以使用HOP_JAVA_HOME来设置路径。
在使用默认java命令之前,我们的所有脚本都会首先检查这些系统变量中是否已经设置了一个。
从hop-gui.sh中的代码片段:
将主要的Java设置为HOP_JAVA_HOME,如果不存在则回退到JAVA_HOME或默认的java
if [ -n "$HOP_JAVA_HOME" ]; then
_HOP_JAVA=$HOP_JAVA_HOME/bin/java
elif [ -n "$JAVA_HOME" ]; then
_HOP_JAVA=$JAVA_HOME/bin/java
else
_HOP_JAVA="java"
fi
英文:
After investigating this for a ticket that was created on our issue tracker the conclusion is that probably a headless Java is being used to try and start the application.
When running into problems with Java versions a possible way to avoid problems is to directly download a JRE and place it in a convenient location. You can then use "export JAVA_HOME=<path to your java11>" to make the application use this java version. If you do not want to use the general JAVA_HOME variable you can also use HOP_JAVA_HOME to set the path.
All our scripts will first check if one of these system variables have been set before using the default java command
Snippet from hop-gui.sh:
# set java primary is HOP_JAVA_HOME fallback to JAVA_HOME or default java
if [ -n "$HOP_JAVA_HOME" ]; then
_HOP_JAVA=$HOP_JAVA_HOME/bin/java
elif [ -n "$JAVA_HOME" ]; then
_HOP_JAVA=$JAVA_HOME/bin/java
else
_HOP_JAVA="java"
fi
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论