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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:09:51+00:00 2026-06-14T09:09:51+00:00

I have a java application that is run using the following command: java -cp

  • 0

I have a java application that is run using the following command:

java -cp .;lib\*;myapp.jar com.app.myapp.MyAppStart

The myapp.jar is in a folder that has the following files and structure

/demo
    /lib
    /conf
    myapp.jar
    myapp.bat

The myapp.bat contains the above run command so when you double click on it, it runs the program. Everything works fine if i copy the folder to a local path. For example if the folder is in
c:\program\myapps\demo i can just go in that folder and double click on the myapp.bat script and the program starts.

The problem i have now is i want to copy the demo folder to a path on the network. I tested it by copying it to \\London-server01\applications\client\demo\ but that raises the following exception

Exception in thread "main" java.lang.NoClassDefFoundError: com/app.myapp/MyAppStart
Caused by: java.lang.ClassNotFoundException: com.app.myapp.MyAppStart
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: com.app.myapp.MyAppStart.  Program will exit.

It looks like it doesnt like the fact that the program is run from a network drive. I tried a different approach by mapping \\London-server01\applications\client\demo\ to a local drive letter and that
works fine without any issues. It only fails to work if i use the full network path to access the folder. Is there any way i can get it to work without the need to map the network path?

  • 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-14T09:09:52+00:00Added an answer on June 14, 2026 at 9:09 am

    Instead using . (for the current directory). Assign it to a variable and qualify the jar with the entire path to run it.

    set MY_JAR_PATH=\London-server01\applications\client\demo\

    java -cp %MY_JAR_PATH%;lib*;%MY_JAR_PATH%\myapp.jar com.app.myapp.MyAppStart

    This might help!

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

Sidebar

Related Questions

I have a Java application that run as a background service, i.e. no GUI.
I have in my Java application a thread that run a while(True) loop with
I have a Java application that is managed using Maven. The project involves the
I have a standalone java application that fires up several JMS consumers using the
I have a very simple command line Java application that I wish to port
So I have a java application that i recently included zookeeper in. This app
Here are the steps that I have completed. Downloaded PDFRenderer.jar Created lib folder in
I have a java application that people can log into (and do various things
I have a java application that runs out of memory, but I have no
I have a Java application that makes heavy use of a large file, to

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.