V
V
vvrider2015-11-18 23:26:26
Java
vvrider, 2015-11-18 23:26:26

How to run java ".class" files on ubuntu?

Hello, gentlemen, javaists)

I’m talking about Java right away, I know more by hearsay, I don’t write it myself - I just appeared to deposit a colleague’s code on the server so that I could test a little functionality today at night.

I have files of the form : .class and I understand that I need to compile them before running them.

In the presence of a server on ubuntu, installed jdk, jre

The structure is as follows:

-out
-src file
extension.iml

In the src folder com , Mainclass.class and javadriver.jar (it is for connecting to mongo)

I don’t quite understand what to do with this happiness now, but need to run.

I accept any constructive criticism, good advice and condescension) Do not judge strictly :))))

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem Kileev, 2015-11-18
@vvrider

*.class is the sources already compiled into bytecode.
To start, enter the command in the terminal:

java -cp "путь/до/src/com;путь/до/javadriver.jar" Mainclass

C
cthulhudx, 2015-11-19
@cthulhudx

Let a colleague assemble a jar-nick himself, and launching his program will not be hemorrhoids for you.
java -jar program.jar

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question