I\'m having trouble getting the import of all the required .jar files working correctly. My end goal is simply to read in an excel spreadsheet (more specifically .xlsx files) to
The problem is with how you're launching your program. I see you currently have a shell script of:
javac -classpath "/home/robsco/Webdev/java/poi/*" TestExcel.java
java TestExcel
That compiles with all the jars, but doesn't run with them, so your program won't have its dependencies available. (Unlike with some c programs, compiling with Java won't inline the depdendencies, nor will it add local links to the files. There are tools that will do that for you if you really need it though)
If you change your shell script to be:
javac -classpath "/home/robsco/Webdev/java/poi/*" TestExcel.java
java -classpath ".:/home/robsco/Webdev/java/poi/*" TestExcel
It should work fine. Note the addition of the current directory in the classpath in order for 'java' to find your class (in this case TestExcel).
Alternately, you could do something a little icky with environment variables, using the CLASSPATH
envvar that Java checks, eg
export CLASSPATH=.:`ls -1d --color=no /home/robsco/Webdev/java/poi/* | xargs echo | sed 's/ /\:/g'`
javac TestExcel.java
java TestExcel