I want to create a standard Java Project using Java JDK 21
If I can compile and run the project in Debug mode and run the program using Debug I receive the message
Java Hotspot ™ 74-bit Server VM warning : Option -XDebug was depreciated in JDK 22 and will likely be removed in a future release. - otherwise the program runs in debug mode. What about future versions which debuggger will be used in futures versions?
If I compute the program in Release mode - The program build without error message but can not be executed (unable to start program) - any solutions?hank you
I think this message is safe to ignore; it’s just an extra (deprecated) parameter we’re passing to the Java debug engine. Thanx for reminding me, i’ll have that cleaned up.
Curious. Is that with a speciifc project, ir any project (e.g. even a fresh new app from template)? I’ll have a check when i get a chance.
I created a ne project Heelo Java (nothing special). If I compile it in Visual studio 2022 with Water I can compile and run it in debug mode. If I compile it in Visual Studio 2022 release mode I can not run it in release mode.
The issue is that compiling a small program in Visual Studio 2022 Waters in release mode and then trying to executte the generated program in Visual Studio 2022 in release mode (no debug) the program does not work
The error message is:
Unable to start program
C:\users\chris\source\repo\HelloJava\HelloJava\bin\Release\HelloJava.jar
C:\users\chris\source\repo\HelloJava\HelloJava\bin\Release\HelloJava.jar is not a valid Win32 application
i’m still confused here whether the issue is Visual Studio vs. Water or whether it’s Debug vs Release, for you.
(Here, i can build and run a fresh Java console app from template, for either Debug or Release, both in Fire (on Mac), Water, and Visual Studio 2022 (on Windows), and it launches successfully in every case)
Ok, I try gain
I start windows 2022. Within VS2022 I create a new Java progran Hello World. I then compile it in debug mode and run it in debug mode. The program runs ok. I then compile it using release moe, it compiles without error but when I try tto run it it fails (with the error message above)
I still cannot reproduce this issue, however. Could you send me either your sample project or (preferably both) the Release executable that fails to run?
I believe this could be one of two possible issues:
(a) the Release binary is bad, somehow
(b) VisualS tudio tries to run it wrongly (as Win32 .exe, from the error"), somehow
The problem is, neither one happens for me in my tests here, yesterday.