Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java-only distribution #50

Closed
stuckyb opened this issue Mar 6, 2017 · 6 comments
Closed

Java-only distribution #50

stuckyb opened this issue Mar 6, 2017 · 6 comments

Comments

@stuckyb
Copy link
Owner

stuckyb commented Mar 6, 2017

It would be really cool to distribute ontobuilder in a way that required nothing more than the JRE on users' computers. E.g., it might be possible to compile all of the Jython code to Java classes and distribute the whole package as a jar file.

@jdeck88
Copy link
Collaborator

jdeck88 commented Mar 7, 2017 via email

@Annhiluc
Copy link
Collaborator

Annhiluc commented Apr 4, 2017

Following this repository: https://github.com/jsbruneau/jython-selfcontained-jar/

It should allow for all the file structure to remain the same.

@stuckyb
Copy link
Owner Author

stuckyb commented Apr 13, 2017

Just took a first look at the "jar_creation" branch. Looking good! One bug I noticed -- if you execute the OntoApp jar file without any command-line arguments, it dies with an "IndexError: index out of range: 0" exception. I haven't investigated it any further.

@stuckyb
Copy link
Owner Author

stuckyb commented Apr 14, 2017

Command-line argument parsing is proving to be a roadblock. To document the behavior in the different execution contexts, here are the results of invoking OntoPilot three different ways:

  1. Using an installed jython environment.
    • Launch command: $ jython python-src/bin/ontopilot_main.py
    • sys.argv: ['python-src/bin/ontopilot_main.py']
    • Console output: Unable to load the project configuration file.
  2. Using standalone jython JAR runtime environment.
    • Launch command: $ java -jar java-lib/jython-full.jar python-src/bin/ontopilot_main.py
    • sys.argv: ['python-src/bin/ontopilot_main.py']
    • Console outut: Unknown build target: "python-src/bin/ontopilot_main.py".
  3. Using single-JAR package (jython + OntoPilot in a single JAR file).
    • Launch command: $ java -jar dist/OntoApp.jar
    • sys.argv: []
    • Console output: IndexError: index out of range: 0

The console output of (1) is correct. Why (2) produces different output is not clear, since the value of the argument list is identical. (3) looks like a pain (as @Annhiluc already discovered) since the interpretation of sys.argv would have to be different.

The most important goal is to develop a distribution that doesn't require Jython installation as a prerequisite. Either option (2) or option (3) would achieve that, so for now, we should probably go with whichever is easiest to get working, while preserving the ability to run OntoPilot as in option (1).

@stuckyb
Copy link
Owner Author

stuckyb commented Apr 17, 2017

Thanks to commit 55e0d89, argument parsing in all 3 runtime contexts is now working. The incorrect console output in option (2) in the previous comment was evidently caused by a malfunctioning Jython JAR file; this file was updated in commit 55e0d89.

@stuckyb
Copy link
Owner Author

stuckyb commented Apr 24, 2017

Done!

@stuckyb stuckyb closed this as completed Apr 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants