Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Running java code developed in Eclipse from java.exe
Running java code developed in Eclipse from java.exe [message #208662] Wed, 02 May 2007 19:02 Go to next message
Phil Troy is currently offline Phil TroyFriend
Messages: 4
Registered: July 2009
Junior Member
Hi!

I have successfully developed a java project in Eclipse. Actually, there
are more than two projects, all but the last of which contain classes that
I wish to be able to use in other projects. Each project has src and bin
folders.

Can someone give me explicit steps for creating a jar file and running it
from the command line using java.exe. My workspace is D:\PhilsWorkspace
and my projects are subfolders of that folder. I am using Windows XP.

THANKS/Phil
Re: Running java code developed in Eclipse from java.exe [message #208679 is a reply to message #208662] Wed, 02 May 2007 21:31 Go to previous message
Paul A. Rubin is currently offline Paul A. RubinFriend
Messages: 188
Registered: July 2009
Senior Member
Phil Troy wrote:
>
> I have successfully developed a java project in Eclipse. Actually,
> there are more than two projects, all but the last of which contain
> classes that I wish to be able to use in other projects. Each project
> has src and bin folders.
>
> Can someone give me explicit steps for creating a jar file and running
> it from the command line using java.exe. My workspace is
> D:\PhilsWorkspace and my projects are subfolders of that folder. I am
> using Windows XP.
>

Google is your friend:
http://www.cs.laurentian.ca/badams/c1047/eclipse-tutorials/e xport-tutorial.html#export-jar

To run it,

> java -cp path_to_other_classes
-Djava.library.path=path_to_external_libraries -jar your.jar

where the cp entry is a list of paths to external classes you need
(quite possibly none, in which case omit it), and the library path is a
list of paths to external libraries you need (again, quite possibly
none, in which case omit it). Under Windows, you can use ';' as a path
delimiter within the path strings, and you can use either Unix (/) or
Microsoft (\) separators for the parts of paths. Enclose the paths in
quotes if they contain any spaces.

HTH,
Paul
Previous Topic:jackwind li + swt + licenses
Next Topic:Dynamically creating editor's context menu
Goto Forum:
  


Current Time: Fri Apr 26 21:09:10 GMT 2024

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

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

Back to the top