Click to See Complete Forum and Search --> : import: runtime vs. compile time??


sneakyimp
05-24-2006, 08:58 PM
warning: VERY NEW TO JAVA

I was looking for some FTP code stuff in java to use in an upload widget i plan to build. i found it and compiled a sample application no problem, but found that it would not run unless i put a JAR file distributed with the FTP source code into the folder where i installed the java runtime environment.

this sounds like DLL linking to me. it won't work for that reason because I want my upload widget to run from a web page and I will NOT have the ability to install anything in a given user's java runtime folder.

how can i be sure that classes and packages that I reference will run without needing additional jar files? does IMPORT equate to some kind of DLL linking?

any help would be much appreciated.

Waylander
05-24-2006, 09:13 PM
Putting a jar in the folder where the java runtime environment is installed is just a shortcut method to ensure that the jar is in a folder thats referenced in the java classpath.

You can have the jar anywhere as long as the classpath has that folder referenced so any java src files that import it and use it can find it.

I cant see any reason you wont be able to get it to work, I would recommend using something like the Ant build tool to get really familiar with the classpath and how java compiles.

Waylander.

sneakyimp
05-24-2006, 09:45 PM
thanks for the info.

Would that mean then that I would need to also distribute the other JAR file? My intention is to have this upload widget i'm working on activated from a web page as part of a photo gallery.

Waylander
05-24-2006, 09:55 PM
Im not really sure as I dont have any idea what it is.... this a Servlet? not an Applet?

Is the jar a database connector or something?

chazzy
05-24-2006, 10:14 PM
if your application requires a jar file that is not a standard jar file, you should distribute it (or at least note where you can find it) with your application.

sneakyimp
05-24-2006, 10:27 PM
the java program i'm trying to write is intended to run client-side and do two things
1) let a user browse their local hard drive for images or audio or video files
2) upload the selected files to the server via FTP while showing a progress indicator.

I found a few different 'libraries' of ftp-related java code. The one I referred to was this one:
http://finj.sourceforge.net/

The basic plan is to create a web page for website administrators that lets them upload images/photos/video to their site. I can do a php form that users can post files to but there is no progress indicator for PHP uploads which is a real nuisance for very large files like MP3 files or video.

So, ultimately, the idea is to have a web page with a button that says 'upload files' and they click the button and PRESTO the widget appears and lets them select a few files for upload.

Now I don't think this is supposed to be a servlet but i'm not even sure what 'servlet' means. i would think it's an applet but another post i did on this site taught me that applets are highly restricted in terms of their access to a user's machine. that post is here:
http://www.webdeveloper.com/forum/showthread.php?t=105774

chazzy suggested a "emote java gui based client". so that's what i'm doing. or trying to do.