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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:47:54+00:00 2026-06-09T07:47:54+00:00

My website is hosted on Apache on ubuntu. I have been given a JAR

  • 0

My website is hosted on Apache on ubuntu. I have been given a JAR file which has two folders inside it and some .class and .scc files. Lets say jar file name = myJarfile, folder inside this archive = myFolder, and Class inside this folder is = myClass.

I have been told to run the class like this:

java myFolder.myClass

but i get this error:

$ java myFolder.myClass 
Exception in thread "main" java.lang.NoClassDefFoundError: myFolder/myClass
Caused by: java.lang.ClassNotFoundException: esGateKeeper.cookieServer
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: myFolder/myClass.  Program will exit.

I also tried:

$ java myJarfile.myFolder.myClass
Exception in thread "main" java.lang.NoClassDefFoundError: myJarfile/myFolder/myClass
Caused by: java.lang.ClassNotFoundException: myJarfile.myFolder.myClass
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: myJarfile.myFolder.myClass.  Program will exit.

Admin told me it is CLASSPATH issue. I have no idea. My website uses PERL CGI and no JAVA at all. I am not JAVA programmer, and googling did not give me idea how to get this running.

the Class/or JAR file is supposed to start an IPC daemon on my localhost which i would communicate with from my PERL CGI, for authentication purposes. It decrypts the cookie I get from browser.

I am not sure what I will need to install on my server for this to run. I have java as below:

$ java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) Client VM (build 17.0-b16, mixed mode, sharing)

Pl advice.

ty.
Rajeev

_OK__ I resolved this by exporting a CLASSPATH variable pointing to the .jar file:

export CLASSPATH="/full/path/to/myJarfile.jar"

then executes fine:

$ java myFolder.myClass

starts the daemon….

But to be honest, I have no idea what is going on here. This .jar file has two folders in it: myFolder and a META-INF. myFolder has bunch of .class files and one .scc file. none of them is named “main”….

I appreciate the time and help extended to me.

ty.
Rajeev

  • 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-09T07:47:56+00:00Added an answer on June 9, 2026 at 7:47 am

    Experiment with adding the “-jar” flag to ‘java’.

    Assuming the “jar” file creates a stand-alone process, you can set the Java process to start on boot by adding the launch command to /etc/rc.local. If it’s an important service, you’ll also want to monitor it to make sure it’s running, and be prepared to stop and start it manually. You might also consider automatically restarting if you detect that it’s hung or not running.

    As far as accessing it from Perl, you’ll need to get documentation from the person who gave it to from that. I expect it would either run on a port or create a socket you can connect to. In either case, it shouldn’t matter that it’s a Java app. Perl’s standard methods for connecting for ports or sockets would apply.

    Regarding Classpath, I recommend you read some documentation for Classpath if you haven’t already. If in doubt about the best variation, ask your JAR file provider to be certain.

    Also see:

    • Java – Jar could not find included libraries and main class
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a website hosted on 1and1 which has a webform for submitting
I have a website hosted on IIS to do some testing. However whenever I
I have an ASP.Net hosted website which displays a list of results as a
I currently have an asp.net website hosted on two web servers that sit behind
I have a django application hosted on a server running on Apache + Ubuntu.
I have the main website hosted by a reliable static web hosting service. Which
We have a Website (hosted somewhere) and C# Application (which is installed on my
I have a website hosted on my local server (http://localhost/), which uses url_rewriting. When
I have a website hosted on lighttpd, accessible at the www subdomain. I also
I have a internal website hosted on IIS. I added the following meta code

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.