javapowershelloracleformsjava-2djava-21

When running java against a jar java2d is not being found?


I am using client host commands from powershell to launch a Oracle forms FSAL via the following command:

java -jar "fsal jar location" -url "url"

This command works except there is a scaling issue which Oracle lists a known workaround for, however when adding any of the specific java arguments, it fails with errors.

java -Dsun.java2d.uiScale=1 -jar "fsal jar location" -url "url"

Error: Could not find or load main class .java2d.uiScale=1

This has been attempted with =1.0 as well, There seems to be issue with calling java2d in general. I have attempted launching against a java8, jdk21, and a slimmed java version for our deployment version

I need either a fix for the Windows 11 scaling issue (fonts are distorted if not 100% scaling eg. client at 125% or 150%) or a fix for java2d not being found.

UPDATE: Doublechecked for a "copy bug" and command is seemingly not being affected by a rogue funky character. Even retyped not copied in the windows powershell ISE. I flipped through the various Java's again and got an additional message with JDK21

Error: Could not find or load main class .java2d.uiScale=1
Caused by: java.lang.ClassNotFoundException: /java2d/uiScale=1

Update 2: realized I never mentioned client host commands from Powershell which was an oversight on my part.


Solution

  • Found the issue. Basically, its not a funky character, its that the powershell functionally is handling the command line call different like THIS post. so the correct syntax here is as follows

    java -Dsun.java2d.uiScale=1 -jar "fsal jar location" -url "url"
    

    Becomes

    java '-Dsun.java2d.uiScale=1' -jar "fsal jar location" -url "url"
    

    otherwise the PS interpreter separates on the period yielding
    -Dsun
    .java2d.uiscale=1