Thread Locked This thread is locked - replies are not allowed.



Permlink Replies: 150 - Pages: 11 [ Previous | 1 ... 3 4 5 6 7 8 9 | Next ] - Last Post: 27 Sep 22, 21:55 Last Post By: davidekholm Threads: [ Previous | Next ]
davidekholm

Posts: 3,471
Registered: 18-Oct-2002
Re: jAlbum on Java 18
Posted: 21 Sep 22, 16:10   in response to: JeffTucker in response to: JeffTucker
What mainly motivates me to use Java 19 currently is to have the rendering pipeline updated for Macs to Metal.

I've prepared jAlbum for Java 19 by rewriting loads of deprecated calls, mostly affecting keyboard shortcuts. Seems to work here, but please test the updated beta core jar.
JeffTucker

Posts: 8,127
Registered: 31-Jan-2006
Re: jAlbum on Java 18
Posted: 21 Sep 22, 16:40   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
I've prepared jAlbum for Java 19 by rewriting loads of deprecated calls, mostly affecting keyboard shortcuts. Seems to work here, but please test the updated beta core jar.

Some quick testing, and no smoke and flames so far.
JeffTucker

Posts: 8,127
Registered: 31-Jan-2006
Re: jAlbum on Java 18
Posted: 21 Sep 22, 17:09   in response to: JeffTucker in response to: JeffTucker
Found a potential show-stopper. With that latest core, some older skins refuse to load. Need to do a bit more checking, then I'll post back....

ETA: It goes back further than that, and I'm not sure how far, exactly. But we need to have a little offline discussion about the skins that won't load.

ETA: The problem goes back at least to jAlbum 28.2b5 (jAlbum 28.1.5 is fine). Try loading, for example, Classic Aligned 2. I'll do some experimenting to ID the others.

ETA: I've ID'ed the affected skins, and they all have one thing in common - each one has an onload.bsh that puts up a dialog box of some sort upon skin loading, involving licensing. The list is thankfully short:

  • Classic Aligned 2
  • LightBoxes
  • Nano
  • Pinto

And I think you know what I'm going to say next. ;)
JeffTucker

Posts: 8,127
Registered: 31-Jan-2006
Re: jAlbum on Java 18
Posted: 21 Sep 22, 18:17   in response to: JeffTucker in response to: JeffTucker
A little more sleuthing reveals that the popup dialog box in each skin may not be the culprit. The other thing all four skins share is a routine in onload.bsh for retrieving a list of the available fonts on the system:
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
fontList = ge.getAvailableFontFamilyNames();
The same thing, done in a compiled UI, works just fine.
davidekholm

Posts: 3,471
Registered: 18-Oct-2002
Re: jAlbum on Java 18
Posted: 21 Sep 22, 18:52   in response to: JeffTucker in response to: JeffTucker
What error do you see?
JeffTucker

Posts: 8,127
Registered: 31-Jan-2006
Re: jAlbum on Java 18
Posted: 21 Sep 22, 18:53   in response to: davidekholm in response to: davidekholm
Here ya' go:
jAlbum 29b13 system console running BeanShell (BeanShell Engine)
This section captures debug prints sent to System.out and System.err
The top section evaluates expressions.
Press Ctrl+E to evaluate an expression. (Evaluates selected text if selection is active)
You have access to the basic jAlbum implicit objects such as engine and window
 
Sample expressions:
4*(3+2); // Basic calculations
engine.getSkin(); // Use of implicit object
for (AlbumObject ao : selectedObjects) System.out.println(ao); // Iterate over selected objects
window.messageBox("You can interact with any Java object");
Skin loading: 0.486s
se.datadosen.util.ScriptException: java.lang.reflect.InaccessibleObjectException: Unable to make public java.lang.String[] sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames() accessible: module java.desktop does not "exports sun.java2d" to unnamed module @2928854b in onload.bsh at line number 34
	at se.datadosen.util.ScriptException.of(ScriptException.java:59)
	at se.datadosen.jalbum.AlbumBean.processScript(AlbumBean.java:2945)
	at se.datadosen.jalbum.JAlbumFrame.executeScript(JAlbumFrame.java:1323)
	at se.datadosen.jalbum.JMainSettingsPanel$5$1.run(JMainSettingsPanel.java:346)
Caused by: javax.script.ScriptException: Sourced file: inline evaluation of: ``// +++ Classic Aligned 2 debug info: 3.1.7 onload.bsh +++  //  /**   * This scri . . . '' unknown error: Unable to make public java.lang.String[] sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames() accessible: module java.desktop does not "exports sun.java2d" to unnamed module @2928854b : at Line: 34 : in file: inline evaluation of: ``// +++ Classic Aligned 2 debug info: 3.1.7 onload.bsh +++  //  /**   * This scri . . . '' : fontList = ge .getAvailableFontFamilyNames ( ) 
 in inline evaluation of: ``// +++ Classic Aligned 2 debug info: 3.1.7 onload.bsh +++  //  /**   * This scri . . . '' at line number 34
	at bsh.BshScriptEngine.evalSource(BshScriptEngine.java:96)
	at bsh.BshScriptEngine.eval(BshScriptEngine.java:57)
	at java.scripting/javax.script.AbstractScriptEngine.eval(Unknown Source)
	at se.datadosen.jalbum.AlbumBean.doProcessExpression(AlbumBean.java:3002)
	at se.datadosen.jalbum.AlbumBean.processExpression(AlbumBean.java:2987)
	at se.datadosen.jalbum.AlbumBean.processScript(AlbumBean.java:2942)
	... 2 more
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make public java.lang.String[] sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames() accessible: module java.desktop does not "exports sun.java2d" to unnamed module @2928854b
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source)
	at java.base/java.lang.reflect.Method.checkCanSetAccessible(Unknown Source)
	at java.base/java.lang.reflect.Method.setAccessible(Unknown Source)
	at bsh.Reflect.resolveJavaMethod(Reflect.java:439)
	at bsh.Reflect.resolveExpectedJavaMethod(Reflect.java:375)
	at bsh.Reflect.invokeObjectMethod(Reflect.java:77)
	at bsh.Name.invokeMethod(Name.java:859)
	at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:75)
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:102)
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47)
	at bsh.BSHAssignment.eval(BSHAssignment.java:77)
	at bsh.Interpreter.eval(Interpreter.java:672)
	at bsh.Interpreter.eval(Interpreter.java:766)
	at bsh.Interpreter.eval(Interpreter.java:755)
	at bsh.BshScriptEngine.evalSource(BshScriptEngine.java:82)
	... 7 more
davidekholm

Posts: 3,471
Registered: 18-Oct-2002
Re: jAlbum on Java 18
Posted: 21 Sep 22, 18:55   in response to: davidekholm in response to: davidekholm
I see it now. It's probably some incompatibility between BeanShell and the stricter module system of Java 18. Switching to Groovy as scripting language resolves it. BeanShell has been abandonware for over a decade so it's really high time to phase it out.
JeffTucker

Posts: 8,127
Registered: 31-Jan-2006
Re: jAlbum on Java 18
Posted: 21 Sep 22, 18:58   in response to: davidekholm in response to: davidekholm
BTW, unrelated, but I just took a quick look at jalbum.ini, just to make sure there wasn't something odd in there (that "sun.java2d" rang a bell). There's a stray extra delimiter in one parameter. Doesn't hurt anything, but it caught my eye:
-Djava.library.path="C:\Program Files\jAlbum\\jre64\bin"
davidekholm

Posts: 3,471
Registered: 18-Oct-2002
Re: jAlbum on Java 18
Posted: 21 Sep 22, 18:58   in response to: davidekholm in response to: davidekholm
I hope to have time to investigate this further soon. Googling Java 18 + java.lang.reflect.InaccessibleObjectException reveals similar problems. As Groovy doesn't seem to face this problem, I'd vote to move to Groovy.
davidekholm

Posts: 3,471
Registered: 18-Oct-2002
Re: jAlbum on Java 18
Posted: 21 Sep 22, 19:01   in response to: davidekholm in response to: davidekholm
One workaround might be to add --add-opens calls to jAlbum's command line, but I prefer to not having to open up everything now that Groovy can take it.
JeffTucker

Posts: 8,127
Registered: 31-Jan-2006
Re: jAlbum on Java 18
Posted: 21 Sep 22, 19:25   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
... I'd vote to move to Groovy.

Are you saying that an affected skin would have to be revised for Groovy, or that BeanShell would no longer be part of jAlbum at all?

The latter possibility doesn't horrify me. Laza is using Javascript everywhere. Based on my surprisingly quick success with changing one skin to Groovy, I'm pretty sure I could knock out the rest of them my skins in the course of a busy morning. Maybe this would be the right time to retire a lot of the orphan and obsolete skins.

Edited by: JeffTucker on 21 Sep 2022, 13:29 to make it clear that I'm not volunteering to convert anyone else's skins!
ctwist

Posts: 483
Registered: 27-Sep-2003
Re: jAlbum on Java 18
Posted: 21 Sep 22, 20:11   in response to: davidekholm in response to: davidekholm
If you move to Groovy, which versions of jAlbum are compatible with a Groovied skin?

Can a skin contain both Groovy and Beanshell scripts, for compatibility with old versions of jAlbum? Would a Groovy-compatible version of jAlbum automatically choose the Groovy scripts?
JeffTucker

Posts: 8,127
Registered: 31-Jan-2006
Re: jAlbum on Java 18
Posted: 21 Sep 22, 22:00   in response to: ctwist in response to: ctwist
ctwist wrote:
If you move to Groovy, which versions of jAlbum are compatible with a Groovied skin?

Groovy was introduced in jAlbum 17.1, but with the caveat that it was an experimental version of Groovy. I'd be cautious with it before jAlbum 19 or 19.2.

For my own skins, I don't care - they won't run on jAlbum versions that old anyway.
JeffTucker

Posts: 8,127
Registered: 31-Jan-2006
Re: jAlbum on Java 18
Posted: 21 Sep 22, 22:02   in response to: ctwist in response to: ctwist
ctwist wrote:
Would a Groovy-compatible version of jAlbum automatically choose the Groovy scripts?

It already does. If the template files are, e.g., init.bsh, it runs BeanShell. If they're init.groovy, it runs Groovy. It takes its cue solely from the file names.
RobM

Posts: 3,844
Registered: 4-Aug-2006
Re: jAlbum on Java 18
Posted: 21 Sep 22, 22:41   in response to: JeffTucker in response to: JeffTucker
JeffTucker wrote:
ctwist wrote:
If you move to Groovy, which versions of jAlbum are compatible with a Groovied skin?

Groovy was introduced in jAlbum 17.1, but with the caveat that it was an experimental version of Groovy. I'd be cautious with it before jAlbum 19 or 19.2.

I'd go for jAlbum 25.1 as a minimum, that was the last update of Groovy.
Legend
Forum admins
Helpful Answer
Correct Answer

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