FULL PRODUCT VERSION :
On Mac:
java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)
On Linux:
java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Verified on both Linux (Centos7, recent update) and Mac OS-X (10.11.6). On either platform, when a module is compiled per the documentation, a Jar is created per the documentation, and then the Jar is packaged per the documentation, if one then installs the DMG (on Mac) or RPM (on Linux) and attempts to execute the application, an error message is displayed, saying, "module ... does not have a MainClass attribute"; yet, Jar was run with --main-class <full-class-name>, and javapackager was run with -appclass <full-class-name>.
A DESCRIPTION OF THE PROBLEM :
Error message is produced, instead of the packaged application executing.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Clone public github project cliffbdf/small.
2. Run each makefile command in sequence.
3. On Mac, install the DMG file that gets produced; assuming that you installed it into the /Applications directory, then attempt to run the file, /Applications/smallish.app/Contents/MacOS/smallish
3. On Linux, install the RPM:
sudo yum -y --nogpgcheck localinstall smallish-1.0-1.x86_64.rpm
and attempt to run the file in /opt/smallish/smallish
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The application should produce this console message:
Greetings!
ACTUAL -
The following error message is generated, on both the Mac and Linux:
module small does not have a MainClass attribute, use -m <module>/<main-class>
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Please see above.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
Please see public github project cliffbdf/small
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
None identified - have tried many things. The closest mention I have found online pertaining to my error is this:
https://books.google.com/books?id=xjy4DgAAQBAJ&pg=PA37&lpg=PA37&dq=module+does+not+have+a+MainClass+attribute&source=bl&ots=SqgHs0RgQq&sig=x8uibKfUjM0yEsmZKxUm69FbfU4&hl=en&sa=X&ved=0ahUKEwikjOfGxILYAhXFIcAKHboeDI4Q6AEIPDAD#v=onepage&q=module%20does%20not%20have%20a%20MainClass%20attribute&f=false
but this did not help me to resolve the problem.
It is possible that I am using the tools wrong, but I have scoured the online documentation for jar and javapackager, and believe that I am following the instructions; so if I am doing so incorrectly, then perhaps the documentation is incomplete.
On Mac:
java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)
On Linux:
java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Verified on both Linux (Centos7, recent update) and Mac OS-X (10.11.6). On either platform, when a module is compiled per the documentation, a Jar is created per the documentation, and then the Jar is packaged per the documentation, if one then installs the DMG (on Mac) or RPM (on Linux) and attempts to execute the application, an error message is displayed, saying, "module ... does not have a MainClass attribute"; yet, Jar was run with --main-class <full-class-name>, and javapackager was run with -appclass <full-class-name>.
A DESCRIPTION OF THE PROBLEM :
Error message is produced, instead of the packaged application executing.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Clone public github project cliffbdf/small.
2. Run each makefile command in sequence.
3. On Mac, install the DMG file that gets produced; assuming that you installed it into the /Applications directory, then attempt to run the file, /Applications/smallish.app/Contents/MacOS/smallish
3. On Linux, install the RPM:
sudo yum -y --nogpgcheck localinstall smallish-1.0-1.x86_64.rpm
and attempt to run the file in /opt/smallish/smallish
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The application should produce this console message:
Greetings!
ACTUAL -
The following error message is generated, on both the Mac and Linux:
module small does not have a MainClass attribute, use -m <module>/<main-class>
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Please see above.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
Please see public github project cliffbdf/small
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
None identified - have tried many things. The closest mention I have found online pertaining to my error is this:
https://books.google.com/books?id=xjy4DgAAQBAJ&pg=PA37&lpg=PA37&dq=module+does+not+have+a+MainClass+attribute&source=bl&ots=SqgHs0RgQq&sig=x8uibKfUjM0yEsmZKxUm69FbfU4&hl=en&sa=X&ved=0ahUKEwikjOfGxILYAhXFIcAKHboeDI4Q6AEIPDAD#v=onepage&q=module%20does%20not%20have%20a%20MainClass%20attribute&f=false
but this did not help me to resolve the problem.
It is possible that I am using the tools wrong, but I have scoured the online documentation for jar and javapackager, and believe that I am following the instructions; so if I am doing so incorrectly, then perhaps the documentation is incomplete.