Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8635283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:56:15+00:00 2026-06-12T09:56:15+00:00

Let me start off by saying I’m not the best at Java so I

  • 0

Let me start off by saying I’m not the best at Java so I may have missed something really simple…

I’m working on a plugin system and everything works perfectly fine in eclipse but not when I actually launch the applet outside of it.

I’m trying to load a .class file from a directory and execute it, I know why it isn’t working I just don’t know what to do to solve it.

The issue is that Eclipse is referencing the applet itself in the class-path but it’s not being referenced in the class-path outside of eclipse and I don’t have access to -cp or -classpath, I can only launch it via a launcher designed to load the jar with a fixed class-path.

Any ideas on how I would be able to solve this issue?

Loader Code:

final ClassLoader loader = new URLClassLoader(new URL[] { new File("C:/Plugin/Directory/").toURI().toURL() });
final Class<?> c = loader.loadClass("PluginFile");
Object s = c.newInstance();
s.getClass().getMethod("onLoad").invoke(s);

Plugin Code:

import net.plugintest.pluginsystem.*;

public class PluginFile extends ClientPlugin
{
    private String Author = "Plugin Author";
    private String Description = "Plugin Description"
    private Player p = new Player();

    @Override
    public void onLoad() 
    {
        p.talk("Testing");
    }
}

This problem has been driving me up the wall for a week now, I don’t know what to do. :/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:56:16+00:00Added an answer on June 12, 2026 at 9:56 am

    I’m not sure but try providing parent classloader to the classloader you create, eg:

    ClassLoader parent = Thread.currentThread().getContextClassLoader();
    // or
    // ClassLoader parent = getClass().getClassLoader();
    ClassLoader loader = new URLClassLoader(new URL[] { new File("C:/Plugin/Directory/").toURI().toURL() }, parent);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off, let me start by saying that I am totally new to working
First let me start off by saying I do not believe I am leaking,
Let me start off by saying, I'm not new to programming but am very
Let me start off by saying that I am not an expert in C.
Let me start off by saying I know this is probably not the correct
Okay let me start off by saying I have been looking around a lot
Ok, let me start off by saying that I'm don't have the slightest clue
Let me start off by saying that this is my first time working with
Let me start off by saying I don't want to print only the duplicate
Let me start out by saying that I'm not a C developer and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.