Creating JAR file in java from the command prompt is always been little tricky for many of us even if IDE like Netbeans and Eclipse provide support to export java program as JAR file simply because we don’t create jar often and not familiar with manifest file or jar command as a whole. JAR file in Java is a kind of zip file that holds all contents of a Java application including Class files, resources such as images, sound files, and optional Manifest files. JAR stands for Java Archive and provides a platform-independent deliverable for java programs, libraries and frameworks. you can execute the same jar file in any operating system e.g. Windows 7, Windows 8, Macintosh, or Linux.
Monday, April 7, 2025
Sunday, March 30, 2025
3 Books to Learn Eclipse IDE for Java JEE Programmers - Best of Lot
In order to become a good Java developer solid knowledge of Eclipse IDE, or whatever IDE you use, like Netbeans or IntelliJIDea, is a must. Java has been blessed with excellent tooling which turbo-charge application development. IDEs or Integrated Development Environment allows you to code, run, test, and debug from just one tool. They are an immense productivity booster. Since I have started Java development coding in Notepad, TextPad, and JCreator, I know how it feels to have the power of IDEs with you. There are three big IDEs in Java world, Eclipse, NetBeans and IntelliJIDEA. The first two are free, and the third one requires the license. I use Eclipse, and it's also the most popular IDE in Java world.
Labels:
books
,
Eclipse
,
Eclipse Tips
Friday, January 3, 2025
Top 5 Courses to Learn Eclipse IDE for Java Programmers in 2025 - Best of Lot
Hello guys, If you are in Java development, you may know that Eclipse is one of the most popular IDEs for Java development and millions of Java developers used it worldwide. Since IDEs like Eclipse, NetBeans, and IntelliJIDEA are an integral part of a Java developer's life, it makes sense to spend some time learning your IDE like Eclipse and get productive with it. This will not only save a lot of your time during development, testing, and debugging, but it will also make you a better developer. It's said that a craftsman is as good as their tools, and it's true for a programmer also. In general, expert developers have better tools, and they know their tools better, which often differentiates them from average programmers.
Labels:
core java
,
courses
,
Eclipse
,
online resources
Monday, October 21, 2024
Top 10 Eclipse Plugins for Java and Spring Boot Developers
There is no doubt that Eclipse is one of the most popular IDEs for Java development, and what makes Eclipse great is nothing but Plugins. There are hundreds of Eclipse plugins for different kinds of tasks and integration with other essential tools like there are plugins to download code from Github, SVN, CVS, etc. There are planning to use Maven or Gradle from Eclipse. There are specific plugins for Java development, Python Development, creating Spring-based Java applications and for creating Android apps from Eclipse itself. I have seen productivity improvement by just installing the right kind of plugins.
Labels:
best of javarevisited
,
Eclipse
,
online resources
Tuesday, August 27, 2024
10 Examples of Conditional Breakpoint Debugging in Java and Eclipse
Eclipse is a great tool for Java developers, it allows you to write code, execute them and debug them but many developers doesn't use Eclipse to their full potential. I focus a lot of debugging skills when I take interviews and when I ask about how they debug their Java application, many developer mention use of line breakpoint and only few mention about conditional breakpoint. To be honest, if you are debugging a real-world Java application which has lots of users, clients or data then line breakpoint will not be very helpful and it will take ages to find the most of the data related issues.
For example, somewhere in your code you getting a NullPointerException and ArrayIndexOutOfBoundsException and you are not sure for which client, user or value this error came.
Monday, June 17, 2024
Top 15 NetBeans Keyboard Shortcuts for Java Programmers
In Java development there are three big IDEs, IntelliJ IDEA, Eclipse and NetBeans. In the past, I have shared Eclipse keyboard shortcuts and IntelliJ IDEA courses and today, I am going to share keyboard shortcuts for NetBeans, one of the first Java IDE I used in my career. I started doing Java development when JCreator was considered great because it can help with function names on objects but when NetBeans comes with features like built-in Tomcat and built-in profiler, it changed the game and I extensively used NetBeans for both web and mobile application development with J2ME. Since then a lot of water have flown in to Java world, InelliJIDEA become the defacto standard IDE for Java development with Eclipse as close second but unlike what many expected, NetBeans didn't die.
Labels:
best of javarevisited
,
Eclipse
,
Netbeans
Tuesday, October 10, 2023
How to fix Eclipse - Could not reserve enough space for object heap in Java? Solution
If you are running Java program in Eclipse and ever tried playing with -Xmx parameter you know about those virtual machine initialization error e.g. "“Error occurred during initialization of VM; Could not reserve enough space for object heap”. This error usually occur when you to try to give your program, running on 32-bit JVM more than 1.4G of memory in Eclipse in Windows. It doesn't matter how much memory your machine have e.g. I have seen this error in laptops running 4GB of memory. The important thing which matter is whether JRE or JVM you are using with Eclipse is 32-bit or 64-bit. If you use 64-bit JRE in Eclipse, you can potentially allocate more than 1.4G of memory in Windows itself.
Labels:
core java
,
Eclipse
,
error and exception
Saturday, September 23, 2023
How to debug Servlet, JSP based Java Web Application in Eclipse with Tomcat
One of my reader was struggling with debugging a Java web application, containing Servlet and JSP in Eclipse with Tomcat. While helping him, I realized that I have not written anything about debugging a Java web application in Eclipse yet. Even though, I have wrote articles about debugging tips and remote debugging in Eclipse, I have never touched the topic of debugging Servlet and JSP in Eclipse or any other IDE, which are two pillars of Java web applications. To fill that gap, I am starting a series of articles where we'll first learn how to setup Eclipse with Tomcat to debug Java web application and then learn some tips and tricks to effective debug Servlet and JSP.
Thursday, September 14, 2023
Top 10 Eclipse Code Templates Java programmer should know
Every Java programmer wants to code fast and this is important because Java is more verbose than some of the cool scripting languages e.g. Python. Eclipse Code templates can help you to write faster code in Eclipse. If you used correctly Eclipse code template can generate all kinds of boilerplate code for you. Eclipse IDE comes with some frequently used Eclipse code templates e.g. sysout which is faster way to generate System.out.println() statements. Surprisingly, not every single Java programmer working in Eclipse is familiar with this cool feature which can save tons of times writing boilerplate code related to Exception handling, logging and frequently used test code e.g. writing main method.
Labels:
Eclipse
,
java tips
,
programmers
Tuesday, September 12, 2023
How to create Java Project in Eclipse using Git and Github? Example Tutorial
I often receive questions about not able to download Java projects from Github in Eclipse and sometime not able to create and import as Java project even if they are downloaded from Github and exists in local repository. Initially, I didn't write about it because I thought it's too fundamental and probably everyone knows about it but receive this question again yesterday, I thought to document all the steps for once and all. To be honest, it's not so difficult if you have right plugins and little bit familiar with Git, but, yes, for Git beginners, it can be confusing. First, you have to deal with Git e.g. what is push, pull, fetch, clone etc and then deal with Eclipse e.g. which plugins to download, why doesn't Eclipse natively support it etc.
Sunday, August 20, 2023
Top 30 Eclipse Keyboard Shortcuts for Java Programmers [UPDATED]
Hello guys, if you use Eclipse for Java development and looking to increase your productivity then you have come to the right place. Earlier, I have shared the 5 best Eclipse courses and in this tutorial, I will share 30 Eclipse keyboard shortcuts to improve your productivity. This list is by no means complete, and I will suggest you guys share eclipse shortcuts listed other than here to make this more useful. Eclipse is the most used Java development IDE, and knowing these Eclipse shortcuts not only improves your productivity but also makes you more efficient. You will have more time for things you like to do. Using keyboard shortcuts also helps to impress colleagues and shows that you have a good hold on tools you used for Java Development.
Labels:
best of javarevisited
,
core java
,
Eclipse
Sunday, July 2, 2023
Maven JAR Artifiact Dependency Search Not Working in Eclipse - Solved
Recently I face a strange issue while using Maven in Eclipse via M2Eclipse plugin. I have created a Maven Java project in Eclipse and subsequently tried to add Spring framework as a dependency, to my surprise, nothing was happening. Eclipse was not able to search dependency in Maven central repository. I was surprised because I have never faced this issue while I was using the M2Eclipse plugin for a long time. After some trial and error, I realized that this is my brand new workspace and I am running with Eclipse Luna, the newest version of Eclipse which I had just downloaded a couple days of the back. My first hunch was that Eclipse might not able to connect to the Internet, and to verify that I tried connecting the Eclipse market place, and boom it was working fine.
Labels:
debugging
,
Eclipse
,
java
,
Maven
,
programming
,
Trobleshooting
,
troubleshooting
Wednesday, May 17, 2023
10 Tips to Debug Java Program in Eclipse - Examples
How to debug a java program in Eclipse
Debugging is a must-have skill for any java developer. Having the ability to debug java program enables to find you any subtle bug which is not visible during code review or comes when a particular condition offer, This becomes even more important if you are working in high-frequency trading or electronic trading system project where time to fix a bug is very less and bug usually comes on the production environment and doesn't appear in your Windows XP machine. in my experience debugging the java applications also helps you understand the flow of the java programs.What is java.library.path? How to set in Eclipse IDE? Example
java.library.path is a System property, which is used by Java programming language, mostly JVM, to search native libraries, required by a project. Similar to PATH and Classpath environment variable, java.library.path also includes a list of directory. When Java code loads a native library (a library or executable written in a language like C, C++, or native code) using System.loadLibrary("name of library") method, java.library.path is scanned for specified library. If JVM doesn't found the requested native library, then it throws java.lang.UnsatisfiedLinkError: no native library in java.library.path.
Labels:
core java
,
Eclipse
,
programming
How to increase heap size of Eclipse - Solving OutOfMemoryError? Example
If you are running lots of Java projects in Eclipse and it's throwing OutOfMemoryError every now and then it's time to increase the heap memory of Eclipse. Since Eclipse is a Java program, you can increase the heap size of Eclipse by using JVM memory options -Xms and -Xmx. There are two ways to provide JVM options to eclipse either updating the Eclipse shortcut or adding -vmargs on eclipse.ini file. I prefer the second option because it's clean. I'll tell you the exact steps to increase the java heap space in Eclipse but before that some background on why I had to increase the heap memory of Eclipse.
Labels:
Eclipse
,
error and exception
Why use Spaces over Tabs for Indentation in Code Editors - Eclipse
When I started coding in Eclipse, I was not aware that by default Eclipse uses tabs for indentation and tabs can have varied with e.g. 1 tab can be equal to 2 spaces or 4 spaces or even 8 spaces. Sometimes, It's all up to you how you configure tabs in your code editor, and other times just at the mercy of the tool you don't know how to configure like VIM in UNIX. I only realize the problem when I found too many differences in a file while check-in in into SVN. Apparently, other people were using different indentations (spaces) and that's why the file was showing so many differences when I reformatted them in Eclipse.
Labels:
best of javarevisited
,
Eclipse
,
programmers
,
programming
Eclipse - How to add/remove external JAR into Java Project's Classpath? Example
There are multiple ways you can add an external JAR into the classpath of a Java project in Eclipse, but all goes via adding them into the build path. Many beginners struggle to add JARs into classpath and we will try to address that problem in this tutorial. You will learn step by step tutorial to add an internal or third-party JAR in your application's CLASSPATH in Eclipse Indigo. Since this feature has hardly changed in any Eclipse version, you can follow some steps in Eclipse Kepler, Indigo, and Juno versions to add JARs into the classpath.
How to fix Failed to load Main-Class manifest attribute from jar in Java? Eclipse Netbeans Tutorial Example
If you have tried creating JAR file and running Java program from command the line you may have encountered "Failed to load Main-Class
manifest attribute from jar", This error which haunts many Java
programmer when they enter into command line arena and tries to create JAR file in the command line
or IDE like Netbeans and Eclipse. The major problem with "Failed
to load Main-Class manifest attribute from jar" error is
that, it’s unnecessary creates panic which it doesn't deserve, maybe because the process involves of creating and running JAR is not that common like running Java
program using the "java" command.
Labels:
core java
,
debugging
,
Eclipse
,
error and exception
How to decompile class file in Java and Eclipse - Javap command example
The ability to decompile a Java class file is quite helpful for any Java developer who wants to look into the source of any open source or propriety library used in a project. Though I always prefer to attach sources in Eclipse of most common libraries like JDK it’s not always possible with an increasing number of dependencies. Java decompiler (a program that can decompile Java class files to produce source files) is very helpful in such a situation. By using Java decompiler you can easily check out the source of any .class file. Thanks to Eclipse IDE and the increasing number of free plugins available for Java developers, You can have powerful Java decompile in your armory.
Labels:
core java
,
Eclipse
,
programming
How use Spaces instead of Tabs in Eclipse Java editor? Example
I use Eclipse IDE extensively to write Java programs for testing and example purposes, but when I copy those programs in any text editors e.g. VIM, Notepad, TextPad, or Edit plus, the indentation goes weird. I see a lot of white spaces which makes the program wider than expected. This happens because when you copy Java program from Eclipse to a text editor, tabs are converted to spaces and different editor has the different settings of tabs. UNIX text editors prefer tab is 8 spaces, Windows text editors, and IDEs e.g. Eclipse treats tabs as 4 spaces.
Labels:
Eclipse
Subscribe to:
Posts
(
Atom
)