What are you trying to accomplish? Run (within the IDE or external to the
IDE), decompile or peak into, or add as a dependency?

There is always the basics:
https://docs.oracle.com/javase/tutorial/deployment/jar/basicsindex.html

Jars package compiled java code for use in valid installed java runtime
platforms (Windows, Linux, MacOS).

When running jars, the normal expectations are to
(1) Java Runtime Environment (JRE) at a minimum although a Java Development
Kit (JDK) is also possible.  Do you have a compatible JRE or JDK
installed?  Assume you do, if able to run Netbeans
(2) Classpath is defined to help locate the jar.  This can be done by
setting a Classpath environment variable (either global, user, or via
"batch" or "shell script") or passed on command line with an applicable
parameter (i.e. -cp).  Without this, it may not be able to "find the jar"
to work with.  Classpath settings may also be different depending on where
and when your running things.
(3) In Windows it may be configured to right click and run as Java type
usage.  Something similar on Linux maybe possible.  Otherwise,  that usage
of basic shell/command prompt based execution is normally in a java -jar
<name of jar> with maybe a -cp and maybe calling out the "main class" to be
used to execute

If you are talking about something else in Netbeans like
(1) Expanding the compressed zip to see inside,  Should be able to do so
within the Project view and drill down where applicable.
(2) Run it from the IDE, the IDE normally runs things based on code
associated with a "main java source" and applicable source based.  In some
cases (i.e. like maven project) it is possible to use the "build tool" to
tell it to run.
(3) Dependencies within the IDE: This depends on the type of project (i.e.
ant, maven, Eclipse project, Netbeans Project, etc.) which each have there
own way of handling dependencies.

Hope some of this helps.

Eric Bresie
ebre...@gmail.com


On Fri, Mar 4, 2022 at 10:16 AM Amn Ojee Uw <amnoje...@gmail.com> wrote:

> I have recently have done a major shift as a developer, I switch from MS
> to Debian 11 and as they say "New year, new life". So, I've also changed my
> developing platform to NetBeans 12.x from Eclipse. I have realized that the
> jar files produced by Eclipse are not desirable by  NB 12.x.
> Is this the norm? Should I always assume that  Eclipse produced jar files
> will not run on NetBeans?
>
> As a personal note, let me say that this issue must not exist; "Write
> once, run anywhere"?
>
> Perhaps, someone here could point out a document on the net that addresses
> this issue.
>
>
> Thanks in advance.
>

Reply via email to