When do we need to attach source to a jar [closed] - java

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
When do we need to attach source to a jar?
Can we debug without attaching the source code?
Can we see the stacktrace line numbers without the source (AFIAK we can't)?
What is the best practice for local builds? Do we need the source code?
What about CI?
Can we leave the source code only for production release?
Thanks,
Omer

It's good practice to also publish the sources jar along with your binary jar in your internal (or external) Maven repository. It makes life of the developer that is working with your code much easier since they can see your comments / browse the codebase and be able to have all that at debug time. Now as you are saying even if the sources jar is not published, developers have ways around it primarily relying on their IDE. In Eclipse for instance you can install the Java Decompile plugin that would give you access to the code during debug time or on IntelliJ there is something similar without the need of installing a plugin.

Related

How can I make project in java [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 months ago.
Improve this question
We have to do java project like a management system and we have source code but the question is how to run it and where? anyone knows?
Queries
IDE
How to run it?
If you already have the source code,
Open a command prompt window then cd to the directory where you saved the java program.
For example, JavaProgram.java is in C:/
Type 'javac JavaProgram.java' and enter to compile your code.
Now type 'java JavaProgram' to run your program.
You will be able to see the result printed on the window.
Good luck :)
we have source code
You'll need to compile it.
Then you need to execute it. That could involve web containers with WAR or standalone, executable Java JARs, or directly execute a class file. Without seeing your code it's hard to answer that, but you wouldn't use an IDE to actually deploy/run your code outside of individual development.
You'll also need some server to run it on. That's not unique to Java.
Regarding the original question: "Make a project" - you could use Maven Archetypes or Spring and Quarkus have project starter websites, for example...

How to properly configure Eclipse project in IntelliJ? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I'm trying to import an Eclipse project from GitHub into IntelliJ. I'm however having problems figuring out the correct way of doing that.
I'm following this question to do the importing(I'm leaving everything on default and simply click "Next", since the answer doesn't mention anything else and I have no idea what the other stuff does), but it still doesn't work. The configuration/project structure appears to be seriously broken and I have no idea why.
More exactly, I'm currently stuck at the following screen: The "Problems" tag explains in more detail that both the things in red are "invalid". I tried searching for that error, but it seems that people encounter it on all different project models and build tools like Maven, Spring, or Android. None of them concern Eclipse projects and the solutions vary from issuing a bunch of commands that I don't understand somewhere to deleting this project file or another.
Since there are so many unknowns in play here, I decided to ask, rather than waste days crapshooting only to break something in my IDE or Java installation. How do I get this project to work? It's a simple local machine visual app, it shouldn't be this complicated to import it in an IDE.
Basically the issue is how those two libraries are defined. If you select one and then click on the edit button to the right, a dialog will open and show the path to where those libraries are defined. They are likely configured to find the necessary JARs at a specific path on the (original developers) system. For example, for the jfxrt.jar library, maybe it is configured that the classes/binary JAR is at C:\Program Files\Java\JavaFx\jfxrt.jar or C:\Users\Bob\libs\fx\jfxrt.jar. Wherever they are defined, you either need to put the necessary JARs in that directory, or modify the config to point to the location on your system where you have the JARs. This of course may require you to download the necessary JARs.

unit testing for proprietary ide [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I would like to add some sort of unit testing to an IDE known as "IBS Integrator".
how the IDE works:
I write "java-ish" code in .itr files.
when I press the run button these files are compiled into .class and .java files.
I have no idea what happens next.
Does anyone have advise on how I could make unit testing work in a setup like this?
I was hopping for a framework like phpunit or rspec. I know they are for different langagues but a similar tool for java would be nice. I'm not sure what (if anything) can interact with .class/.java files.
I would prefer something open-source if possible.
Since IBS Integrator compiles to .class files, you should be able to write JUnit tests in Java against those classes, and run them however you'd normally run JUnit tests (kick off Ant or Maven, open Eclipse and run them from there, etc.). And I can't think of any reason to use another technology (phpunit, rspec, etc.) for writing tests of Java code; JUnit seems like the clear winner here.

How to remove obsolete java classfiles? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Every time I need to delete the previous files to force the compiler not cache
I compile it using:
javac Main.java
and other imported files are nor compiled, until deleted
Of course you don't want ALL imported classes to be deleted (java.lang?) but only your project. Simple: Delete all .class files in your output folder, recursively, with your shell's tools. If you have a dedicated output folder you can just delete the whole folder.
Best method: Learn a build tool like Maven or Ant and use the integrated ways to clean a project output, e.g. with Maven mvn clean. Or if you use an IDE with a built-in builder (e.g. Eclipse) there might be a clean option for the project.
This is not a "cache" in a strict sense.

Ivy.xml and how to configure [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
So i just got internship at a firm and there we have to work with java. I have been a C guy all my life but i am familiar with the basic OOP fundamentals.
Now there is a file ivy.xml.
I asked someone what it was and how do i use it and I just got that it resolves all the dependencies in the code.
Now can someone help me in understanding what it is, what does one mean by the dependency resolution and how do i configure it to my uses?
Maybe a simple example can help understanding more quickly.
Thanks a tonne.
Ivy is a plugin to ant, one of the most popular build tools (a bit like make or autotools) for java. There are many ways in which it can be configured, both in that ivy.xml file and in the build.xml for ant. I'd stick with established practice already used in that firm, i.e. modify the structure of these files as little as possible. To understand the stuff already present, either read the manuals or provide file snippets along with specific questions.

Categories

Resources