I developed a small Java program under windows and am now trying to run it on an ubuntu machine.
run.sh:
/opt/atlassian/jira/jre/bin/java -classpath "commons-lang3-3.3.2.jar;opencsv-3.3.jar;.\TisowareExportConverter.class" info.aptis.plakon.TisowareExportConverter /home/tisoware/transfer/tisoware_presence_export.csv /home/tisoware/convert/$
I compiled the .java file under windows
Directory contents
tisoware@server037:~/convert$ ls -la
insgesamt 472
drwxr-xr-x 2 root root 4096 Apr 26 11:51 .
drwxr-xr-x 7 tisoware tisoware 4096 Apr 26 11:32 ..
-rw-r--r-- 1 root root 412739 Apr 18 15:46 commons-lang3-3.3.2.jar
-rw-r--r-- 1 root root 293 Apr 26 11:51 convert.sh
-rw-r--r-- 1 root root 1024 Apr 26 11:51 .convert.sh.swp
-rw-r--r-- 1 root root 108 Apr 26 10:47 doku.txt
-rw-r--r-- 1 root root 31217 Apr 18 15:46 opencsv-3.3.jar
-rw-rw-r-- 1 root tisoware 5 Apr 26 11:24 outfile.csv
-rw-r--r-- 1 aptisSupport aptisSupport 200 Apr 19 14:19 tiso_user_mapping.csv
-rw-r--r-- 1 root root 4425 Apr 19 14:21 TisowareExportConverter.class
The java class
package info.aptis.plakon;
public class TisowareExportConverter {
public static void main (String[] args) { /* stuff is done here */}
}
Problem
All I get is
tisoware@server037:~/convert$ bash convert.sh
Fehler: Hauptklasse info.aptis.plakon.TisowareExportConverter konnte nicht gefunden oder geladen werden
(Translation: Could not find or load main class info.aptis.plakon.TisowareExportConverter)
What am I doing wrong?
Under Windows the program runs like this
run.bat
java -classpath libs\commons-lang3-3.3.2.jar;libs\opencsv-3.3.jar;out\production\tisowareExportConverter2 info.aptis.plakon.TisowareExportConverter tiso_infile.csv tiso_outfile.csv tiso_user_mapping.csv
Thank you, Internet <3
I worked around this problem by packaging the class as a jar like this:
https://stackoverflow.com/questions/2025607/how-to-create-a-jar-file-or-export-jar-on-intellij-like-eclipse-java-archive-e