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 8829777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:54:44+00:00 2026-06-14T07:54:44+00:00

So I made a super-simple file, and shot it up onto my server at:

  • 0

So I made a super-simple file, and shot it up onto my server at:

http://myServer:8080/testApp/

In there is testApp.jar and a folder that acts as bin. I’ve tried a few things to fix this but I keep getting: Exception in thread “main” java.lang.ClassNotFoundException: com.testApp.Main

The full path to Main.Class is http://myserver:8080/testApp/com/myCom/Main.Class

My code to find this is

    URLClassLoader loader = new URLClassLoader(new URL[]{new File("http://myserver04:8080/testApp/").toURI().toURL()});

    Class<?> mainClass = loader.loadClass("com.myCom.Main");
    Method mainMethod = mainClass.getMethod("main", String[].class);
    mainMethod.invoke(null, new String[]{});
}

My end-goal is simply to run the main method of this file and the file being launched will have a simple “Hello World” swing window.

Thanks

  • 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-14T07:54:46+00:00Added an answer on June 14, 2026 at 7:54 am

    From just glancing at the javadocs of URLClassLoader:

    Any URL that ends with a ‘/’ is assumed to
    refer to a directory. Otherwise, the URL is assumed to refer to a JAR
    file which will be downloaded and opened as needed.

    The URL you’re specifying ends with a slash, so the class loader expects to see .class files in that directory. Try specifying the full path to the JAR in the URL

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've made a simple bash script that need to keep it's super-user privileges throughout
I made an application that passes trough an XML file and extracts the entries
I have made a super simple test case of a problem I'm having with
I made a simple extension of CheckBoxPreference so that I could have my own
Ok I have made a simple radio app that streams music from my university
I made an SQL database that with when I call this http://drymvizion.atwebpages.com/new_score.php?=pa&name=eleni&scor=23400 in explorer,
I've made this fairly simple View. It's supposed to animate a red line that
I've made a very simple app that just displays a Google map. However, it
A very simple & quick question on Java libraries: is there a ready-made class
okay so I am trying to reproduce a super simple jQuery slideshow at http://www.oliverjung.de/newsletter/slideshow.html

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.