structurizr / lite

Structurizr Lite
https://docs.structurizr.com/lite
MIT License
226 stars 26 forks source link

Java command for Spring Boot appears to be malformed #70

Closed BruceEckel closed 1 year ago

BruceEckel commented 1 year ago

Description

Following the instructions here: https://structurizr.com/share/76352/documentation#spring-boot I create this command:

java -Djdk.util.jar.enableMultiRelease=false -jar structurizr-lite-3087.war C:\git\python-experiments\C4-DSL

Which produces the following:

PS C:\tools> java -Djdk.util.jar.enableMultiRelease=false -jar structurizr-lite-3087.war C:\git\python-experiments\C4-DSL
Error: Could not find or load main class .util.jar.enableMultiRelease=false
Caused by: java.lang.ClassNotFoundException: /util/jar/enableMultiRelease=false

I believe the first argument is the problem, because I get the same error message if I lop off the rest of the line:

PS C:\tools> java -Djdk.util.jar.enableMultiRelease=false
Error: Could not find or load main class .util.jar.enableMultiRelease=false
Caused by: java.lang.ClassNotFoundException: /util/jar/enableMultiRelease=false
PS C:\tools>

Steps to reproduce

(Follow instructions above)

Screenshot

No response

Code sample

No response

Configuration

    Directory: C:\tools

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---            7/3/2023 11:39 AM      125042412 structurizr-lite-3087.war

Severity

Major

Priority

High

Resolution

I have no budget, please fix this for free

More information

PS C:\tools> java --version openjdk 20.0.1 2023-04-18 OpenJDK Runtime Environment (build 20.0.1+9-29) OpenJDK 64-Bit Server VM (build 20.0.1+9-29, mixed mode, sharing)

(I also tried it with JDK 18 with the same results)

Processor Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz 1.50 GHz Installed RAM 16.0 GB (15.6 GB usable) System type 64-bit operating system, x64-based processor Edition Windows 11 Home Version 22H2 Installed on ‎12/‎10/‎2022 OS build 22621.1848

simonbrowndotje commented 1 year ago

Are you using PowerShell? If so, it might be this issue -> https://github.com/PowerShell/PowerShell/issues/15541

You could try quoting the command arguments, for example:

java "-Djdk.util.jar.enableMultiRelease=false" -jar structurizr-lite-3087.war C:\git\python-experiments\C4-DSL
BruceEckel commented 1 year ago

That worked -- perhaps a note at https://structurizr.com/share/76352/documentation#spring-boot would be helpful?

Or I wonder if the quoted version might work for everyone?

As the app starts, I get the license agreement as an INFO log trace.

The expected files were created and their contents looked reasonable:

    Directory: C:\git\python-experiments\C4-DSL

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----            7/3/2023  2:16 PM                .structurizr
-a---           6/22/2023 11:31 AM           6822 c4-dsl-extension.dsl
-a---           6/22/2023 11:31 AM            363 test.dsl
-a---            7/3/2023  2:08 PM            283 workspace.dsl
-a---            7/3/2023  2:16 PM           2224 workspace.json

However, when I opened the browser to http://localhost:8080/, it produced this forever:

image

simonbrowndotje commented 1 year ago

That worked -- perhaps a note at https://structurizr.com/share/76352/documentation#spring-boot would be helpful?

Thanks, I've added a note to the docs ... I don't use Windows, so I've not seen that before. 😀

I'm not sure why Lite isn't rendering anything for you, so feel free to open a new issue with the contents of your workspace.dsl file - I'm wondering whether something in there is causing the problem.