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 / First Aid / October 2006

Tip: Looking for answers? Try searching our database.

Netbeans JAR file execution from command line

Thread view: 
Luc The Perverse - 26 Oct 2006 03:50 GMT
I needed to run a program I created called RandomPasswordGen and it wouldn't
run because it said it couldn't find some necessary classes, which I tracked
down to some swing layout jar file in netbeans.

Eventually I copied all the netbeans files into the sun java directory.   I
have a feeling that is not the standard way of going about this.

How can I prevent a compatibility problem?  I like to send people JAR files
to execute, and don't want them to have to have netbeans installed and
certainly don't want them to have to copy files from netbeans to java class
path.

What is the proper way to go about this?

--
LTP

:)
Andrew Thompson - 26 Oct 2006 04:37 GMT
> I needed to run a program I created called RandomPasswordGen and it wouldn't
> run because it said it couldn't find some necessary classes, which I tracked
[quoted text clipped - 9 lines]
>
> What is the proper way to go about this?

'proper'?  Dunno'.. here are several possible strategies..

- Rework your GUI's to not require the NB classes (which
are usually form generators? ..layouts?).
- Launch your GUI's using web start and refer to the
NB classes in a separate 'component' JNLP *.
- Put a manifest in the main jar that references the NB jars*
(and distribute them with your application, and put them
somewhere they can be found)
- Rejar the NB classes* in your main jar file.

* check NB docs. for (re)distrib. rights.

I would go for the first option.

Andrew T.
Lion-O - 26 Oct 2006 19:09 GMT
> How can I prevent a compatibility problem?  I like to send people JAR
> files to execute, and don't want them to have to have netbeans
> installed and certainly don't want them to have to copy files from
> netbeans to java class path.

Which NB version?

Normally NetBeans will put the compiled jar and all libraries it might
need in the 'dist' subdirectory of your projects home. Extra libraries
are stored in the dist/lib subdirectory. Also refer to the 'README.TXT'
file which explains as much.

The manifest file in the jar defines a classpath which includes optional
jar files in the lib subdirectory.

If those files aren't there then I wonder if your project has been
properly setup.

Signature

Groetjes, Peter

.\\ PGP/GPG key: http://www.catslair.org/pubkey.asc

Luc The Perverse - 26 Oct 2006 20:39 GMT
>> How can I prevent a compatibility problem?  I like to send people JAR
>> files to execute, and don't want them to have to have netbeans
[quoted text clipped - 13 lines]
> If those files aren't there then I wonder if your project has been
> properly setup.

In that case I likely just grabbed the wrong JAR file (and because it worked
on my system, I was thrown off)

--
LTP

:)


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.