This is the mail archive of the
java-discuss@sources.redhat.com
mailing list for the Java project.
Re: gcj and cygnus
1) don't forget that in this mode, CLASSPATH is *ignored*
2) try "java -jar <your-jar-file-with-MainClass>" and see what error is given.
3) be sure that the "java.exe" program that is in the windows
directory belongs to a java2 install and not java 1.1...
4) reinstall the JDK/JRE
5) dig in the registry
Cedric
Mark Kimsal wrote:
> Yeah, I know about the Main-Class attribute in the Manifest file, it's just
> that my jars don't do anything when i double click them.
> win32-JDK1.2.0,1.2.2,1.3rc1,1.3.0 or linux1.3.0
>
> Cedric Berger wrote:
>
> > mark kimsal wrote:
> >
> > > > There is basically 2 option for the "stupid user" using standard JDKs:
> > > > - create an executable jar file. It's very simple to do, and the user
> > > > just has to double click on the file and it starts like an .exe.
> > > > no classpath to set-up.
> > > > It's plain simple to create but I'm amazed how few developer do it.
> > > > Of course, you need a java 2 runtime...
> > >
> > > I've never heard of an executable jar file, how do you create one?
> >
> > Basically, you add the following line to the manifest file of your
> > jar file:
> > Main-Class: com/tapinternet/niceapp/MainClass
> >
> > It works with both the JRE 1.2 or 1.3. there is also a mechanism
> > for automatically downloading the needed extensions, but I've
> > never used it.
> >
> > Cedric
> >
> > >From http://java.sun.com/j2se/1.3/docs/guide/jar/jarGuide.html:
> >
> > On Win32 systems the Java 2 Runtime Environment's installation program
> > will register a default association for Jar files so that
> > double-clicking a
> > Jar file on the desktop will automatically run it with javaw -jar.
> > Dependent extensions bundled with the application will also be loaded
> > automatically. This feature makes the end-user runtime environment
> > easier
> > to use on Win32 systems.
> >
> > The Solaris 2.6 kernel has already been extended to recognize the
> > special
> > "magic" number that identifies a Jar file, and to invoke java -jar on
> > such a
> > Jar file as if it were a native Solaris executable. A application
> > packaged in
> > a Jar file can thus be executed directly from the command line or by
> > clicking an icon on the CDE desktop.
> >
> > from http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Main Attributes:
> >
> > attribute defined for stand-alone applications
> > This attribute is used by stand-alone applications that are bundled
> > into
> > executable jar files which can be invoked by the java runtime directly
> > by running "java -jar x.jar".
> > Main-Class :
> > The value of this attribute defines the relative path of the main
> > application class which the launcher will load at startup time.
> > The value
> > must not have the .class extension appended to the class name.