About
Community
Bad Ideas
Drugs
Ego
Erotica
Fringe
Society
Technology
register | bbs | search | rss | faq | about
meet up | add to del.icio.us | digg it
Go Back   Community > Technology > Everything *NIX
Register FAQ Members List Calendar Today's Posts

Everything *NIX This is a general forum about all forms of *nix. Post your ideas and thoughts on this wonderful OS family. Talk about your personal favorite flavor of *nix and why you think it's so much better than the others. Anything pertaining to *nix and *nix administration should be posted here.

Reply
 
Thread Tools Display Modes
  #1   Add fuckbiscuit to your ignore list  
Old 2008-08-12, 21:55
fuckbiscuit fuckbiscuit is offline
Regular
 
Mordor Send a message via ICQ to fuckbiscuit Send a message via AIM to fuckbiscuit Send a message via MSN to fuckbiscuit Send a message via Yahoo to fuckbiscuit Send a message via Skype™ to fuckbiscuit
Question Running .sh files on OS X terminal

Right, so i have a java program that a need to run on my mac... i know you can do it i'm just having a problem running it at the moment in a bash shell. So i go onto terminal and CD to the dir that i need and type " sh run.sh" into terminal to run the file and guess what? nothing but an error message... this one to be precise

Last login: Mon Aug 4 23:12:41 on console
Welcome to Darwin!
peter-mccaffreys-computer-2:~ petermccaffrey$ cd desktop/rsbotsvn
peter-mccaffreys-computer-2:~/desktop/rsbotsvn petermccaffrey$ sh run.sh
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java :620)
at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader .java:260)
at java.net.URLClassLoader.access$100(URLClassLoader. java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java: 195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
peter-mccaffreys-computer-2:~/desktop/rsbotsvn petermccaffrey$


Can anyone tell me what i'm doing wrong please? I've already posted this in COM but no-one there seems to know.
Reply With Quote
  #2   Add Prometheum to your ignore list  
Old 2008-08-13, 03:44
Prometheum Prometheum is offline
Regular
 
01 Send a message via AIM to Prometheum Send a message via MSN to Prometheum
Default Re: Running .sh files on OS X terminal

Just a wild guess here - Is the .class compiled under the same JRE version you're running it in?

Make sure to use Java 6, if you aren't. That may not be the problem, though. Like I said, wild guess.
Reply With Quote
  #3   Add DaedalusOwnsYou to your ignore list  
Old 2008-08-13, 04:02
DaedalusOwnsYou DaedalusOwnsYou is offline
Regular
 
Odessa, FL US
Default Re: Running .sh files on OS X terminal

OK so I'm pretty drink right now but java class files give java runtime errors while bash runtime errors give shells errors. I'm guessing that the kinds of error that your getting has abso lutely nothing to do with your running mac or a bash shell but everything to do with java being gay. Like the the other poster, I'm going to suggest you update your java envirironment.
Reply With Quote
  #4   Add Issue313 to your ignore list  
Old 2008-08-14, 03:38
Issue313 Issue313 is offline
Regular
 
Land of the Ires.
Default Re: Running .sh files on OS X terminal

^^^ Yeah, Java's totally gay. Steer clear of it.

I never seen someone sh run.sh a file. Would not ./run.sh be quicker and more useful (can use on .out filez.)
Reply With Quote
  #5   Add Prometheum to your ignore list  
Old 2008-08-14, 03:40
Prometheum Prometheum is offline
Regular
 
01 Send a message via AIM to Prometheum Send a message via MSN to Prometheum
Default Re: Running .sh files on OS X terminal

Quote:
Originally Posted by Issue313 View Post
^^^ Yeah, Java's totally gay. Steer clear of it.

I never seen someone sh run.sh a file. Would not ./run.sh be quicker and more useful (can use on .out filez.)
That requires the file be marked as executable. I frequently just echo commands into a file and then run it, and I don't bother setting it to executable. Also, using sh opens it in a new shell invocation, so that might be useful.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

 
To the best of our knowledge, the text on this page may be freely reproduced and distributed.
 

totse.com certificate signatures
 
 
About | Community | Bad Ideas | Drugs | Ego | Erotica | Fringe | Society | Technology
Hot Topics