<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I run this in  java/classes after running ant test.nashorn, so our invocations are slightly different.  I am trying to debug the HelloWorldProgramOutput.java, which I don’t know if you’ve tried to debug or not.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>HelloWorldProgramOutput.class is a file in my classes folder, so yes it’s executable.  I’m trying to run it to dump out Java, JSON, etc.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>My problems are still current:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>coderextreme@DESKTOP-DOPK2VD MINGW64 /c/x3d-code/www.web3d.org/x3d/stylesheets/java/classes</p><p class=MsoNormal>$ java -cp ../jars/X3DJSAIL.3.3.full.jar";." HelloWorldProgramOutput -tofile foo.java -toJava</p><p class=MsoNormal>parameter: "-tofile" "foo.java" for result file name root foo</p><p class=MsoNormal>parameter: "-toJava" for conversion to Java source code</p><p class=MsoNormal>[Error] Source model file name is empty, therefore file loading not possible.</p><p class=MsoNormal>Java program "HelloWorldProgramOutput" self-validation test results: success</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Please test with HelloWorldProgramOutput.class, thanks! I’m trying to debug X3dToJava.xslt AND X3DJSAIL. If output from X3dToJava.xslt no longer takes arguments, please take that code out, or replace it with something that works.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Note that I do not have a -jar argument. That is intentional.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10</p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='border:none;padding:0in'><b>From: </b><a href="mailto:brutzman@nps.edu">Don Brutzman</a><br><b>Sent: </b>Friday, July 20, 2018 6:32 AM<br><b>To: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a><br><b>Cc: </b><a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a><br><b>Subject: </b>Re: X3DJSAIL running generated Java program to produce Java</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks for the report.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>First I think that your jar is likely out of date, the diagnostics are familiar from the past but do not match current configuration.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>http://www.web3d.org/specifications/java/X3DJSAIL.html#Downloads</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Second, the error is trying to tell you that the file "HelloWorldProgramOutput" is not found.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I get the following:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>[Error]  [org.web3d.x3d.jsail.CommandLine] file not found: HelloWorldProgramOutput</p><p class=MsoNormal>Usage: java [-classpath X3DJSAIL.*.jar] org.web3d.x3d.jsail.CommandLine [sourceModel.x3d | package.path.ProgramName | -help | -page | -resources | -tooltips]</p><p class=MsoNormal>        [-tofile [resultFile.*]] [-properties [propertiesFile]] [-validate]</p><p class=MsoNormal>        [sourceModel.exi -fromEXI] [sourceModel.gz -fromGZIP] [sourceModel.zip -fromZIP]</p><p class=MsoNormal>        [-toX3D | -toXML | -toHTML | -toMarkdown | -toTidy | -toClassicVrml | -toJava | -toJSON | -toVRML97 | -toX3DOM | -toX_ITE | -toEXI | -toGZIP | -toZIP]</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Which likely makes sense for your system too, since the examples/ directory does not have any file "HelloWorldProgramOutput" except for those with a file extension added.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Incidentally to facilitate such testing using IDE debug mode, I added a utility method CommandLine.run(String arguments) which will accept a single string and split it into args.  Example use is now in HelloWorld.java main method, adapted here:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>   // Quick test of CommandLine capability to facilitate debugging:</p><p class=MsoNormal>   org.web3d.x3d.jsail.CommandLine.run("HelloWorldProgramOutput  -tofile foo.java -toJava"); // allows simple testing</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>On 7/17/2018 6:51 PM, John Carlson wrote:</p><p class=MsoNormal>> Trying to produce Java source code from Java class, not working ,please advise:</p><p class=MsoNormal>> </p><p class=MsoNormal>> coderextreme@DESKTOP-DOPK2VD MINGW64 /c/x3d-code/www.web3d.org/x3d/stylesheets/java/classes</p><p class=MsoNormal>> </p><p class=MsoNormal>> $ java -cp ../jars/X3DJSAIL.3.3.full.jar";." HelloWorldProgramOutput -tofile foo.java -toJava</p><p class=MsoNormal>> </p><p class=MsoNormal>> parameter: "-tofile" "foo.java" for result file name root foo</p><p class=MsoNormal>> </p><p class=MsoNormal>> parameter: "-toJava" for conversion to Java source code</p><p class=MsoNormal>> </p><p class=MsoNormal>> [Error] Source model file name is empty, therefore file loading not possible.</p><p class=MsoNormal>> </p><p class=MsoNormal>> Java program "HelloWorldProgramOutput" self-validation test results: success</p><p class=MsoNormal>> </p><p class=MsoNormal>> coderextreme@DESKTOP-DOPK2VD MINGW64 /c/x3d-code/www.web3d.org/x3d/stylesheets/java/classes</p><p class=MsoNormal>> </p><p class=MsoNormal>> $ java -cp ../jars/X3DJSAIL.3.3.full.jar";." HelloWorldProgramOutput ../examples/HelloWorldProgramOutput.x3d -tofile foo.java -toJava</p><p class=MsoNormal>> </p><p class=MsoNormal>> WARNING: "HelloWorldProgramOutput" model invocation is attempting to load file "../examples/HelloWorldProgramOutput.x3d" instead of simply validating itself...</p><p class=MsoNormal>> </p><p class=MsoNormal>> No, CommandLine is not the correct answer.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>actually yes I think precise CommandLine invocation was the answer.  given that your invocation was different than mine, you might have also been getting Java treating "HelloWorldProgramOutput" as an executable referrence.  Whatever - recommend omitting "HelloWorldProgramOutput" above and getting switches correct.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> Are we trying to provide a secure mechanism for people to write code so you can’t get the X3D XML or Java source code back out?    What about decompilers?</p><p class=MsoNormal>nope, no hidden protections.  CommandLine source shows that most of the code is simply trying to parse arguments correctly.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>all the best, Don</p><p class=MsoNormal>-- </p><p class=MsoNormal>Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman@nps.edu</p><p class=MsoNormal>Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149</p><p class=MsoNormal>X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman</p><p class=MsoNormal><o:p> </o:p></p></div></body></html>