• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

cant run java file from command line but works with .sh file??

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, basically i am writing an RMI based java application and ive written some scripts to run and comile it.
The compile scipt is:


and to run the server i run the script:


if i type those exact commands in the same order i get an exception and the server fails.
if i run the scripts from the command line i get the same exception
but if i run them from the GUI the server works perfectly.
THIS IS DRIVING ME INSANE. does anyone have a clue why this is happening and how i can fix it??
Thanks,
Ben


the exception i am getting is:
 
Ranch Hand
Posts: 344
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks like perhaps the CLASSPATHs are different from the one on your command line vs the one through the GUI. You could try an "echo $CLASSPATH>/tmp/myfile.txt" just before you execute the "java RMIServerImpl" command (both command line and GUI) and then compare.
 
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
RMI has special needs. One of them is that the RMI Registry needs to have the application linkage classes within its classpath. That is because the registry is simply an app that listens on a port, receives client requests, and returns the requested linkage to the client. For more details, check in out RMI forum where the experts hang out.

IDEs tend to have sloppy classpaths, since both the development and debug environments exist and overlap, as do multiple applications that might be running at the same time. So the fact that something runs in an IDE doesn't guarantee it will run in the Real World.
 
If you live in a cold climate and on the grid, incandescent light can use less energy than LED. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic