Hi there,
Im trying to make a jar executeable (main()) from a project so I made a fileset including the right classes (I hope) by looking at the "import" information about the "main" file Im going to execute, right(?).
Thereafter Ive updated the manifest file with
jar umf <manifest-file> <jar-file>
, and it looks like:
Manifest-Version: 1.0
Main-Class: com.. (ps without ".class")
Created-By: Ant 1.4.1
..ok...
then Ive updated the jar file with "jndi.properties" like this:
jar uf <jar-file> jndi.properties
, ps the jndi.properties file reside in the root of the project.
..ok, so far, so good. Then I try to execute the jar file with:
java -jar
and get this:
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet param
eter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:643)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:283)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at com.companyname.scheduler.SchedulerTimer.(SchedulerTimer.java:42)
at com.companyname.companynameStart.main(companynameStart.java:37)
Exception in thread "main" java.lang.NoClassDefFoundError: javax/ejb/EJBObject
at com.companyname.companynameStart.main(companynameStart.java:41)
... please help, Im stuck!
Thanks, nikolaj