Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9012519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:01:12+00:00 2026-06-16T03:01:12+00:00

I have a small programm and several .sh files to execute it. I use

  • 0

I have a small programm and several .sh files to execute it. I use Raspberry-pi virtual box emulator to run it. (Don’t ask why… just need it.. 🙂 )
So, my .sh file looks like:

export HSQLDB_JAR=../lib/hsqldb-2.2.8.jar

java -classpath $HSQLDB_JAR org.hsqldb.Server -database.0 ../my-hsqldb/my-hsqldb -dbname.0        my-hsqldb

I have the needed jars, java is installed properly (checked several times), blah-blah, all the same:

rpi@RaspberryPi:/home/snb/my/apps/MyApp/bin$ sh skysql.sh
: not found2: 
Exception in thread "main" java.lang.NoClassDefFoundError: org/hsqldb/Server
Caused by: java.lang.ClassNotFoundException: org.hsqldb.Server

The most interesting thing, that when I run the script from the sh file directly from bash – it works! But running the .sh file gives this error 🙁

Any help is very appreciated.

EDIT

The following directories have all of the access rules, so no security issues could happen. They are all accessible.

EDIT #2

I have used the offered answers and comments and that’s what happened:

  1. Still same stuff 🙁

  2. My .sh file:

    #!/bin/bash
    
    export HSQLDB_JAR="$(pwd)/hsqldb-2.2.8.jar"
    
    echo $HSQLDB_JAR
    
    java -classpath $HSQLDB_JAR org.hsqldb.Server -database.0 ../my-hsqldb/my-hsqldb -dbname.0 my-hsqldb
    

The terminal output is:

rpi@RaspberryPi:/home/snb/my/apps/MyApp/bin$ sh skysql.sh
: not found2: 
: not found4: 
/home/snb/my/apps/MyApp/lib/hsqldb-2.2.8.jar
: not found6: 
Exception in thread "main" java.lang.NoClassDefFoundError: org/hsqldb/Server
Caused by: java.lang.ClassNotFoundException: org.hsqldb.Server
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org.hsqldb.Server.  Program will exit.
: not found8: 

So, as you can see, the .jar is actually found and it is in the right path.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:01:13+00:00Added an answer on June 16, 2026 at 3:01 am

    This is probably a bug in a part of the script that you don’t show. Try this:

    1. Make sure the first line of your script reads #!/bin/bash

    2. Make sure you’re in the folder that you think you are. Add

      if [ ! -e "$HSQLDB_JAR" ]; then echo "Jar not found!" ; exit 1 ; fi
      

      before calling java

    3. To see what the shell actually executes, use -x (either add -x as parameter to the first line or activate it with the command set -x).

    If you need to generate a path relative to your script, use this code:

    BASE=$( cd $( dirname "$0" ) > /dev/null && pwd )
    HSQLDB_JAR="$BASE/../lib/hsqldb-2.2.8.jar"
    

    Always quote variables which contain paths to make sure white space works properly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on some C# code where I have several files that use the
I have several -small- binary files added in my Mercurial repository. The files are
I have small question. When I started to programm my application, I grouped types
I have a small program I want to execute to test something #include <map>
I have several web site files that I have to edit systematically. Therefore, I
Firstly, great job on B4A. I've just started, and already have a small app
I have developed small program, which randomly generates several connections between the graphs (the
I have a small program that has several checkedboxlists in VS2010. I wanted to
I have some programs written in Matlab that I need to run several times
I have a small program <350ish lines of code on 5 forms>. It works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.