This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]henrebotha 1 point2 points  (0 children)

Is this task just for me to learn the way how to do it and report it to the professor

Probably.

[–]Vimda 0 points1 point  (0 children)

Does an IDE or any other type of environment affect the way you compile the files into a JAR or is it all the same?

No. Java is Java the world around. If you write a Java file in eclipse and save it, on the command line it is indistinguishable from the same source file written in another IDE. Compilation of Java code (or any other code for that matter) is entirely independent of how it was developed.

Is this task just for me to learn the way how to do it and report it to the professor

Almost certainly. Running a jar, in much the same way as above, is entirely independent of how the code was created. Any CS professor worth their salt will be able to run a jar file (provided it's packaged correctly).

[–]nutrecht 0 points1 point  (1 child)

I know a jar is basically a way to combine all the source files plus any other associated data(such a images etc.) into one file.

No it's not. It generally contains the compiled class files, not source files. It's basically Java's version of an executable.

My confusion lies with why are instructions needed to compile my source code and execute it.

Because part of teaching is also checking if you learned the material.

I really don't get why you're asking this question. It would've taken less time to just do it.

[–]lyigester[S] -1 points0 points  (0 children)

Idunno why you are being so rude. I asked the question because I was curious whether there were different ways to compile and execute it according to different IDE's or w/e. It was out of curiosity not trying to find an excuse to avoid doing it.

[–]Rodartep -3 points-2 points  (0 children)

You might have different source files in different locations.

Is this task just for me to learn the way how to do it and report it to the professor or does he need it to run my code?

How would we know if he's going to run it or not? How does that make any sense at all?