How do I tell appClient what class to run?
Does anybody know how to use appClient in Glassfish to run a class when you want to run a class different to the one specified in the manifest? I've been trying using the mainClass parameter but it ignores it and just uses the one in the manifest. It would be useful in Chapter 13 where you have several classes, and you want to run the JMS sender and JMS receiver without changing the manifest in the pom.
I'm probably just using the wrong options but I've specified the jar and mainClass but not having any luck?
I'm probably just using the wrong options but I've specified the jar and mainClass but not having any luck?
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?Have you tried : appclient -client chapter13-1.0.jar
-
Inappropriate?HI, yes I've tried that but chapter 13 has both a sender and receiver class.
The main class defined in the manifest runs when I use appclient but I'd like to be able to run any class from the jar without having to change the class in the manifest, i.e. start one jvm running the sender and start another running the receiver but both using the same jar -
Inappropriate?I think if you append the class you want to run (including the package) after you specify the jar, it picks the right class.
I was using the -mainClass option which doesn't seem to work but using -jar <jarname> <class> does seem to work</class></jarname> -
Inappropriate?In the examples I've set the Main-Class: attribute inside the MANIFEST.MF file. I let Maven set it :
<build>
<plugins>
<plugin>
<groupid>org.apache.maven.plugins</groupid>
<artifactid>maven-jar-plugin</artifactid>
<version>${plugin-jar-version}</version>
<configuration>
<archive>
<manifest>
<mainclass>com.apress.javaee6.demo01.Main</mainclass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
The company says
this answers the question
Loading Profile...



EMPLOYEE
