• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Question about runnable JARs

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have written some small programs and I am attempting to make my first runnable JAR file. The program will run fine within Netbeans and Eclipse. However, when I create my runnable JAR, the resultant JAR gives me an error saying that the program can't find my main class when I try and execute it. What I don't understand is how the compiler can find my main class to compile the program and yet the final executable code can't find it to run it? Is there some file I can open up and type my class locations into by hand?

Also, on a related not, I was hoping someone might be able to help me with something. So far, the books I have found about Java programming only talk about coding and not a lot about how to configure my settings in the IDE (which consume about 95% of my time spent on the subject). So far, I like coding and grinding out a solution in code and feel that I haven't struggled nearly as much on the material in the books I've worked through as I have on battling with configurations and IDE settings and such, yet I find it a lot easier to find reading material and instructional posts about coding than I do about the more difficult issues.

Can anoyone here recommend any good books on Eclipse or Netbeans?
 
Ranch Hand
Posts: 451
1
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

You would need to have a Manifest file with the following detail:



And then you can execute it using the command:



Raj.

 
Marshal
Posts: 74020
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

If you are new to Java™, you would do better to forget IDEs and get a decent text editor (eg gedit, NotePad2, NotePad++). Set its options to automatic indentation (change 1 tab to 4 spaces), bracket and syntax highlighting. Use that to edit your Java™ text and run it from the command line. That way you won’t spend 95% of your time on the IDE.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic