[x3d-public] X3DJSAIL: command line options for conversion

Don Brutzman brutzman at nps.edu
Mon Sep 25 07:51:11 PDT 2017


Progress on X3DJSAIL command line support:  format conversions from .x3d to various alternatives now supported via command line (or Ant or presumably Maven) if X3DJSAIL and saxon .jar files are found in CLASSPATH.  Model validation occurs as part of this process.

http://www.web3d.org/specifications/java/X3dJavaSceneAuthoringInterface.html#CommandLine
========================================================================================
Command line invocation is feasible through use of the org.x3d.jsail.CommandLine class.

  *  Prerequisite: CLASSPATH correctly containing saxon9he.jar plus X3DJSAIL.3.3.classes.jar (or X3DJSAIL.3.3.full.jar):
     CLASSPATH confirmation: % set
     CLASSPATH='C:\x3d-code\www.web3d.org\x3d\stylesheets\java\jars\X3DJSAIL.3.3.classes.jar;C:\x3d-code\www.web3d.org\x3d\stylesheets\java\lib\saxon9he.jar'

  *  Invocation: java org.web3d.x3d.jsail.CommandLine [-help | sourceScene.x3d] [-file [resultFile.*]] [-toX3D | -toXML | -toClassicVrml | -toJSON | -toVRML97 | -toX3DOM | -toX_ITE]
     Example:    java org.web3d.x3d.jsail.CommandLine HelloWorld.x3d -toClassicVRML

  *  TODO debug direct .jar invocation (according to following)
     Expected usage: java -jar path/X3DJSAIL.*.jar [-help | sourceScene.x3d] [-file [resultFile.*]] [-toX3D | -toXML | -toClassicVrml | -toJSON | -toVRML97 | -toX3DOM | -toX_ITE]

Model validation is performed as part of this process.
========================================================================================

Regarding the TODO: your post on uber jar.

On 9/12/2017 7:44 PM, John Carlson wrote:
> See my code for loading a class from a classloader created from a jar URI.   You'll probably have to do that in addition to a URI resolver to find the jar within a jar.    Both sets of code have been posted under different purpose. Consider using .jnlp's referencing .jnlp (web start).
> 
> On Sep 12, 2017 5:21 PM, "Don Brutzman" <brutzman at nps.edu <mailto:brutzman at nps.edu>> wrote:
> 
>     Am trying to get baseline functionality working first.  Then can add robustness such as checking directory paths, reporting problems with output-directory write permissions, etc.
> 
>     Still feels close... just need to get "jar within a jar" working, long classpaths aren't friendly or portable.
> 
>     On 9/11/2017 2:38 PM, John Carlson wrote:
> 
>         Try using JavaWS (web start) and a .jnlp file.  I am not sure of the status of these as I have not used them since Java 6.

Those are completely different... not looking to create a web-based application at this point, just a reusable library.

>         Or you can create an uber jar.
> 
>         There should be a way to include a jar in a jar, but it’s non-standard, custom code.
> 
>         Or change the classpath, removing the usefulness of a single jar.
> 
>         What you’ve got here is kind of  a random fix to a non-issue.   Did you address my issues with creating output folders?
> 
>         Also, I am not sure what you are doing with the jar url with stylesheets, but I’m going to assume it works for now.
> 
>         John
"Uber jar" is really interesting, hadn't found that earlier.  Looks relevant and promising, will look at implementing it next time.

https://stackoverflow.com/questions/11947037/what-is-an-uber-jar
================================================================
Über is the German word for above or over, as in a line from a previous national anthem: Deutschland, Deutschland, über alles (Germany, Germany above all else).

Hence, in this context, an uber-jar is an "over-jar", one level up from a simple "jar", defined as one that contains both your package and all its dependencies in one single JAR file. The name can be thought to come from the same stable as ultrageek, superman, hyperspace, and metadata, which all have similar meanings of "beyond the normal".

The advantage is that you can distribute your uber-jar and not care at all whether or not dependencies are installed at the destination, as your uber-jar actually has no dependencies.

All the dependencies of your own stuff within the uber-jar are also within that uber-jar. As are all dependencies of those dependencies. And so on.
================================================================

all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman



More information about the x3d-public mailing list