Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

run a java class file in linux

GussayMar 24 2011 — edited Mar 24 2011
I have developed a little java app using JDeveloper in a windows 32bit enviroment to copy blob files from a sqlserver db to an oracle db using jdbc.
I installed a standalone jdk1.6.0_24 on the windows box to do this.
The class includes a main(String[] args) so as it can run as a standalone app (i wanted to embed it in the db but there was an issue with Java versions... don't ask).

I run the compiled class in JDeveloper and the app works fine.
It runs using the following line
 
"C:\Program Files\Java\jdk1.6.0_24\bin\javaw.exe" -client -classpath <<my_path_to_classes>>\classes;<<my_path_to_Oracle_JDBC_Drivers>>\ojdbc14.zip;<<my_path_to_SQLServer_JDBC_Drivers>>\sqljdbc4.jar 
getfile.GetSQLServerFile <SqlServer FQDN Host> <SqlServer Port> <SqlServer DB Name> <SqlServer User Name> <SqlServer PW> <ora Host> <ora Port> <ora Service> <ora Schema PW>
Now... I ultimately want to run this on a linux server...
I copied over the class files and the SQLServer JDBC jar to the linux box using winscp.
I have installed a standalone jdk160_24 on the linux server.
When trying to run the app from the command line....
 ./jdk160_24/java -client -classpath <<my_linux_path_to_classes>>classes;<<ORACLE_HOME>>/jdbc/lib/ojdbc14.jar;<<my_linux_path_to_SQLServer_JDBC_Drivers>>/sqljdbc4.jar 
getfile.GetSQLServerFile <SqlServer FQDN Host> <SqlServer Port> <SqlServer DB Name> <SqlServer User Name> <SqlServer PW> <ora Host> <ora Port> <ora Service> <ora Schema PW>
I get a usage error
Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)
....
followed by
bash: /oracle/product/10_2/db/jdbc/lib/ojdbc14.jar: cannot execute binary file
bash: /external/storage/JDBC/sqljdbc4.jar: cannot execute binary file
What am I doing wrong?
Thanks in advance...
Gus..

Edited by: Gussay on Mar 24, 2011 4:03 PM
This post has been answered by gimbal2 on Mar 24 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 21 2011
Added on Mar 24 2011
2 comments
1,662 views