944,123 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1742
  • Java RSS
Jan 5th, 2006
0

jars and classpaths

Expand Post »
Hello DaniWeb,
. I was hoping someone could help me with a portability issue.
. I've created a jar in JBuilder Foundation 2005. Said jar executes successfully on computers Alpha and Beta, but not Cimarron. When I double-click on the icon on Cimarron, a small black window flashes up and disappears. After clicking a hundred times or so to figure out what it says, I figured out that it says "Exception in thread "main" java.lang.NoClassDefFoundError C:\Sun\AppServer\jdk\bin\DMS-DNMS/jar" or "
... D:\Documents and Settings\lab\Desktop\DMS-DNMS/jar"
. I'm using an executable jar rather than command-line code because my users aren't programmers, and I don't want them to have to do anything other than double-click on an icon to make the program run.
. I have installed the latest jdk on Cimarron. I tried the program from both the desktop and inside the jdk bin. The desktop is on a different drive than the jdk, which is on the C drive, but it didn't run in the jdk folder either.
. I'm suspecting the problem lies in my immortal nemesis, the classpath, but I'm not sure how to confirm this.
. Oh, and just so you know, my manifest does list the appropriate file holding the "main". Pretty sure it wouldn't work on Alpha or Beta otherwise.
. So, what should I look for? I haven't tried other executable jars or any kinds of programs on Cimarron yet, so I don't know whether it simply hates all Java... that would be good to check out... anything else?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
MonkeyCode is offline Offline
20 posts
since Jul 2005
Jan 5th, 2006
0

Re: jars and classpaths

I wouldn't think the classpath needs to be set, but I could be wrong.


Java Syntax (Toggle Plain Text)
  1. C:\Sun\AppServer\jdk\bin\DMS-DNMS/jar" or "
  2. ... D:\Documents and Settings\lab\Desktop\DMS-DNMS/jar"
  3.  

Looks like it's expecting to find a class somewhere on the users computer which is on computer a and computer b, but not on computer c.
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
Jan 5th, 2006
0

Re: jars and classpaths

Quote originally posted by server_crash ...
I wouldn't think the classpath needs to be set, but I could be wrong.


Java Syntax (Toggle Plain Text)
  1. C:\Sun\AppServer\jdk\bin\DMS-DNMS/jar" or "
  2. ... D:\Documents and Settings\lab\Desktop\DMS-DNMS/jar"
  3.  

Looks like it's expecting to find a class somewhere on the users computer which is on computer a and computer b, but not on computer c.
Well, the above paths (C:...DMS-DNMS/jar and D:...DMS-DNMS/jar) are the two places where the jar is located (on Cimarron, that is. On Alpha and Beta, I don't get a directory listing because I don't get an error message). The theory is the jre would read the manifest, the manifest would point it to the appropriate file with MAIN in it, and it would then have completely different errors (because I'm still working on this beast), but the parts I've fixed definitely work on Alpha and Beta. It doesn't look like it's even checking the manifest on Cimarron.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
MonkeyCode is offline Offline
20 posts
since Jul 2005
Jan 5th, 2006
0

Re: jars and classpaths

There could be couple of issues.

The system classpath could be different on each machine.

The way that jar files were setup to execute could be different.

One way to see what is actually happening with that jar file is to open a command prompt window move to the directory your jar is in and execute it from the command line. That way you will see exactly what the error is.

Regards,

Nate
Reputation Points: 11
Solved Threads: 8
Posting Whiz in Training
hooknc is offline Offline
216 posts
since Aug 2005
Jan 18th, 2006
0

Re: jars and classpaths

Quote originally posted by hooknc ...
There could be couple of issues.

The system classpath could be different on each machine.

The way that jar files were setup to execute could be different.

One way to see what is actually happening with that jar file is to open a command prompt window move to the directory your jar is in and execute it from the command line. That way you will see exactly what the error is.

Regards,

Nate
Thanks for the suggestion! Horror upon horrors, it works fine from the command prompt>java -jar program.jar . But I don't want the users to have to go through that mess.
. I ended up going into Windows Explorer, and adding a file type association and action for jar files. 's'funny, I woulda thought that the jdk install should have done something of the sort. But it works now. Only oddity now is that a command window pops up on computer Cimarron, where it doesn't on Alpha or Beta... makes figuring problems easier with the error messages (it reminded me to add the appropriate .dlls to the right places, which I hadn't yet), but just a bit confusing for the users to have an extra thing pop up on the screen.

Anywho, me happy. :mrgreen: :cheesy:
Reputation Points: 10
Solved Threads: 0
Newbie Poster
MonkeyCode is offline Offline
20 posts
since Jul 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: jabber protocol
Next Thread in Java Forum Timeline: why i got this error ??





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC