This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 10 - Pages: 1 - Last Post: 01-Jan-2021 19:39 Last Post By: ctwist Threads: [ Previous | Next ]
ctwist

Posts: 607
Registered: 27-Sep-2003
Wrong Java path
Posted: 15-Dec-2020 17:22
 
  Click to reply to this thread Reply
I am running jAlbum 23.1 on Windows 10 64-bit. I have not changed any jAlbum settings.

If I open jAlbum.exe, the initial jAlbum window appears, with the spinning progress wheel, but it goes no further, and I have to use Task Manager to kill it.

If I run StartJAlbum.cmd, jAlbum opens normally.

I also have JDK 1.8 installed. Consequently the Windows path starts with "C:\Program Files\Java\jdk1.8\jre\bin". If I remove this from the path, jAlbum.exe opens normally. If I restore the path, jAlbum.exe fails, as before.

Conclusion: jAlbum accesses a Java component via the Windows path, instead of using its own jAlbum\jre64 installation. This causes it to fail.
davidekholm

Posts: 3,494
Registered: 18-Oct-2002
Re: Wrong Java path
Posted: 15-Dec-2020 18:04   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
ctwist wrote:
I am running jAlbum 23.1 on Windows 10 64-bit. I have not changed any jAlbum settings.

If I open jAlbum.exe, the initial jAlbum window appears, with the spinning progress wheel, but it goes no further, and I have to use Task Manager to kill it.

If I run StartJAlbum.cmd, jAlbum opens normally.

I also have JDK 1.8 installed. Consequently the Windows path starts with "C:\Program Files\Java\jdk1.8\jre\bin". If I remove this from the path, jAlbum.exe opens normally. If I restore the path, jAlbum.exe fails, as before.

Conclusion: jAlbum accesses a Java component via the Windows path, instead of using its own jAlbum\jre64 installation. This causes it to fail.


The jAlbum.exe launcher should be using the embedded Java. Check jAlbum.ini. Also, if you get an never ending spinning splash screen, alt-click it to generate a thread dump file that should tell what jAlbum is up to. Pass it to me.
ctwist

Posts: 607
Registered: 27-Sep-2003
Re: Wrong Java path
Posted: 15-Dec-2020 18:14   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Attachment Jalbum.ini (800 bytes)
Attachment thread-dump.txt (10.5 KB)
Requested files are attached. I have not changed Jalbum.ini.
davidekholm

Posts: 3,494
Registered: 18-Oct-2002
Re: Wrong Java path
Posted: 15-Dec-2020 21:56   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
Thanks. It's JavaFX that fails to initialize on your computer. Could be some lock-up within the graphics driver for instance. Try this version which runs on Java 8 too, but at least uses the "Jalbum.exe" launcher file: http://jalbum.net/download/23.1/Windows/jAlbum-install-java8.exe
ctwist

Posts: 607
Registered: 27-Sep-2003
Re: Wrong Java path
Posted: 16-Dec-2020 02:48   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Well the alternative version of jAlbum that you provided works, and it uses Java 8, but that doesn't solve the problem.

I want to run jAlbum.exe with Java 14, which is in jalbum\jre64. This works if no other version of Java is installed, but if I install Java 8 as well, jAlbum,exe fails; it should not fail because another version of Java is installed; it should use Java 14.

I thought I had a workaround. If I run StartJAlbum.cmd, it works correctly. However, I assumed that it was running Java 14, but I just started it in the original version of jAlbum 23.1, and I see that it is actually running Java 8.

To make it more confusing, StartJAlbum-debug-java8.cmd runs jAlbum with Java 14. This is actually what I want.

Anyway, quite simply, jAlbum.exe should obey the setting in jalbum.ini
JRE Path=C:\Program Files\jAlbum\jre64\
It should not fail if another version of Java is installed, and it should not choose to use any other version of Java that happens to be installed. If I want to use a different version of Java, I will change the "JRE Path" parameter in jalbum.ini.
JeffTucker

Posts: 7,525
Registered: 31-Jan-2006
Re: Wrong Java path
Posted: 16-Dec-2020 02:53   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
Puzzling. I just reinstalled JRE 8 (I don't need it for anything else). If I launch jalbum.exe, it uses the bundled Java 14, as expected.
ctwist

Posts: 607
Registered: 27-Sep-2003
Re: Wrong Java path
Posted: 16-Dec-2020 03:26   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
I installed JDK8. Refer to my first post to see the path. This shouldn't make any difference.

However, check the Windows path; is your Java 8 jre at the beginning of the path? This seems to be what triggers the unusual behaviour.
JeffTucker

Posts: 7,525
Registered: 31-Jan-2006
Re: Wrong Java path
Posted: 16-Dec-2020 03:31   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
Still no difference. With JDK 8 installed, jalbum.exe still runs on the bundled Java 14. And the PATH starts with:
PATH=C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\jAlbum\jre64\bin;....
But I have to ask... Why bother installing JDK 8 at all?
ctwist

Posts: 607
Registered: 27-Sep-2003
Re: Wrong Java path
Posted: 16-Dec-2020 03:37   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
I have JDK8 installed for other purposes. I can probably discard it, but I need to do some testing first. I have more important matters right now.
davidekholm

Posts: 3,494
Registered: 18-Oct-2002
Re: Wrong Java path
Posted: 16-Dec-2020 12:13   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
ctwist wrote:
I have JDK8 installed for other purposes. I can probably discard it, but I need to do some testing first. I have more important matters right now.

It's probably some issue with Java that you can report directly to Oracle. I've seen other issues where multiple Java versions has caused trouble. This is sadly out of my control.
ctwist

Posts: 607
Registered: 27-Sep-2003
Re: Wrong Java path
Posted: 17-Dec-2020 01:43   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Attachment StartJAlbum.cmd (489 bytes)
I doubt that Oracle will provide free advice on multiple Java versions; it is probably something that we are doing wrong. Also it works for JeffTucker but not for me, so I don't know all the conditions that cause the problem.

However I have made some progress. An improved version of StartJAlbum.cmd is attached:
  • Instead of using the Windows path to select the Java version, it temporarily prepends the JRE Path from Jalbum.ini to the Windows path. JAlbum's "Help/About/System/java.library.path" confirms that this path is used. It also shows the correct java.home.
  • ENDLOCAL is removed. This runs implicitly at the end of a batch script (cosmetic).
So, if you have multiple versions of Java installed (maybe you are testing OpenJDK 15), and you want to use StartJalbum.cmd to start jAlbum, you can select the Java version by changing Jalbum.ini.

This seems to work well for me.

Edited by: ctwist on 17-Dec-2020 00:31

Edited by: ctwist on 01-Jan-2021 13:29
A slightly improved StartJalbum.cmd is attached. This hides the command prompt window.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums