Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

eclipse questions

Thread view: 
cmk128@hotmail.com - 07 Apr 2006 08:14 GMT
Hi
   I am new to eclipse, how can i do the followings?
1) In borland, i can create a execute jar, or a native execute (.exe),
in esclipse, i found the way to create an execute but not native exe,
how to?

2) Esclipse can export an execute jar but how to rebuild that execute
jar? i can export it again, but it is stupid because i have to press
several buttons. In jbuilder, after i press the "build" button, i can
make it.

3) If i open the .project file, it will not open the project. So how to
open a project which is not in your workspace?

thanks a lot!!
from Peter (cmk128@hotmail.com)
Ingo R. Homann - 07 Apr 2006 08:32 GMT
Hi Peter,

> Hi
>     I am new to eclipse, how can i do the followings?
> 1) In borland, i can create a execute jar, or a native execute (.exe),
> in esclipse, i found the way to create an execute but not native exe,
> how to?

Impossible. (Perhaps with some commercial/expensive plugin?)

> 2) Esclipse can export an execute jar but how to rebuild that execute
> jar? i can export it again, but it is stupid because i have to press
> several buttons. In jbuilder, after i press the "build" button, i can
> make it.

Yes, that's stupid! The only way I know is to use the ant-integration of
Eclipse to achieve this. (I admit that setting this up/configuring this
is also hard to do...)

> 3) If i open the .project file, it will not open the project. So how to
> open a project which is not in your workspace?

The same: impossible.

(Of course: AFAIK!)

Ciao,
Ingo
James McGill - 07 Apr 2006 08:59 GMT
>> create a execute jar ... or a native execute (.exe)
> Impossible. (Perhaps with some commercial/expensive plugin?)

Ant exec task, or custom task.

Eclipse's built-in runner can only run Java apps.  "External Tools" can
run ant, and this is meant for integrating builders.  Eclipse is not a
general-purpose shell.  If you want to run a windows binary, double
click on it in an explorer window...

>> how to rebuild that execute jar?

File -> Export -> Jar File -> "Export generated class files and
resources" is checked -> select your Main class  

What could be easier?  

Or the Ant way:

Ant jar task  <attribute name="Main-Class" .../>  

>>So how to open a project which is not in your workspace?

File->New->Project->Java Project->"Create project from existing source."

It's better to put your existing project in your workspace dir, and then
New Project as though you are creating it -- Eclipse will find it during
that dialog.  

Eclipse really works quite differently from JBuilder, especially in
terms of how it manages the workspace.  The view and the model of the
workspace are distinct.  
Oliver Wong - 07 Apr 2006 17:23 GMT
>>> how to rebuild that execute jar?
>
> File -> Export -> Jar File -> "Export generated class files and
> resources" is checked -> select your Main class
>
> What could be easier?

   As the OP said, "click build" would be easier.

   - Oliver
James McGill - 07 Apr 2006 17:30 GMT
>     As the OP said, "click build" would be easier.

After the first time you tell Eclipse what you want, you just click the
JarDesc file and it's one step.  

If the purpose of this thread is to praise the superiority of JBuilder
to Eclipse, I'm not going to respond to it.  Been there, done that, and
(literally) have the t-shirt.
cmk128@hotmail.com - 12 Apr 2006 04:41 GMT
James McGill

> >     As the OP said, "click build" would be easier.
>
[quoted text clipped - 4 lines]
> to Eclipse, I'm not going to respond to it.  Been there, done that, and
> (literally) have the t-shirt.

Thanks james
 the jar description file really work.
Timo Stamm - 07 Apr 2006 09:16 GMT
cmk128@hotmail.com schrieb:
> 2) Esclipse can export an execute jar but how to rebuild that execute
> jar? i can export it again, but it is stupid because i have to press
> several buttons.

You can create a "jardesc" file somewhere in the jar exporter.

If you right-click on the jardesc, the context menu will allow you to
rebuild the jar.

Or use ant to automatically build the jar, as Ingo suggests.

Timo
James McGill - 07 Apr 2006 09:27 GMT
> Or use ant to automatically build the jar, as Ingo suggests.

It's much easier than that.  Just right click on your project and export
jar.

Be sure to check "Export generated class files" and then you'll be able
to browse to the main Class to execute.  

I'm not sure, but I think there also might be a way to save that
operation as an ant task when you do it from the wizard as well.
Ingo R. Homann - 07 Apr 2006 10:12 GMT
Hi,

>>Or use ant to automatically build the jar, as Ingo suggests.
>
> It's much easier than that.  Just right click on your project and export
> jar.

Peter said that he knew this, but it is no option for him:

"i can export it again, but it is stupid because i have to press
several buttons. In jbuilder, after i press the "build" button, i can
make it."

BTW: As for your other post:

>>>create a execute jar ... or a native execute (.exe)
>>
[quoted text clipped - 4 lines]
> Eclipse's built-in runner can only run Java apps....
> If you want to run a windows binary,

I think, you misunderstood Peter here: He did not want to start an
executable from Eclispe, but he said that he wants to create an
executable from Eclipse. (And I think, that my answer to that
("Impossible...") is correct.)

Ciao,
Ingo
James McGill - 07 Apr 2006 10:29 GMT
> Peter said that he knew this, but it is no option for him:

There's a language barrier at work, and I apologize for
misunderstanding.

You can save the JAR Description at the end of that wizard dialog, and
then all you have to do is click that description file, "Create Jar",
and voila.  Not only "possible", but extremely easy, a single click, and
a confirmation to overwrite if the file exists.

Still, I prefer Ant.  A newbie to Eclipse might need to be shown the
"Ant View".  

What was the other thing you said was impossible?
Timo Stamm - 07 Apr 2006 13:09 GMT
James McGill schrieb:
> You can save the JAR Description at the end of that wizard dialog, and
> then all you have to do is click that description file, "Create Jar",
> and voila.

And how is this solution different from the one I posted 4 hours ago?
James McGill - 07 Apr 2006 10:47 GMT
> I think, you misunderstood Peter here: He did not want to start an
> executable from Eclispe, but he said that he wants to create an
> executable from Eclipse. (And I think, that my answer to that
> ("Impossible...") is correct.)

How does JBuilder do it?  AOT or wrapper?  I'm guessing it does nothing
more than wrap a call to the java runtime against a jar that's stored as
data in the executable file.  

I know that JET does a good job of AOT.
I'm sure whatever AOT or runtime wrapper you'd care to use could be
deployed as an ant task.

Hopefully, this is one of the last steps in the OP's project, and by the
time he gets there he won't be an Eclipse newbie anymore :-)  Maybe he
will even see the questionable wisdom of making "exe's" from Java, and
will discover JWS, or merely realize that Windows can "run .jars"
without much help.
cmk128@hotmail.com - 12 Apr 2006 04:42 GMT
therer is a "native executable builder" in jbuilder, it can create
native exe in windows platform.
Hendrik Maryns - 07 Apr 2006 09:30 GMT
cmk128@hotmail.com schreef:
> Hi
>     I am new to eclipse, how can i do the followings?
[quoted text clipped - 9 lines]
> 3) If i open the .project file, it will not open the project. So how to
> open a project which is not in your workspace?

Apart from the useful answers you already got, I want to add that there
is a dedicated newsgroup for Eclipse beginners:
news://news.eclipse.org:119/eclipse.newcomer

HTH, H.

- --
Hendrik Maryns

==================
www.lieverleven.be
http://aouw.org
Ferenc Hechler - 08 Apr 2006 07:09 GMT
cmk128@hotmail.com schrieb:
> 2) Esclipse can export an execute jar but how to rebuild that execute
> jar? i can export it again, but it is stupid because i have to press
> several buttons. In jbuilder, after i press the "build" button, i can
> make it.

You can try the Fat-Jar Eclipse Plugin http://fjep.sourceforge.net/
It has a quick-build option (Right-Click on the java-project and select
the Menu Quick-Build.

The Eclipse exporter can not handle referenced jars. Fat-Jar supports
the one-jar http://one-jar.sourceforge.net/ option to include jars in jars.

Another option supported by jbuilder is to include only needed files
into the jar. The beta-preview of Fat-Jar includes Auto-Jar
http://autojar.sourceforge.net/

Best regards,

  feri


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.