Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » How to add "Class-Path: ." to MANIFEST.MF when generating jar from Eclipse?
How to add "Class-Path: ." to MANIFEST.MF when generating jar from Eclipse? [message #522144] Sat, 20 March 2010 08:51 Go to next message
Eclipse UserFriend
When I currently generate a *.jar from an Eclipse project then the MANIFEST.MF file contains only

Manifest-Version: 1.0
Main-Class: testprog

But I am missing another line

Class-Path: .

How (EXACTLY !) can I tell Eclipse to add such a line?

Peter
Re: How to add "Class-Path: ." to MANIFEST.MF when generating jar from Eclipse? [message #522262 is a reply to message #522144] Sun, 21 March 2010 17:53 Go to previous message
Eclipse UserFriend
The current jar file is automatically added to the classpath when you execute a java application from a Jar file. If you execute it using "java -jar" you must select a class to be executed (the one that has the main(String[]) method). You can do that in the export jar screen, in the last screen of the wizard (JAR Manifest Specification). There is an option in the last part of it: "Main class:"
Just click "Browse..." beside it and select the class you want.

After that Eclipse will automatically add the following line into the generated manifest file:
Main-Class: my.executable.Class

If that is not what you want, you can create your own manifest file and select it in the same screen in the wizard, selecting the option:
Use existing manifest from workspace
And selecting your manifest file.
Previous Topic:Critical code editor features not working in a Visual Swing designer
Next Topic:preprocess .launch files
Goto Forum:
  


Current Time: Sat Mar 22 12:43:15 EDT 2025

Powered by FUDForum. Page generated in 0.06753 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top