1

I have downloaded a project from SVN and have imported the same in my Eclipse IDE.The project have several .java files but none of them have any main() method.

It is required to make some minor changes in one of the file and then create a new version of the jar. And replace the old jar with the new version in the server.

Ours is a big project and the tool is running on Weblogic. But while creating the newer version of the jar through Eclipse ( Export>Jar) it is asking to provide the class which contains main() method or any entry point.

Please let me know how should I proceed to create the jar?

4
  • 1
    if that is suppose to be a runnable jar then you need to provide a main method! Commented Jun 6, 2017 at 11:26
  • 1
    You don't have to supply a main class. Export as jar, not as runnable jar. Commented Jun 6, 2017 at 11:27
  • Thanks@bekce... it worked for me !! Commented Jun 6, 2017 at 11:37
  • since the project is mounted over Weblogic server. We need to deploy it as jars and not runnable jars. quora.com/… Commented Jun 6, 2017 at 11:39

2 Answers 2

1

eclipse supports the creation of different JAR file types.

You went for creating a "runnable" JAR. But in order to run ... a JAR needs a main().

Thus: simply export as "ordinary" JAR. See the documentation for further reading; and follow the instructions for "Creating a New JAR File".

Sign up to request clarification or add additional context in comments.

Comments

0

You might be trying to create runnable jar file.

To create a normal jar file please follow the steps:

  1. In eclipse, right click on the project
  2. Select Export Search for JAR file
  3. Select which all the packages needs to be part of JAR file
  4. Choose the path where you want export this JAR file & provide the name to JAR file
  5. Click Finish

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.