Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Jar files creation

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,

I'm just starting java development and I need to create a jar file to deploy it to another user. I have the following folder's struture:
c:\rhiegen\downloads\projects\server
and my .java, .class are inside ...\server. They are:
Servidor.java
Servidor.class
Servidor.txt which is my manifest file with the following content
Main-Class: Servidor.Main
Then I issued the following command in the hope of creating my jar file:

jar -cfmv Servidor.jar *.* *.class from inside ...\server folder.
It creates Servidor.jar but when I click it I doesn't execute itself like an .exe file and shows the following error message:
invalid or corrupt jarfile: c:\rhiegen\downloads\projects\server\Servidor.jar.

How can I create an self executing jar file so that I can send it to anyone even if he has not java installed in your computer?

Thanks in advance,


Rhiegen
[originally posted on jforum.net by rhiegen]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rhiegen,

JForum's site is about the project "JForum", not about general discussion about java .

Are you Brazilian? if so, you can go to http://www.guj.com.br/forum and post your question there ( there is already many questions about jar files, and many answers ).

If you are not brazilian, you can use the Java Forums Discussion from java.net, at http://forum.java.sun.com/

Rafael
[originally posted on jforum.net by Rafael Steil]
 
knowledge is the difference between drudgery and strategic action -- tiny ad
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic