This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Modern JavaScript for the Impatient and have Cay Horstmann on-line!
See this thread for details.
Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

import classes from server

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Friends,
I was wondering if it is possible to import classes from a remote server over the internet.

My thinking was that this may aid client side applications for my java programs.

With XSLT I can use valid XML documents over the internet from any workstation which makes life much easier for setup and run.

I am new to Java, so maybe I am missing something that really deals with this. I guess setting the environment variables and all can be a bit hairy, etc.

Mike Ferrando
Washington, DC
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not exactly sure what you're trying to do. If you're talking about including remote files in the classpath when compiling, then no, that's not possible. If you're talking about running your own application, then you could add a ClassLoader to it that retrieves classes (or jar files) from wherever you can get them. This article may be a starting point for some research if you want to go down that road.
 
Mike Ferrando
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Ulf Dittmer:
I'm not exactly sure what you're trying to do. If you're talking about including remote files in the classpath when compiling, then no, that's not possible. If you're talking about running your own application, then you could add a ClassLoader to it that retrieves classes (or jar files) from wherever you can get them. This article may be a starting point for some research if you want to go down that road.



Ulf D.,
I am looking over the URL you sent.

I guess I was thinking that I could centrally control my classes in one place (upgrade, enhance, extend, etc.) instead of attempting to do this one workstation at a time.

However, I guess the bigger question is will it work if multiple users are attempting to actuate these classes at the same time.

Mike Ferrando
Washington, DC
 
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at Java Web Start.
 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

However, I guess the bigger question is will it work if multiple users are attempting to actuate these classes at the same time.


Concurrent access will be no problem, as access to these files will be read-only.
 
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
URLClassLoader
 
Mike Ferrando
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Friends,
Thanks much for your help.

Java Web Start and URLClassLoader both look good.

At this early stage learning Java, I wanted to know if it was possible, i.e. part of the design of the programming language.

Mike Ferrando
Washington, DC
 
Alas, poor Yorick, he knew this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic