run my program without a jar file on linux

T

TsanChung

This is how I run my program with a jar file on linux:
$ java -jar test.jar scripts/test1.jsc

How to run it without using the jar file?
I try to run it on bash but it fail:
$ java -classpath /home/twong/test/test scripts/test1.jsc
Exception in thread "main" java.lang.NoClassDefFoundError:
scripts/test1/jsc
 
M

Mark Space

TsanChung said:
This is how I run my program with a jar file on linux:
$ java -jar test.jar scripts/test1.jsc

How to run it without using the jar file?
I try to run it on bash but it fail:
$ java -classpath /home/twong/test/test scripts/test1.jsc
Exception in thread "main" java.lang.NoClassDefFoundError:
scripts/test1/jsc

You need to find the .class files and run those.

java -classpath /path my.program scripts/test1.jsc

There are three parts to this, you only gave two.


Can you list the test.jar file and show us what's inside?

jar -tf test.jar

And post the output.
 
A

Andrew Thompson

How to run it without using the jar file?

Why? It seems a bit pointless to figure how
to run loose classes, even during development,
given any number of build tools (most people use
Ant) can stamp out a new jar in a matter of
moments.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top