• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

jar in Jdk 1.7

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How run jar file using jdk 1.7. and When i run simple program HelloWorld.java run through command-prompt then compiler show at runtime could not load main class. Tell me solution.

Thanks in advance
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Please show us your code and tell us the exact commands that you are using to compile and run your application. Right now you haven't given us enough details to tell you exactly what's wrong.
 
Khushdeep Singh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sir, My old jar file which i created through Eclipse and netbean and new created jar files not run. but code is running in eclipse and netbean.

When i click on created jar file . then it generate pop window which show error: unable to launch application.


when i click on details then it show....

MissingFieldException[ The following required field is missing from the launch file: <jnlp>]
at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Khushdeep Singh wrote:How run...



Please don't abuse colors like that.

It makes your post hard to read. Only use color sparingly for highlighting or correlating small amounts of text.

Thanks!
 
Marshal
Posts: 80218
423
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeff Verdegan wrote: . . . Please don't abuse colors like that. . . .

I have got rid of the green from the text.
 
Campbell Ritchie
Marshal
Posts: 80218
423
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And what is in the manifest file in your .jar?
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you trying to run the application as a Java Web Start application?
 
Khushdeep Singh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My manifest file contain....

Manifest-Version: 1.0
Class-Path: . Reader_lib/poi-3.7-20101029.jar Reader_lib/itextpdf-5.1.
3.jar
Main-Class: DateReaderMain

where DateReaderMain is main class.


and i run this application as Java Application.

This application work in eclipse. but when i create jar file of this application through eclipse but jar file not working. Even my old jar files which working on old version of jdk 1.6 . but not working on jdk 1.7.
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the exact command that you are typing in on the command prompt to start the application?

Is your DateReaderMain class not in a package?
 
Campbell Ritchie
Marshal
Posts: 80218
423
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
. . . and I presume by the blank line in your post that you have a blank line at the end of the manifest file; that blank line is necessary.
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The stack trace that you posted indicates that you're trying to run the application via Java Web Start.

Khushdeep Singh wrote:MissingFieldException[ The following required field is missing from the launch file: <jnlp>]
at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

 
Anderson gave himself the promotion. So I gave myself this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic