aspose file tools*
The moose likes Java in General and the fly likes jar not ok when in different folder Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "jar not ok when in different folder" Watch "jar not ok when in different folder" New topic
Author

jar not ok when in different folder

Miran Cvenkel
Ranch Hand

Joined: Nov 23, 2010
Posts: 147
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 ?


Searchable nature photo gallery: http://agrozoo.net/jsp/Galery.jsp?l2=en
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19697
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Miran Cvenkel
Ranch Hand

Joined: Nov 23, 2010
Posts: 147
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

Joined: Nov 23, 2010
Posts: 147
This instructions for netbeans (packing all libraries into single jar) worked for me
webpage
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jar not ok when in different folder