This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jar not ok when in different folder

 
Miran Cvenkel
Ranch Hand
Posts: 196
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.compile my app
2. dist folder, doble click jar --> all goes OK
3.Copy jar to some other folder -> run it --> JVM error - could not find main class forms.MyForm ?
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the MANIFEST.MF file inside the JAR file (use a ZIP tool to open the JAR). Check out what the Class-Path is. That's relative to the JAR file itself. I think you copied the JAR file but forgot to copy some of the JAR files it needs.
 
Miran Cvenkel
Ranch Hand
Posts: 196
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you were right, I kind of expected that clean & build wraps all into one jar.
Or at least in NetBeans I would expect a checkbox to do that ...

can you recomend a toll for wrapping all, main yar + all libraries into one jar.

I read somewhere that this can be done with proguard, but I have no luck with it.
 
Miran Cvenkel
Ranch Hand
Posts: 196
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This instructions for netbeans (packing all libraries into single jar) worked for me
webpage
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic