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 / March 2006

Tip: Looking for answers? Try searching our database.

Calling sun.tools.javac from Applet

Thread view: 
daniel.w.gelder@gmail.com - 06 Mar 2006 20:39 GMT
Hi,

I have a Java application that creates a temp file, calls
sun.tools.javac.Main, and executes the class.

The class that it executes makes reference to some classes in the
application. Everything is fine.

Now I'm trying to do the same in a signed applet. I can invoke the
compiler, however I can't get it to notice the classes in the jar since
it doesn't have the class files. Can I point the compiler towards the
jar that it is being executed from?? Can javac even compile against a
jar or does it need .class files?

Thank you in advance for help on this complicated question.
Dan
Raymond DeCampo - 06 Mar 2006 21:31 GMT
> Hi,
>
[quoted text clipped - 9 lines]
> jar that it is being executed from?? Can javac even compile against a
> jar or does it need .class files?

A couple of things to try:

1) Put a URL to your jar file in the classpath (e.g.
http://localhost/myApplet.jar)

2) Download the applet file locally and point the classpath at the
temporary file.

3) Try to discover where the java plug-in keeps its temporary copy of
your jar file and use that.  (This may be fragile across platforms,
versions, etc.)

HTH,
Ray

Signature

This signature intentionally left blank.

daniel.w.gelder@gmail.com - 06 Mar 2006 21:45 GMT
I found a way. I have to compile the class files along with the temp
file....how annoying! As if javac wasn't slow enough already.


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.