• Create Account

### #ActualRipiz

Posted 10 May 2012 - 10:18 AM

You need to specify the .jar/.zip files on the command line or in your CLASSPATH environment variable...

This is university's computer, therefore I cannot modify environment variable and have to stick only to command line.

you now just need to do the same when running on the command line.

I've been trying to do this, with no luck so far.

Without knowing where you put the files (your project's classes and 3rd party jars) on your system, I can't give you the exact line that would work

So far it's only my Main class (default package) and postgresql-9.1-902.jdbc4.jar, both of which are in the same folder.
I've tried tried java -cp postgresql-9.1-902.jdbc4.jar Main but it didn't work. Ashaman73 suggested to include . to classpath, but that changed nothing.

Could you please show the proper way to do this?

### #5Ripiz

Posted 10 May 2012 - 10:18 AM

You need to specify the .jar/.zip files on the command line or in your CLASSPATH environment variable...

This is university's computer, therefore I cannot modify environment variable and have to stick only to command line.

you now just need to do the same when running on the command line.

I've been trying to do this, with no luck so far.

Without knowing where you put the files (your project's classes and 3rd party jars) on your system, I can't give you the exact line that would work

So far it's only my Main class (default package) and postgresql-9.1-902.jdbc4.jar, both of which are in the same folder.
I've tried tried java -cp postgresql-9.1-902.jdbc4.jar Main but it didn't work. Ashaman73 suggested to include . to classpath, but that changed nothing.

Could you please show the proper way to do this?

[/CODE]

### #4Ripiz

Posted 10 May 2012 - 10:17 AM

You need to specify the .jar/.zip files on the command line or in your CLASSPATH environment variable...

This is university's computer, therefore I cannot modify environment variable and have to stick only to command line.

you now just need to do the same when running on the command line.

I've been trying to do this, with no luck so far.

Without knowing where you put the files (your project's classes and 3rd party jars) on your system, I can't give you the exact line that would work

So far it's only my Main class (default package) and postgresql-9.1-902.jdbc4.jar, both of which are in the same folder.
I've tried tried java -cp postgresql-9.1-902.jdbc4.jar Main but it didn't work. Ashaman73 suggested to include . to classpath, but that changed nothing.

Could you please show the proper way to do this?

Edit:
Managed to get another output:
java -classpath "build/classes" ; "build/classes/postgresql-9.1-902.jdbc4.jar" Main
/*
Failed to load Main-Class manifest attribute from
/very long path/classes/postgresql-9.1-902.jdbc4.jar
*/


### #3Ripiz

Posted 10 May 2012 - 10:17 AM

You need to specify the .jar/.zip files on the command line or in your CLASSPATH environment variable...

This is university's computer, therefore I cannot modify environment variable and have to stick only to command line.

you now just need to do the same when running on the command line.

I've been trying to do this, with no luck so far.

Without knowing where you put the files (your project's classes and 3rd party jars) on your system, I can't give you the exact line that would work

So far it's only my Main class (default package) and postgresql-9.1-902.jdbc4.jar, both of which are in the same folder.
I've tried tried java -cp postgresql-9.1-902.jdbc4.jar Main but it didn't work. Ashaman73 suggested to include . to classpath, but that changed nothing.

Could you please show the proper way to do this?

Edit:
Manager to get another output:
java -classpath "build/classes" ; "build/classes/postgresql-9.1-902.jdbc4.jar" Main
/*
Failed to load Main-Class manifest attribute from
/very long path/classes/postgresql-9.1-902.jdbc4.jar
*/


### #2Ripiz

Posted 10 May 2012 - 09:49 AM

You need to specify the .jar/.zip files on the command line or in your CLASSPATH environment variable...

This is university's computer, therefore I cannot modify environment variable and have to stick only to command line.

you now just need to do the same when running on the command line.

I've been trying to do this, with no luck so far.

Without knowing where you put the files (your project's classes and 3rd party jars) on your system, I can't give you the exact line that would work

So far it's only my Main class (default package) and postgresql-9.1-902.jdbc4.jar, both of which are in the same folder.
I've tried tried java -cp postgresql-9.1-902.jdbc4.jar Main but it didn't work. Ashaman73 suggested to include . to classpath, but that changed nothing.

### #1Ripiz

Posted 10 May 2012 - 09:49 AM

You need to specify the .jar/.zip files on the command line or in your CLASSPATH environment variable...

This is university computer, therefore I cannot modify environment variable and have to stick only to command line.

you now just need to do the same when running on the command line.

I've been trying to do this, with no luck so far.

Without knowing where you put the files (your project's classes and 3rd party jars) on your system, I can't give you the exact line that would work

So far it's only my Main class (default package) and postgresql-9.1-902.jdbc4.jar, both of which are in the same folder.
I've tried tried java -cp postgresql-9.1-902.jdbc4.jar Mainbut it didn't work. Ashaman73 suggested to include . to classpath, but that changed nothing.