javarevisited.blogspot.com Open in urlscan Pro
2a00:1450:4001:808::2001  Public Scan

URL: https://javarevisited.blogspot.com/2015/04/error-could-not-find-or-load-main-class-helloworld-java.html
Submission: On August 31 via api from SG — Scanned from DE

Form analysis 4 forms found in the DOM

POST https://app.convertkit.com/forms/2154158/subscriptions

<form action="https://app.convertkit.com/forms/2154158/subscriptions" style="background-color:#ffffff;border-radius:10px" class="seva-form formkit-form" method="post" data-sv-form="2154158" data-uid="af4786bced" data-format="inline" data-version="5"
  min-width="400 500 600">
  <div data-style="full">
    <div data-element="column" style="background-image:url('https://embed.filekitcdn.com/e/kFeARw9Z6Loq6RFhVkpEfT/jTQqyWF1nYP7pQ8aXM3Shv');opacity:0.94" class="formkit-background"></div>
    <div data-element="column" class="formkit-column">
      <div class="formkit-header" style="color:#373F45;font-weight:700;font-size:29px" data-element="header">
        <h2 style="text-align:left">Preparing for Java Developer Interviews?</h2>
      </div>
      <ul class="formkit-alert formkit-alert-error" data-element="errors" data-group="alert"></ul>
      <div data-element="fields" class="seva-fields formkit-fields">
        <div class="formkit-field"><input type="text" class="formkit-input" name="email_address" style="color:#697177;background-color:#F3F6F9;border-radius:5px;font-weight:400;border-color:#e3e3e3" aria-label="Email Address"
            placeholder="Email Address" required=""></div><button data-element="submit" class="formkit-submit formkit-submit" style="color:#ffffff;background-color:#785EDF;border-radius:5px;font-weight:700">
          <div class="formkit-spinner">
            <div></div>
            <div></div>
            <div></div>
          </div><span class="">Download Free Questions</span>
        </button>
      </div>
      <div class="formkit-disclaimer" style="color:#697177;font-size:13px" data-element="disclaimer">
        <p>We respect your privacy. Unsubscribe at any time.</p>
      </div>
      <div class="formkit-powered-by-convertkit-container">
        <a href="https://convertkit.com?utm_campaign=poweredby&amp;utm_content=form&amp;utm_medium=referral&amp;utm_source=dynamic" data-element="powered-by" class="formkit-powered-by-convertkit" data-variant="dark" target="_blank" rel="noopener noreferrer">Built with ConvertKit</a>
      </div>
    </div>
  </div>
  <style>
    .formkit-form[data-uid="af4786bced"] * {
      box-sizing: border-box;
    }

    .formkit-form[data-uid="af4786bced"] {
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }

    .formkit-form[data-uid="af4786bced"] legend {
      border: none;
      font-size: inherit;
      margin-bottom: 10px;
      padding: 0;
      position: relative;
      display: table;
    }

    .formkit-form[data-uid="af4786bced"] fieldset {
      border: 0;
      padding: 0.01em 0 0 0;
      margin: 0;
      min-width: 0;
    }

    .formkit-form[data-uid="af4786bced"] body:not(:-moz-handler-blocked) fieldset {
      display: table-cell;
    }

    .formkit-form[data-uid="af4786bced"] h1,
    .formkit-form[data-uid="af4786bced"] h2,
    .formkit-form[data-uid="af4786bced"] h3,
    .formkit-form[data-uid="af4786bced"] h4,
    .formkit-form[data-uid="af4786bced"] h5,
    .formkit-form[data-uid="af4786bced"] h6 {
      color: inherit;
      font-size: inherit;
      font-weight: inherit;
    }

    .formkit-form[data-uid="af4786bced"] p {
      color: inherit;
      font-size: inherit;
      font-weight: inherit;
    }

    .formkit-form[data-uid="af4786bced"] ol:not([template-default]),
    .formkit-form[data-uid="af4786bced"] ul:not([template-default]),
    .formkit-form[data-uid="af4786bced"] blockquote:not([template-default]) {
      text-align: left;
    }

    .formkit-form[data-uid="af4786bced"] p:not([template-default]),
    .formkit-form[data-uid="af4786bced"] hr:not([template-default]),
    .formkit-form[data-uid="af4786bced"] blockquote:not([template-default]),
    .formkit-form[data-uid="af4786bced"] ol:not([template-default]),
    .formkit-form[data-uid="af4786bced"] ul:not([template-default]) {
      color: inherit;
      font-style: initial;
    }

    .formkit-form[data-uid="af4786bced"] .ordered-list,
    .formkit-form[data-uid="af4786bced"] .unordered-list {
      list-style-position: outside !important;
      padding-left: 1em;
    }

    .formkit-form[data-uid="af4786bced"] .list-item {
      padding-left: 0;
    }

    .formkit-form[data-uid="af4786bced"][data-format="modal"] {
      display: none;
    }

    .formkit-form[data-uid="af4786bced"][data-format="slide in"] {
      display: none;
    }

    .formkit-form[data-uid="af4786bced"][data-format="sticky bar"] {
      display: none;
    }

    .formkit-sticky-bar .formkit-form[data-uid="af4786bced"][data-format="sticky bar"] {
      display: block;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-input,
    .formkit-form[data-uid="af4786bced"] .formkit-select,
    .formkit-form[data-uid="af4786bced"] .formkit-checkboxes {
      width: 100%;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-button,
    .formkit-form[data-uid="af4786bced"] .formkit-submit {
      border: 0;
      border-radius: 5px;
      color: #ffffff;
      cursor: pointer;
      display: inline-block;
      text-align: center;
      font-size: 15px;
      font-weight: 500;
      cursor: pointer;
      margin-bottom: 15px;
      overflow: hidden;
      padding: 0;
      position: relative;
      vertical-align: middle;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-button:hover,
    .formkit-form[data-uid="af4786bced"] .formkit-submit:hover,
    .formkit-form[data-uid="af4786bced"] .formkit-button:focus,
    .formkit-form[data-uid="af4786bced"] .formkit-submit:focus {
      outline: none;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-button:hover>span,
    .formkit-form[data-uid="af4786bced"] .formkit-submit:hover>span,
    .formkit-form[data-uid="af4786bced"] .formkit-button:focus>span,
    .formkit-form[data-uid="af4786bced"] .formkit-submit:focus>span {
      background-color: rgba(0, 0, 0, 0.1);
    }

    .formkit-form[data-uid="af4786bced"] .formkit-button>span,
    .formkit-form[data-uid="af4786bced"] .formkit-submit>span {
      display: block;
      -webkit-transition: all 300ms ease-in-out;
      transition: all 300ms ease-in-out;
      padding: 12px 24px;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-input {
      background: #ffffff;
      font-size: 15px;
      padding: 12px;
      border: 1px solid #e3e3e3;
      -webkit-flex: 1 0 auto;
      -ms-flex: 1 0 auto;
      flex: 1 0 auto;
      line-height: 1.4;
      margin: 0;
      -webkit-transition: border-color ease-out 300ms;
      transition: border-color ease-out 300ms;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-input:focus {
      outline: none;
      border-color: #1677be;
      -webkit-transition: border-color ease 300ms;
      transition: border-color ease 300ms;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-input::-webkit-input-placeholder {
      color: inherit;
      opacity: 0.8;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-input::-moz-placeholder {
      color: inherit;
      opacity: 0.8;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-input:-ms-input-placeholder {
      color: inherit;
      opacity: 0.8;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-input::placeholder {
      color: inherit;
      opacity: 0.8;
    }

    .formkit-form[data-uid="af4786bced"] [data-group="dropdown"] {
      position: relative;
      display: inline-block;
      width: 100%;
    }

    .formkit-form[data-uid="af4786bced"] [data-group="dropdown"]::before {
      content: "";
      top: calc(50% - 2.5px);
      right: 10px;
      position: absolute;
      pointer-events: none;
      border-color: #4f4f4f transparent transparent transparent;
      border-style: solid;
      border-width: 6px 6px 0 6px;
      height: 0;
      width: 0;
      z-index: 999;
    }

    .formkit-form[data-uid="af4786bced"] [data-group="dropdown"] select {
      height: auto;
      width: 100%;
      cursor: pointer;
      color: #333333;
      line-height: 1.4;
      margin-bottom: 0;
      padding: 0 6px;
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
      font-size: 15px;
      padding: 12px;
      padding-right: 25px;
      border: 1px solid #e3e3e3;
      background: #ffffff;
    }

    .formkit-form[data-uid="af4786bced"] [data-group="dropdown"] select:focus {
      outline: none;
    }

    .formkit-form[data-uid="af4786bced"] [data-group="checkboxes"] {
      text-align: left;
      margin: 0;
    }

    .formkit-form[data-uid="af4786bced"] [data-group="checkboxes"] [data-group="checkbox"] {
      margin-bottom: 10px;
    }

    .formkit-form[data-uid="af4786bced"] [data-group="checkboxes"] [data-group="checkbox"] * {
      cursor: pointer;
    }

    .formkit-form[data-uid="af4786bced"] [data-group="checkboxes"] [data-group="checkbox"]:last-of-type {
      margin-bottom: 0;
    }

    .formkit-form[data-uid="af4786bced"] [data-group="checkboxes"] [data-group="checkbox"] input[type="checkbox"] {
      display: none;
    }

    .formkit-form[data-uid="af4786bced"] [data-group="checkboxes"] [data-group="checkbox"] input[type="checkbox"]+label::after {
      content: none;
    }

    .formkit-form[data-uid="af4786bced"] [data-group="checkboxes"] [data-group="checkbox"] input[type="checkbox"]:checked+label::after {
      border-color: #ffffff;
      content: "";
    }

    .formkit-form[data-uid="af4786bced"] [data-group="checkboxes"] [data-group="checkbox"] input[type="checkbox"]:checked+label::before {
      background: #10bf7a;
      border-color: #10bf7a;
    }

    .formkit-form[data-uid="af4786bced"] [data-group="checkboxes"] [data-group="checkbox"] label {
      position: relative;
      display: inline-block;
      padding-left: 28px;
    }

    .formkit-form[data-uid="af4786bced"] [data-group="checkboxes"] [data-group="checkbox"] label::before,
    .formkit-form[data-uid="af4786bced"] [data-group="checkboxes"] [data-group="checkbox"] label::after {
      position: absolute;
      content: "";
      display: inline-block;
    }

    .formkit-form[data-uid="af4786bced"] [data-group="checkboxes"] [data-group="checkbox"] label::before {
      height: 16px;
      width: 16px;
      border: 1px solid #e3e3e3;
      background: #ffffff;
      left: 0px;
      top: 3px;
    }

    .formkit-form[data-uid="af4786bced"] [data-group="checkboxes"] [data-group="checkbox"] label::after {
      height: 4px;
      width: 8px;
      border-left: 2px solid #4d4d4d;
      border-bottom: 2px solid #4d4d4d;
      -webkit-transform: rotate(-45deg);
      -ms-transform: rotate(-45deg);
      transform: rotate(-45deg);
      left: 4px;
      top: 8px;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-alert {
      background: #f9fafb;
      border: 1px solid #e3e3e3;
      border-radius: 5px;
      -webkit-flex: 1 0 auto;
      -ms-flex: 1 0 auto;
      flex: 1 0 auto;
      list-style: none;
      margin: 25px auto;
      padding: 12px;
      text-align: center;
      width: 100%;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-alert:empty {
      display: none;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-alert-success {
      background: #d3fbeb;
      border-color: #10bf7a;
      color: #0c905c;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-alert-error {
      background: #fde8e2;
      border-color: #f2643b;
      color: #ea4110;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-spinner {
      display: -webkit-box;
      display: -webkit-flex;
      display: -ms-flexbox;
      display: flex;
      height: 0px;
      width: 0px;
      margin: 0 auto;
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      width: 0px;
      overflow: hidden;
      text-align: center;
      -webkit-transition: all 300ms ease-in-out;
      transition: all 300ms ease-in-out;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-spinner>div {
      margin: auto;
      width: 12px;
      height: 12px;
      background-color: #fff;
      opacity: 0.3;
      border-radius: 100%;
      display: inline-block;
      -webkit-animation: formkit-bouncedelay-formkit-form-data-uid-af4786bced- 1.4s infinite ease-in-out both;
      animation: formkit-bouncedelay-formkit-form-data-uid-af4786bced- 1.4s infinite ease-in-out both;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-spinner>div:nth-child(1) {
      -webkit-animation-delay: -0.32s;
      animation-delay: -0.32s;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-spinner>div:nth-child(2) {
      -webkit-animation-delay: -0.16s;
      animation-delay: -0.16s;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-submit[data-active] .formkit-spinner {
      opacity: 1;
      height: 100%;
      width: 50px;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-submit[data-active] .formkit-spinner~span {
      opacity: 0;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-powered-by[data-active="false"] {
      opacity: 0.35;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-powered-by-convertkit-container {
      display: -webkit-box;
      display: -webkit-flex;
      display: -ms-flexbox;
      display: flex;
      width: 100%;
      z-index: 5;
      margin: 10px 0;
      position: relative;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-powered-by-convertkit-container[data-active="false"] {
      opacity: 0.35;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-powered-by-convertkit {
      -webkit-align-items: center;
      -webkit-box-align: center;
      -ms-flex-align: center;
      align-items: center;
      background-color: #ffffff;
      border: 1px solid #dce1e5;
      border-radius: 4px;
      color: #373f45;
      cursor: pointer;
      display: block;
      height: 36px;
      margin: 0 auto;
      opacity: 0.95;
      padding: 0;
      -webkit-text-decoration: none;
      text-decoration: none;
      text-indent: 100%;
      -webkit-transition: ease-in-out all 200ms;
      transition: ease-in-out all 200ms;
      white-space: nowrap;
      overflow: hidden;
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      user-select: none;
      width: 190px;
      background-repeat: no-repeat;
      background-position: center;
      background-image: url("data:image/svg+xml;charset=utf8,%3Csvg width='162' height='20' viewBox='0 0 162 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M83.0561 15.2457C86.675 15.2457 89.4722 12.5154 89.4722 9.14749C89.4722 5.99211 86.8443 4.06563 85.1038 4.06563C82.6801 4.06563 80.7373 5.76407 80.4605 8.28551C80.4092 8.75244 80.0387 9.14403 79.5686 9.14069C78.7871 9.13509 77.6507 9.12841 76.9314 9.13092C76.6217 9.13199 76.3658 8.88106 76.381 8.57196C76.4895 6.38513 77.2218 4.3404 78.618 2.76974C80.1695 1.02445 82.4289 0 85.1038 0C89.5979 0 93.8406 4.07791 93.8406 9.14749C93.8406 14.7608 89.1832 19.3113 83.1517 19.3113C78.8502 19.3113 74.5179 16.5041 73.0053 12.5795C72.9999 12.565 72.9986 12.5492 73.0015 12.534C73.0218 12.4179 73.0617 12.3118 73.1011 12.2074C73.1583 12.0555 73.2143 11.907 73.2062 11.7359L73.18 11.1892C73.174 11.0569 73.2075 10.9258 73.2764 10.8127C73.3452 10.6995 73.4463 10.6094 73.5666 10.554L73.7852 10.4523C73.9077 10.3957 74.0148 10.3105 74.0976 10.204C74.1803 10.0974 74.2363 9.97252 74.2608 9.83983C74.3341 9.43894 74.6865 9.14749 75.0979 9.14749C75.7404 9.14749 76.299 9.57412 76.5088 10.1806C77.5188 13.1 79.1245 15.2457 83.0561 15.2457Z' fill='%23373F45'/%3E%3Cpath d='M155.758 6.91365C155.028 6.91365 154.804 6.47916 154.804 5.98857C154.804 5.46997 154.986 5.06348 155.758 5.06348C156.53 5.06348 156.712 5.46997 156.712 5.98857C156.712 6.47905 156.516 6.91365 155.758 6.91365ZM142.441 12.9304V9.32833L141.415 9.32323V8.90392C141.415 8.44719 141.786 8.07758 142.244 8.07986L142.441 8.08095V6.55306L144.082 6.09057V8.08073H145.569V8.50416C145.569 8.61242 145.548 8.71961 145.506 8.81961C145.465 8.91961 145.404 9.01047 145.328 9.08699C145.251 9.16351 145.16 9.2242 145.06 9.26559C144.96 9.30698 144.853 9.32826 144.745 9.32822H144.082V12.7201C144.082 13.2423 144.378 13.4256 144.76 13.4887C145.209 13.5629 145.583 13.888 145.583 14.343V14.9626C144.029 14.9626 142.441 14.8942 142.441 12.9304Z' fill='%23373F45'/%3E%3Cpath d='M110.058 7.92554C108.417 7.88344 106.396 8.92062 106.396 11.5137C106.396 14.0646 108.417 15.0738 110.058 15.0318C111.742 15.0738 113.748 14.0646 113.748 11.5137C113.748 8.92062 111.742 7.88344 110.058 7.92554ZM110.07 13.7586C108.878 13.7586 108.032 12.8905 108.032 11.461C108.032 10.1013 108.878 9.20569 110.071 9.20569C111.263 9.20569 112.101 10.0995 112.101 11.459C112.101 12.8887 111.263 13.7586 110.07 13.7586Z' fill='%23373F45'/%3E%3Cpath d='M118.06 7.94098C119.491 7.94098 120.978 8.33337 120.978 11.1366V14.893H120.063C119.608 14.893 119.238 14.524 119.238 14.0689V10.9965C119.238 9.66506 118.747 9.16047 117.891 9.16047C117.414 9.16047 116.797 9.52486 116.502 9.81915V14.069C116.502 14.1773 116.481 14.2845 116.44 14.3845C116.398 14.4845 116.337 14.5753 116.261 14.6519C116.184 14.7284 116.093 14.7891 115.993 14.8305C115.893 14.8719 115.786 14.8931 115.678 14.8931H114.847V8.10918H115.773C115.932 8.10914 116.087 8.16315 116.212 8.26242C116.337 8.36168 116.424 8.50033 116.46 8.65577C116.881 8.19328 117.428 7.94098 118.06 7.94098ZM122.854 8.09713C123.024 8.09708 123.19 8.1496 123.329 8.2475C123.468 8.34541 123.574 8.48391 123.631 8.64405L125.133 12.8486L126.635 8.64415C126.692 8.48402 126.798 8.34551 126.937 8.2476C127.076 8.1497 127.242 8.09718 127.412 8.09724H128.598L126.152 14.3567C126.091 14.5112 125.986 14.6439 125.849 14.7374C125.711 14.831 125.549 14.881 125.383 14.8809H124.333L121.668 8.09713H122.854Z' fill='%23373F45'/%3E%3Cpath d='M135.085 14.5514C134.566 14.7616 133.513 15.0416 132.418 15.0416C130.496 15.0416 129.024 13.9345 129.024 11.4396C129.024 9.19701 130.451 7.99792 132.191 7.99792C134.338 7.99792 135.254 9.4378 135.158 11.3979C135.139 11.8029 134.786 12.0983 134.38 12.0983H130.679C130.763 13.1916 131.562 13.7662 132.615 13.7662C133.028 13.7662 133.462 13.7452 133.983 13.6481C134.535 13.545 135.085 13.9375 135.085 14.4985V14.5514ZM133.673 10.949C133.785 9.87621 133.061 9.28752 132.191 9.28752C131.321 9.28752 130.734 9.93979 130.679 10.9489L133.673 10.949Z' fill='%23373F45'/%3E%3Cpath d='M137.345 8.11122C137.497 8.11118 137.645 8.16229 137.765 8.25635C137.884 8.35041 137.969 8.48197 138.005 8.62993C138.566 8.20932 139.268 7.94303 139.759 7.94303C139.801 7.94303 140.068 7.94303 140.489 7.99913V8.7265C140.489 9.11748 140.15 9.4147 139.759 9.4147C139.31 9.4147 138.651 9.5829 138.131 9.8773V14.8951H136.462V8.11112L137.345 8.11122ZM156.6 14.0508V8.09104H155.769C155.314 8.09104 154.944 8.45999 154.944 8.9151V14.8748H155.775C156.23 14.8748 156.6 14.5058 156.6 14.0508ZM158.857 12.9447V9.34254H157.749V8.91912C157.749 8.46401 158.118 8.09506 158.574 8.09506H158.857V6.56739L160.499 6.10479V8.09506H161.986V8.51848C161.986 8.97359 161.617 9.34254 161.161 9.34254H160.499V12.7345C160.499 13.2566 160.795 13.44 161.177 13.503C161.626 13.5774 162 13.9024 162 14.3574V14.977C160.446 14.977 158.857 14.9086 158.857 12.9447ZM98.1929 10.1124C98.2033 6.94046 100.598 5.16809 102.895 5.16809C104.171 5.16809 105.342 5.44285 106.304 6.12953L105.914 6.6631C105.654 7.02011 105.16 7.16194 104.749 6.99949C104.169 6.7702 103.622 6.7218 103.215 6.7218C101.335 6.7218 99.9169 7.92849 99.9068 10.1123C99.9169 12.2959 101.335 13.5201 103.215 13.5201C103.622 13.5201 104.169 13.4717 104.749 13.2424C105.16 13.0799 105.654 13.2046 105.914 13.5615L106.304 14.0952C105.342 14.7819 104.171 15.0566 102.895 15.0566C100.598 15.0566 98.2033 13.2842 98.1929 10.1124ZM147.619 5.21768C148.074 5.21768 148.444 5.58663 148.444 6.04174V9.81968L151.82 5.58131C151.897 5.47733 151.997 5.39282 152.112 5.3346C152.227 5.27638 152.355 5.24607 152.484 5.24611H153.984L150.166 10.0615L153.984 14.8749H152.484C152.355 14.8749 152.227 14.8446 152.112 14.7864C151.997 14.7281 151.897 14.6436 151.82 14.5397L148.444 10.3025V14.0508C148.444 14.5059 148.074 14.8749 147.619 14.8749H146.746V5.21768H147.619Z' fill='%23373F45'/%3E%3Cpath d='M0.773438 6.5752H2.68066C3.56543 6.5752 4.2041 6.7041 4.59668 6.96191C4.99219 7.21973 5.18994 7.62695 5.18994 8.18359C5.18994 8.55859 5.09326 8.87061 4.8999 9.11963C4.70654 9.36865 4.42822 9.52539 4.06494 9.58984V9.63379C4.51611 9.71875 4.84717 9.88721 5.05811 10.1392C5.27197 10.3882 5.37891 10.7266 5.37891 11.1543C5.37891 11.7314 5.17676 12.1841 4.77246 12.5122C4.37109 12.8374 3.81152 13 3.09375 13H0.773438V6.5752ZM1.82373 9.22949H2.83447C3.27393 9.22949 3.59473 9.16064 3.79688 9.02295C3.99902 8.88232 4.1001 8.64502 4.1001 8.31104C4.1001 8.00928 3.99023 7.79102 3.77051 7.65625C3.55371 7.52148 3.20801 7.4541 2.7334 7.4541H1.82373V9.22949ZM1.82373 10.082V12.1167H2.93994C3.37939 12.1167 3.71045 12.0332 3.93311 11.8662C4.15869 11.6963 4.27148 11.4297 4.27148 11.0664C4.27148 10.7324 4.15723 10.4849 3.92871 10.3237C3.7002 10.1626 3.35303 10.082 2.88721 10.082H1.82373Z' fill='%23373F45'/%3E%3Cpath d='M13.011 6.5752V10.7324C13.011 11.207 12.9084 11.623 12.7034 11.9805C12.5012 12.335 12.2068 12.6089 11.8201 12.8022C11.4363 12.9927 10.9763 13.0879 10.4402 13.0879C9.6433 13.0879 9.02368 12.877 8.5813 12.4551C8.13892 12.0332 7.91772 11.4531 7.91772 10.7148V6.5752H8.9724V10.6401C8.9724 11.1704 9.09546 11.5615 9.34155 11.8135C9.58765 12.0654 9.96557 12.1914 10.4753 12.1914C11.4656 12.1914 11.9607 11.6714 11.9607 10.6313V6.5752H13.011Z' fill='%23373F45'/%3E%3Cpath d='M15.9146 13V6.5752H16.9649V13H15.9146Z' fill='%23373F45'/%3E%3Cpath d='M19.9255 13V6.5752H20.9758V12.0991H23.696V13H19.9255Z' fill='%23373F45'/%3E%3Cpath d='M28.2828 13H27.2325V7.47607H25.3428V6.5752H30.1724V7.47607H28.2828V13Z' fill='%23373F45'/%3E%3Cpath d='M41.9472 13H40.8046L39.7148 9.16796C39.6679 9.00097 39.6093 8.76074 39.539 8.44727C39.4687 8.13086 39.4262 7.91113 39.4116 7.78809C39.3823 7.97559 39.3339 8.21875 39.2665 8.51758C39.2021 8.81641 39.1479 9.03905 39.1039 9.18554L38.0405 13H36.8979L36.0673 9.7832L35.2236 6.5752H36.2958L37.2143 10.3193C37.3578 10.9199 37.4604 11.4502 37.5219 11.9102C37.5541 11.6611 37.6025 11.3828 37.6669 11.0752C37.7314 10.7676 37.79 10.5186 37.8427 10.3281L38.8886 6.5752H39.9301L41.0024 10.3457C41.1049 10.6943 41.2133 11.2158 41.3276 11.9102C41.3715 11.4912 41.477 10.958 41.644 10.3105L42.558 6.5752H43.6215L41.9472 13Z' fill='%23373F45'/%3E%3Cpath d='M45.7957 13V6.5752H46.846V13H45.7957Z' fill='%23373F45'/%3E%3Cpath d='M52.0258 13H50.9755V7.47607H49.0859V6.5752H53.9155V7.47607H52.0258V13Z' fill='%23373F45'/%3E%3Cpath d='M61.2312 13H60.1765V10.104H57.2146V13H56.1643V6.5752H57.2146V9.20312H60.1765V6.5752H61.2312V13Z' fill='%23373F45'/%3E%3C/svg%3E");
    }

    .formkit-form[data-uid="af4786bced"] .formkit-powered-by-convertkit:hover,
    .formkit-form[data-uid="af4786bced"] .formkit-powered-by-convertkit:focus {
      background-color: #ffffff;
      -webkit-transform: scale(1.025) perspective(1px);
      -ms-transform: scale(1.025) perspective(1px);
      transform: scale(1.025) perspective(1px);
      opacity: 1;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-powered-by-convertkit[data-variant="dark"],
    .formkit-form[data-uid="af4786bced"] .formkit-powered-by-convertkit[data-variant="light"] {
      background-color: transparent;
      border-color: transparent;
      width: 166px;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-powered-by-convertkit[data-variant="light"] {
      color: #ffffff;
      background-image: url("data:image/svg+xml;charset=utf8,%3Csvg width='162' height='20' viewBox='0 0 162 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M83.0561 15.2457C86.675 15.2457 89.4722 12.5154 89.4722 9.14749C89.4722 5.99211 86.8443 4.06563 85.1038 4.06563C82.6801 4.06563 80.7373 5.76407 80.4605 8.28551C80.4092 8.75244 80.0387 9.14403 79.5686 9.14069C78.7871 9.13509 77.6507 9.12841 76.9314 9.13092C76.6217 9.13199 76.3658 8.88106 76.381 8.57196C76.4895 6.38513 77.2218 4.3404 78.618 2.76974C80.1695 1.02445 82.4289 0 85.1038 0C89.5979 0 93.8406 4.07791 93.8406 9.14749C93.8406 14.7608 89.1832 19.3113 83.1517 19.3113C78.8502 19.3113 74.5179 16.5041 73.0053 12.5795C72.9999 12.565 72.9986 12.5492 73.0015 12.534C73.0218 12.4179 73.0617 12.3118 73.1011 12.2074C73.1583 12.0555 73.2143 11.907 73.2062 11.7359L73.18 11.1892C73.174 11.0569 73.2075 10.9258 73.2764 10.8127C73.3452 10.6995 73.4463 10.6094 73.5666 10.554L73.7852 10.4523C73.9077 10.3957 74.0148 10.3105 74.0976 10.204C74.1803 10.0974 74.2363 9.97252 74.2608 9.83983C74.3341 9.43894 74.6865 9.14749 75.0979 9.14749C75.7404 9.14749 76.299 9.57412 76.5088 10.1806C77.5188 13.1 79.1245 15.2457 83.0561 15.2457Z' fill='white'/%3E%3Cpath d='M155.758 6.91365C155.028 6.91365 154.804 6.47916 154.804 5.98857C154.804 5.46997 154.986 5.06348 155.758 5.06348C156.53 5.06348 156.712 5.46997 156.712 5.98857C156.712 6.47905 156.516 6.91365 155.758 6.91365ZM142.441 12.9304V9.32833L141.415 9.32323V8.90392C141.415 8.44719 141.786 8.07758 142.244 8.07986L142.441 8.08095V6.55306L144.082 6.09057V8.08073H145.569V8.50416C145.569 8.61242 145.548 8.71961 145.506 8.81961C145.465 8.91961 145.404 9.01047 145.328 9.08699C145.251 9.16351 145.16 9.2242 145.06 9.26559C144.96 9.30698 144.853 9.32826 144.745 9.32822H144.082V12.7201C144.082 13.2423 144.378 13.4256 144.76 13.4887C145.209 13.5629 145.583 13.888 145.583 14.343V14.9626C144.029 14.9626 142.441 14.8942 142.441 12.9304Z' fill='white'/%3E%3Cpath d='M110.058 7.92554C108.417 7.88344 106.396 8.92062 106.396 11.5137C106.396 14.0646 108.417 15.0738 110.058 15.0318C111.742 15.0738 113.748 14.0646 113.748 11.5137C113.748 8.92062 111.742 7.88344 110.058 7.92554ZM110.07 13.7586C108.878 13.7586 108.032 12.8905 108.032 11.461C108.032 10.1013 108.878 9.20569 110.071 9.20569C111.263 9.20569 112.101 10.0995 112.101 11.459C112.101 12.8887 111.263 13.7586 110.07 13.7586Z' fill='white'/%3E%3Cpath d='M118.06 7.94098C119.491 7.94098 120.978 8.33337 120.978 11.1366V14.893H120.063C119.608 14.893 119.238 14.524 119.238 14.0689V10.9965C119.238 9.66506 118.747 9.16047 117.891 9.16047C117.414 9.16047 116.797 9.52486 116.502 9.81915V14.069C116.502 14.1773 116.481 14.2845 116.44 14.3845C116.398 14.4845 116.337 14.5753 116.261 14.6519C116.184 14.7284 116.093 14.7891 115.993 14.8305C115.893 14.8719 115.786 14.8931 115.678 14.8931H114.847V8.10918H115.773C115.932 8.10914 116.087 8.16315 116.212 8.26242C116.337 8.36168 116.424 8.50033 116.46 8.65577C116.881 8.19328 117.428 7.94098 118.06 7.94098ZM122.854 8.09713C123.024 8.09708 123.19 8.1496 123.329 8.2475C123.468 8.34541 123.574 8.48391 123.631 8.64405L125.133 12.8486L126.635 8.64415C126.692 8.48402 126.798 8.34551 126.937 8.2476C127.076 8.1497 127.242 8.09718 127.412 8.09724H128.598L126.152 14.3567C126.091 14.5112 125.986 14.6439 125.849 14.7374C125.711 14.831 125.549 14.881 125.383 14.8809H124.333L121.668 8.09713H122.854Z' fill='white'/%3E%3Cpath d='M135.085 14.5514C134.566 14.7616 133.513 15.0416 132.418 15.0416C130.496 15.0416 129.024 13.9345 129.024 11.4396C129.024 9.19701 130.451 7.99792 132.191 7.99792C134.338 7.99792 135.254 9.4378 135.158 11.3979C135.139 11.8029 134.786 12.0983 134.38 12.0983H130.679C130.763 13.1916 131.562 13.7662 132.615 13.7662C133.028 13.7662 133.462 13.7452 133.983 13.6481C134.535 13.545 135.085 13.9375 135.085 14.4985V14.5514ZM133.673 10.949C133.785 9.87621 133.061 9.28752 132.191 9.28752C131.321 9.28752 130.734 9.93979 130.679 10.9489L133.673 10.949Z' fill='white'/%3E%3Cpath d='M137.345 8.11122C137.497 8.11118 137.645 8.16229 137.765 8.25635C137.884 8.35041 137.969 8.48197 138.005 8.62993C138.566 8.20932 139.268 7.94303 139.759 7.94303C139.801 7.94303 140.068 7.94303 140.489 7.99913V8.7265C140.489 9.11748 140.15 9.4147 139.759 9.4147C139.31 9.4147 138.651 9.5829 138.131 9.8773V14.8951H136.462V8.11112L137.345 8.11122ZM156.6 14.0508V8.09104H155.769C155.314 8.09104 154.944 8.45999 154.944 8.9151V14.8748H155.775C156.23 14.8748 156.6 14.5058 156.6 14.0508ZM158.857 12.9447V9.34254H157.749V8.91912C157.749 8.46401 158.118 8.09506 158.574 8.09506H158.857V6.56739L160.499 6.10479V8.09506H161.986V8.51848C161.986 8.97359 161.617 9.34254 161.161 9.34254H160.499V12.7345C160.499 13.2566 160.795 13.44 161.177 13.503C161.626 13.5774 162 13.9024 162 14.3574V14.977C160.446 14.977 158.857 14.9086 158.857 12.9447ZM98.1929 10.1124C98.2033 6.94046 100.598 5.16809 102.895 5.16809C104.171 5.16809 105.342 5.44285 106.304 6.12953L105.914 6.6631C105.654 7.02011 105.16 7.16194 104.749 6.99949C104.169 6.7702 103.622 6.7218 103.215 6.7218C101.335 6.7218 99.9169 7.92849 99.9068 10.1123C99.9169 12.2959 101.335 13.5201 103.215 13.5201C103.622 13.5201 104.169 13.4717 104.749 13.2424C105.16 13.0799 105.654 13.2046 105.914 13.5615L106.304 14.0952C105.342 14.7819 104.171 15.0566 102.895 15.0566C100.598 15.0566 98.2033 13.2842 98.1929 10.1124ZM147.619 5.21768C148.074 5.21768 148.444 5.58663 148.444 6.04174V9.81968L151.82 5.58131C151.897 5.47733 151.997 5.39282 152.112 5.3346C152.227 5.27638 152.355 5.24607 152.484 5.24611H153.984L150.166 10.0615L153.984 14.8749H152.484C152.355 14.8749 152.227 14.8446 152.112 14.7864C151.997 14.7281 151.897 14.6436 151.82 14.5397L148.444 10.3025V14.0508C148.444 14.5059 148.074 14.8749 147.619 14.8749H146.746V5.21768H147.619Z' fill='white'/%3E%3Cpath d='M0.773438 6.5752H2.68066C3.56543 6.5752 4.2041 6.7041 4.59668 6.96191C4.99219 7.21973 5.18994 7.62695 5.18994 8.18359C5.18994 8.55859 5.09326 8.87061 4.8999 9.11963C4.70654 9.36865 4.42822 9.52539 4.06494 9.58984V9.63379C4.51611 9.71875 4.84717 9.88721 5.05811 10.1392C5.27197 10.3882 5.37891 10.7266 5.37891 11.1543C5.37891 11.7314 5.17676 12.1841 4.77246 12.5122C4.37109 12.8374 3.81152 13 3.09375 13H0.773438V6.5752ZM1.82373 9.22949H2.83447C3.27393 9.22949 3.59473 9.16064 3.79688 9.02295C3.99902 8.88232 4.1001 8.64502 4.1001 8.31104C4.1001 8.00928 3.99023 7.79102 3.77051 7.65625C3.55371 7.52148 3.20801 7.4541 2.7334 7.4541H1.82373V9.22949ZM1.82373 10.082V12.1167H2.93994C3.37939 12.1167 3.71045 12.0332 3.93311 11.8662C4.15869 11.6963 4.27148 11.4297 4.27148 11.0664C4.27148 10.7324 4.15723 10.4849 3.92871 10.3237C3.7002 10.1626 3.35303 10.082 2.88721 10.082H1.82373Z' fill='white'/%3E%3Cpath d='M13.011 6.5752V10.7324C13.011 11.207 12.9084 11.623 12.7034 11.9805C12.5012 12.335 12.2068 12.6089 11.8201 12.8022C11.4363 12.9927 10.9763 13.0879 10.4402 13.0879C9.6433 13.0879 9.02368 12.877 8.5813 12.4551C8.13892 12.0332 7.91772 11.4531 7.91772 10.7148V6.5752H8.9724V10.6401C8.9724 11.1704 9.09546 11.5615 9.34155 11.8135C9.58765 12.0654 9.96557 12.1914 10.4753 12.1914C11.4656 12.1914 11.9607 11.6714 11.9607 10.6313V6.5752H13.011Z' fill='white'/%3E%3Cpath d='M15.9146 13V6.5752H16.9649V13H15.9146Z' fill='white'/%3E%3Cpath d='M19.9255 13V6.5752H20.9758V12.0991H23.696V13H19.9255Z' fill='white'/%3E%3Cpath d='M28.2828 13H27.2325V7.47607H25.3428V6.5752H30.1724V7.47607H28.2828V13Z' fill='white'/%3E%3Cpath d='M41.9472 13H40.8046L39.7148 9.16796C39.6679 9.00097 39.6093 8.76074 39.539 8.44727C39.4687 8.13086 39.4262 7.91113 39.4116 7.78809C39.3823 7.97559 39.3339 8.21875 39.2665 8.51758C39.2021 8.81641 39.1479 9.03905 39.1039 9.18554L38.0405 13H36.8979L36.0673 9.7832L35.2236 6.5752H36.2958L37.2143 10.3193C37.3578 10.9199 37.4604 11.4502 37.5219 11.9102C37.5541 11.6611 37.6025 11.3828 37.6669 11.0752C37.7314 10.7676 37.79 10.5186 37.8427 10.3281L38.8886 6.5752H39.9301L41.0024 10.3457C41.1049 10.6943 41.2133 11.2158 41.3276 11.9102C41.3715 11.4912 41.477 10.958 41.644 10.3105L42.558 6.5752H43.6215L41.9472 13Z' fill='white'/%3E%3Cpath d='M45.7957 13V6.5752H46.846V13H45.7957Z' fill='white'/%3E%3Cpath d='M52.0258 13H50.9755V7.47607H49.0859V6.5752H53.9155V7.47607H52.0258V13Z' fill='white'/%3E%3Cpath d='M61.2312 13H60.1765V10.104H57.2146V13H56.1643V6.5752H57.2146V9.20312H60.1765V6.5752H61.2312V13Z' fill='white'/%3E%3C/svg%3E");
    }

    @-webkit-keyframes formkit-bouncedelay-formkit-form-data-uid-af4786bced- {

      0%,
      80%,
      100% {
        -webkit-transform: scale(0);
        -ms-transform: scale(0);
        transform: scale(0);
      }

      40% {
        -webkit-transform: scale(1);
        -ms-transform: scale(1);
        transform: scale(1);
      }
    }

    @keyframes formkit-bouncedelay-formkit-form-data-uid-af4786bced- {

      0%,
      80%,
      100% {
        -webkit-transform: scale(0);
        -ms-transform: scale(0);
        transform: scale(0);
      }

      40% {
        -webkit-transform: scale(1);
        -ms-transform: scale(1);
        transform: scale(1);
      }
    }

    .formkit-form[data-uid="af4786bced"] blockquote {
      padding: 10px 20px;
      margin: 0 0 20px;
      border-left: 5px solid #e1e1e1;
    }

    .formkit-form[data-uid="af4786bced"] .seva-custom-content {
      padding: 15px;
      font-size: 16px;
      color: #fff;
      mix-blend-mode: difference;
    }

    .formkit-form[data-uid="af4786bced"] {
      box-shadow: 0 0px 2px rgba(0, 0, 0, 0.15);
      max-width: 700px;
      overflow: hidden;
    }

    .formkit-form[data-uid="af4786bced"] [data-style="full"] {
      width: 100%;
      display: block;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-background {
      background-position: center center;
      background-size: cover;
      min-height: 200px;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-column {
      padding: 20px;
      position: relative;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-header {
      margin-top: 0;
      margin-bottom: 20px;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-field {
      margin: 0 0 10px 0;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-input {
      width: 100%;
      border-left: none;
      border-right: none;
      border-top: none;
      padding-left: 0;
      padding-right: 0;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-fields .formkit-submit {
      margin-top: 15px;
      width: 100%;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-disclaimer {
      margin: 0 0 15px 0;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-disclaimer>p {
      margin: 0;
    }

    .formkit-form[data-uid="af4786bced"] .formkit-powered-by-convertkit-container {
      margin-bottom: 0;
      margin-top: 20px;
    }

    .formkit-form[data-uid="af4786bced"][min-width~="600"] [data-style="full"],
    .formkit-form[data-uid="af4786bced"][min-width~="700"] [data-style="full"],
    .formkit-form[data-uid="af4786bced"][min-width~="800"] [data-style="full"] {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .formkit-form[data-uid="af4786bced"][min-width~="600"] .formkit-column,
    .formkit-form[data-uid="af4786bced"][min-width~="700"] .formkit-column,
    .formkit-form[data-uid="af4786bced"][min-width~="800"] .formkit-column {
      padding: 40px;
    }
  </style>
</form>

https://javarevisited.blogspot.com/search

<form action="https://javarevisited.blogspot.com/search" class="gsc-search-box" target="_top">
  <table cellpadding="0" cellspacing="0" class="gsc-search-box">
    <tbody>
      <tr>
        <td class="gsc-input">
          <input autocomplete="off" class="gsc-input" name="q" size="10" title="search" type="text" value="">
        </td>
        <td class="gsc-search-button">
          <input class="gsc-search-button" title="search" type="submit" value="Search">
        </td>
      </tr>
    </tbody>
  </table>
</form>

POST https://gumroad.com/follow_from_embed_form

<form action="https://gumroad.com/follow_from_embed_form" class="form gumroad-follow-form-embed" method="post"> <input name="seller_id" type="hidden" value="6381505211250"> <input name="email" placeholder="Your email address" type="email"> <button
    data-custom-highlight-color="" type="submit">Follow</button> </form>

POST https://api.follow.it/subscription-form/VzM1WnhvV1JaQXZveTZIeFQ0VFlnUjU3ZlZ1QXQ3WkNickFPQmJUWlZHTHpiVVZkaVFNMU9UQWZvdDNkUmJaWU5MZFo2UjRDMkw2bWd5RFRVZ2hieUVwdk9CRzhUK0ZMSFB2d0FVc2tDU3VKSWxPMTJxUys2QlFKUnRyVHRJY3h8TEpRTDl0YTc5MjVDeDdOejl2NWt0U0dIOVJTMWU2S2h0MFpJL3V5L01QYz0=/8

<form data-v-3a89cb67=""
  action="https://api.follow.it/subscription-form/VzM1WnhvV1JaQXZveTZIeFQ0VFlnUjU3ZlZ1QXQ3WkNickFPQmJUWlZHTHpiVVZkaVFNMU9UQWZvdDNkUmJaWU5MZFo2UjRDMkw2bWd5RFRVZ2hieUVwdk9CRzhUK0ZMSFB2d0FVc2tDU3VKSWxPMTJxUys2QlFKUnRyVHRJY3h8TEpRTDl0YTc5MjVDeDdOejl2NWt0U0dIOVJTMWU2S2h0MFpJL3V5L01QYz0=/8"
  method="post">
  <div data-v-3a89cb67="" class="form-preview" style="background-color: rgb(250, 247, 247); border-style: solid; border-width: 2px; border-color: rgb(204, 204, 204); position: relative;">
    <div data-v-3a89cb67="" class="preview-heading">
      <h5 data-v-3a89cb67="" style="text-transform: none !important; font-family: Montserrat; font-weight: bold; color: rgb(0, 0, 0); font-size: 16px; text-align: center;">Get new posts by email:</h5>
    </div>
    <div data-v-3a89cb67="" class="preview-input-field"><input data-v-3a89cb67="" type="email" name="email" required="required" placeholder="Enter your email" spellcheck="false"
        style="text-transform: none !important; font-family: Montserrat; font-weight: normal; color: rgb(0, 0, 0); font-size: 14px; text-align: center; background-color: rgb(255, 255, 255);"></div>
    <div data-v-3a89cb67="" class="preview-submit-button"><button data-v-3a89cb67="" type="submit"
        style="text-transform: none !important; font-family: Montserrat; font-weight: bold; color: rgb(255, 255, 255); font-size: 16px; text-align: center; background-color: rgb(0, 0, 0);">Subscribe</button></div>
  </div>
</form>

Text Content

WE VALUE YOUR PRIVACY

We and our partners store and/or access information on a device, such as cookies
and process personal data, such as unique identifiers and standard information
sent by a device for personalised ads and content, ad and content measurement,
and audience insights, as well as to develop and improve products. With your
permission we and our partners may use precise geolocation data and
identification through device scanning. You may click to consent to our and our
partners’ processing as described above. Alternatively you may access more
detailed information and change your preferences before consenting or to refuse
consenting. Please note that some processing of your personal data may not
require your consent, but you have a right to object to such processing. Your
preferences will apply to this website only. You can change your preferences at
any time by returning to this site or visit our privacy policy.
MORE OPTIONSAGREE


Javarevisited

Learn Java, Programming, Spring, Hibernate throw tutorials, examples, and
interview questions


Flipboard

LinkedIn



TOPICS AND CATEGORIES

 * core java
 * spring
 * hibernate
 * collections
 * multithreading
 * design patterns
 * interview questions
 * coding
 * data structure
 * OOP
 * java 8
 * books
 * About Me
 * Java Certifications
 * JDBC
 * jsp-servlet
 * JSON
 * SQL
 * Linux
 * Courses
 * online resources
 * jvm-internals
 * REST
 * Eclipse
 * jQuery
 * Java IO
 * Java XML


Disclosure: This article may contain affiliate links. When you purchase, we may
earn a small commission.



ERROR: COULD NOT FIND OR LOAD MAIN CLASS IN JAVA [SOLVED]


Error: Could not find or load main class HelloWorld comes when you are trying to
run your Java program using java command with the main class as HelloWorld but
Java is not able to find the class. In order to solve this error, you must know
how Java find and loads the classes, that's a little bit complex topic for
beginners, but we will touch the same base here. For the curious reader, I would
suggest reading my post How Classpath works in Java, a must read for a beginner.
For now, you just remember that there is an environment variable called
CLASSPATH which includes directories where Java looks for all class files and if
it doesn't find your main class there then it throws "Error: Could not find or
load main class XXX", where XXX is the name of your main class.
Powered By


Video Player is loading.
Play Video
Play
Unmute

Current Time 0:00
/
Duration 50:39
Loaded: 0.82%


00:00
Stream Type LIVE
Seek to live, currently behind liveLIVE
Remaining Time -50:39
 
1x
Playback Rate

Chapters
 * Chapters

Descriptions
 * descriptions off, selected

Captions
 * captions settings, opens captions settings dialog
 * captions off, selected

Audio Track
 * default, selected

Picture-in-PictureFullscreen

This is a modal window.



Beginning of dialog window. Escape will cancel and close the window.

TextColorWhiteBlackRedGreenBlueYellowMagentaCyanTransparencyOpaqueSemi-TransparentBackgroundColorBlackWhiteRedGreenBlueYellowMagentaCyanTransparencyOpaqueSemi-TransparentTransparentWindowColorBlackWhiteRedGreenBlueYellowMagentaCyanTransparencyTransparentSemi-TransparentOpaque
Font Size50%75%100%125%150%175%200%300%400%Text Edge
StyleNoneRaisedDepressedUniformDropshadowFont FamilyProportional
Sans-SerifMonospace Sans-SerifProportional SerifMonospace SerifCasualScriptSmall
Caps
Reset restore all settings to the default valuesDone
Close Modal Dialog

End of dialog window.

Advertisement









Since many Java programmer is now started programming using Eclipse they face
this issue when they first try to run their Java program from command line. In
Eclipse, it's easy to compile and run the program because Eclipse takes care of
all Classpath setup, but when you run your Java program from command line,
CLASSPATH environment variable comes in picture.

Personally, I don't like this environment variable and doesn't define in my
environment variable, because its confusing and source of so many classpath
related issue. Instead, I use -cp or -classpath option with java command to run
my program. This way you always know which JARs are included in your classpath.







For beginners, another important thing to understand is the difference between
PATH and CLASSPATH, you must know that PATH is used locate system executable,
commands or .exe, .dll files (in Windows) and .so files (in Linux). It is also
used to locate native libraries used by your Java program. While, CLASSPATH is
used to locate the class file or JAR files. It's Java class loader who looked
into CLASSPATH for loading classes.


Coming back to the problem in hand, if you are a beginner in Java, who are able
to run the program from Eclipse but getting "Error: Could not find or load main
class HelloWorld" when trying to run the same program from the command line then
follow the steps given here to solve it.






SOLVING ERROR: COULD NOT FIND OR LOAD MAIN CLASS HELLOWORLD 

Unfortunately beginner's book like Head First Java, which many developers used
to learn Java, doesn't teach you how to deal with this kind of errors. You need
to build this skill by doing active development.  In order to understand the
problem little better, let's reproduce it. This is one of the most important
troubleshooting skill which will help you a long way in your career. Half of the
problem is solved when you are able to reproduce it.

For our purpose we will use following HelloWorld program for our testing,
interestingly I have named it HelloHP and it resides in a package called "dto".
I have purposefully chosen a class with a package instead of HelloWorld in the
default package because many programmers get "Could not find or load main class"
error when they try to run a class which is inside a package.



package dto;
/**
 * Simple Java program to demonstrate following error
 * Error :Could not find or load main class
 * 
 * @author Javin Paul
 */
public class HelloHP {

    public static void main(String args[]) {
        System.out.println("My first program in Java, HelloWorld !!");
       
    }

}


When you run this from Eclipse, by Right click on the source file and Choosing
"Run as Java Program", it will run fine and print following line:



My first program in Java, HelloWorld !!


Everything as expected, Now we will try to run same Java program from command
line. Since I am using Maven with Eclipse, its build process creates class files
in project_directory\target\classes directory. If you are not using Maven with
Eclipse, then you can see the class file created by Eclipse's Java compiler in
project_directory\bin. It doesn't matter how those class files are created, but,
what is important is the location of the class file.

If your class is inside a non-default package e.g. "dto" in our case then
compiler the will put the HelloHP.class file, which contains Java bytecode in a
directory named "dto". In our case the full name of class dto.HelloHP and it is
present in C:\Users\WINDOWS 8\workspace\Demo\target\classes\dto. So in the first
try, I go there and execute java command to launch my program, as seen below:



C:\Users\WINDOWS 8\workspace\Demo\target\classes\dto>java HelloHP
Error: Could not find or load main class HelloHP


Do you see the error? It's coming because the full name of the class should be
dto.HelloHP and not HelloHP. So let's correct this error and try to run the same
command from the same location but this time with fully qualified name:



C:\Users\WINDOWS 8\workspace\Demo\target\classes\dto>java dto.HelloHP
Error: Could not find or load main class dto.HelloHP


Still same error, right. Why? because I don't have any CLASSPATH environment
variable, neither I am using -classpath or -cp option to suggest the path, So by
default Java is only searching in the current directory. It is looking for
dto/HelloHP.class but since we are already inside dto, it is  not able to find
the class. So, what should we do now? let's go to the parent directory
"C:\Users\WINDOWS 8\workspace\Demo\target\classes" and execute the same command,
this time, it should work:



C:\Users\WINDOWS 8\workspace\Demo\target\classes\dto>cd ..

C:\Users\WINDOWS 8\workspace\Demo\target\classes>java dto.HelloHP
My first program in Java, HelloWorld !!


Bingo!!, our program ran successfully because, without any hint about where to
find class files, Java is by default looking into the current directory, denoted
by . (dot) and able to locate ./dto/HelloHP.class.

Now, what if you want to run this program from any other directory? Well, for
that purpose whether we need to define CLASSPATH or just use -classpath or -cp
option. I like the second option because it's easier to control and change.
Also, remember, it overrides any CLASSPATH environment variable. If you like to
set CLASSPATH environment variable in Windows, see that tutorial.

Now let's run the program target directory first without using -classpath
option:



C:\Users\WINDOWS 8\workspace\Demo\target\classes>cd ..

C:\Users\WINDOWS 8\workspace\Demo\target>java dto.HelloHP
Error: Could not find or load main class dto.HelloHP


You can see we are again started getting the same error, Why? because Java is
still looking into the current directory and there is no
.\target\dto\HelloHP.class there, as it's one level down e.g.
.\target\classes\dto\HelloHP.class

Now let's run the same command using -classpath option from target directory
itself:



C:\Users\WINDOWS 8\workspace\Demo\target>java -cp ./classes;. dto.HelloHP
My first program in Java, HelloWorld !!


Bingo!!, our program ran successfully again because now Java is also looking at
./classes directory and there it is able to find dto\HelloHP.class file.

There are many ways Error: Could not find or load main class
HelloWorld manifests itself, but if you know the basics of Java Classpath, you
can easily sort out the problem. Most of the time you just need to either
correct your CLASSPATH environment variable or run your program with java -cp or
-classpath option. By the way, there are more to it e.g. Main class defined in
the manifest.mf file and that's why I suggest reading about How Classpath works
in Java (see the link in the first paragraph).




SUMMARY

If you are getting "Error: Could not find or load main class XXX", where XXX is
the name of your main class while running Java program then do this to solve
that error:

1) If you are running Java program right from the directory where .class file is
and you have CLASSPATH environment variable defined then make sure it include
current directory. (dot). You can include it as set CLASSPATH=%CLASSPATH%;. in
Windows and export CLASSPATH = ${CLASSPATH}:. (see the separator, in Windows
it's;(semicolon) while in Linux it is (colon), also note we have included
current directory in existing classpath. If you still face the issue of setting
classpath, see this step by step guide to set the classpath. Same thing applies
if you are running your program using -cp or -classpath option.


2) If you are running Java program from the directory, your .class file is and
you don't have any CLASSPATH or -cp option then check whether your class is the
in the package or not. If it's the in the package then go outside of the package
directory and run java command with fully qualified name e.g. if your program is
com.abc package then runs following command from the parent directory of "com"

java com.abc.HelloWorld

without any classpath hints, Java will look into the current directory and
search for com\abc\HelloWorld.class in Windows, so if com directory exists in
your current directory, your program will run otherwise you will get "Error:
Could not find or load main class dto.HelloHP".


3) You can run your Java program from anywhere with the help of proper CLASSPATH
or java -cp option as shown below:

java -cp C:\test\;. com.abc.HelloWorld


If you still facing any issue just check whether you have accidentally using
CLASSPATH environment variable, you can check this in Windows by running echo
%CLASSPATH% command and in Linux by running echo $CLASSPATH. If CLASSPATH is
nonempty then it will print its value otherwise just echo the same command.

4) If you are running in Java version 1.6 or 1.5, then instead of receiving
"Error: Could not find or load main class", you will get Exception in thread
"main" java.lang.NoClassDefFoundError: HelloWorld. It's only from JDK 1.7 onward
we are started receiving this new error. The solution is exactly same, every bit
of discussion applies to that case as well. So if you are not able to solve that
problem by following steps here, do let me know and I will try to work with you
to troubleshoot the problem.

Here is the screenshot of how I tried to reproduce and solve the error as
discussed in the previous paragraph:






That's all about how to solve "Error: Could not find or load main class
HelloWorld" in Java. Classpath is little confusing topic to master, but you will
understand it once you started writing and running some Java program. If you are
still not able to fix your problem then post a comment there with what you have
tried and we will try to troubleshoot together.

My goal is not just to give you solution but also make you able to explain why
the solution is working and CLASSPATH basics are very important for a Java
developer. I have seen many programmers getting frustrated, losing interest in
Java due to various PATH and CLASSPATH issues e.g. NoClassDefFoundError and
ClassNotFoundException and this is my humble effort to bring them back and
empower with practical knowledge. Hope you understand.



Further Reading
Building debugging and troubleshooting skill is not easy and it takes lots of
practice and experience to understand, reproduce and solve the error. If you are
new Java developer then you first pick a book to learn Java from start to end,
but if you are intermediate Java developer then you should look at the following
resources to develop your debugging skill.








PREPARING FOR JAVA DEVELOPER INTERVIEWS?


Download Free Questions

We respect your privacy. Unsubscribe at any time.

Built with ConvertKit
By javin paul
Email This BlogThis! Share to Twitter Share to Facebook
Labels: error and exception


68 COMMENTS :

Anonymous said...

Another common cause of this error is invoking java command with .class file.
Java just need name of your main class without any extension. If you call this

java HelloWorld.class

you will see
Could not find or load main class HelloWorld.class

April 6, 2015 at 8:30 AM Anonymous said...

Thank you so, so much for the thorough explanation. I was trying to figure out
as to why it keep prompting that error message.

I had multiple folders/packages to compile. The compilation wasn't the issue but
the running of the main file in a child directory, is. Apparently, I ran it as:

>java dto\Hello

instead of

>java dto.Hello

May 29, 2015 at 3:39 AM YoNoSe said...

Hello: Have you ever faced permissions issues on windows server 2012? Our
program runs perfectly if you just double click on it, but it doesn't as a
scheduled task. User is set to run wheter logged in or not. It also has full
permissions on the program path and it has execution permissions on the java.exe
path as well. Do you happen to have any clues on this situation? We are getting
the "Error: Could not find or load main class" with the sched task user. Thanks!

June 23, 2015 at 6:38 AM javin paul said...

Hello Javier, by scheduled task do you mean running your Java program as windows
service?

June 23, 2015 at 6:50 AM jaison said...

Hi, I am trying to call one c function from java via JNI. I added dll of the c
program in java build path. but after doing this , i am getting the error "Could
not find or load main class".
I am using Cygwin & eclipse.

c program
---------------
#include < stdint.h >
#include "JniCSidePgm.hpp"
#include < stdio.h >
#include < jni.h >

int sum(int v1,int v2){
return v1+v2;
}


java program
------------------
package com.jni;

public class JniJavaSidePgm {

static {
System.loadLibrary("JniCSide"); // Load native library at runtime
// hello.dll (Windows) or libhello.so (Unixes)
}

// Declare a native method sayHello() that receives nothing and returns void
private native void sum(int v1,int v2);

// Test Driver
public static void main(String[] args) {
new JniJavaSidePgm().sum(1,2); // invoke the native method
}
}

July 12, 2015 at 7:13 PM javin paul said...

Hello Jaison, from where did you running your program? since your main class is
inside com.jni package, you must run outside that directory and provide a fully
qualified name e.g.
java -cp . com.jni.JniJavaSidePgm

July 13, 2015 at 8:51 AM Anonymous said...

Running from outside the package did the job for me, thanks! No one any where
else was able to get that across

July 19, 2015 at 12:41 PM Anonymous said...

Thank you! You just saved me from banging my head against the wall! I kept
trying to go to Run | Run in Eclipse and in past exercises (I'm working out of
the Head First Java book) I didn't have to do that. I completely forgot about
the "right click" and "Run As" Java Application!

August 11, 2015 at 1:49 PM javin paul said...

@Anonymous, glad to hear that solution worked for you.

August 15, 2015 at 8:43 AM raghu said...

I am unable to compile main class and in my directory byte code is not created
for the main class..

October 25, 2015 at 11:19 AM javin paul said...

@raghu, what error are you getting, can you post your error here?

October 31, 2015 at 3:55 AM Anonymous said...

thank you! you're awesome my friend! you saved me... I spent hours to find a
solution for this error.

December 13, 2015 at 11:34 AM Anonymous said...

Hello, I am getting "Error: Could not find or load main class Server" on
Eclipse. Server is the main class, contains main() method but somehow Eclipse is
not able to find it. It's on default package, and I have tried everything from
cleaning the project, building the project and build automatically. Not sure
what is wrong, can you please help?

January 17, 2016 at 7:00 PM mourina said...

Hey Javin,

Thanks a lot.

Helped my solve my first Java issue.





February 7, 2016 at 6:42 PM Unknown said...

hey. I am trying to run a java program via notepad and i am using window 7 32
bit. The program is unable to run saying "Could not find or load main class". I
have tried every possible thing from setting the path and classpath to using dto
but the result is the same. pls help. i am using jre and jdk1.8.0_73

February 25, 2016 at 4:19 AM mithilesh said...

Hi, Is anyone available now.
I get an error while running a java program from command prompt

April 1, 2016 at 8:53 AM javin paul said...

Hello @mithilesh, what did you try? does solution given here helped you?

April 1, 2016 at 8:58 AM mithilesh said...

@Javin: Thank you for replying. I was able to execute the program but after
removing the package name from the program file. How to run the program with the
package name in the file?

April 1, 2016 at 10:19 AM javin paul said...

@mithilesh, you need to run the program outside of the directory e.g. if package
is com then run the command outside of the com directory with full classname
i.e. com.ClassName, I think I have discussed this in the article as well.

See this example

C:\Users\WINDOWS 8\workspace\Demo\target\classes>java dto.HelloHP
My first program in Java, HelloWorld !!


April 1, 2016 at 11:34 PM Unknown said...

Not working :( HELP!

Getting error: Could not find or load main class

April 2, 2016 at 11:43 AM javin paul said...

Hello @Robert, what did you try and what is not working? Can you please describe
your problem in little more detail?

April 2, 2016 at 8:53 PM Valerie said...

I have a folder on my desktop called ’opennlp’ where my .class file is in.
So, I followed the instructions and in my command line returned to the desktop
to run the following command:
java opennlp.OpenNlpTest

However, I still get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError:
opennlp/tools/util/ObjectStream
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2625)
at java.lang.Class.getMethod0(Class.java:2866)
at java.lang.Class.getMethod(Class.java:1676)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: opennlp.tools.util.ObjectStream
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 6 more

I hope you can help me


April 17, 2016 at 9:13 AM Anonymous said...

Hello Mahek,try changing the name of your program to the name of the project
class .It worked for me.

June 10, 2016 at 10:55 AM Anonymous said...

Thanks for this article, it was really usefull :-)

June 26, 2016 at 12:57 PM Unknown said...

You don't know how much your steps helped me to solve my problem. A big thank
you Javin Paul :)

June 30, 2016 at 3:09 AM javin paul said...

your welcome @Ganesh, glad you find this tutorial useful.

June 30, 2016 at 5:28 AM Anonymous said...

This doesn't work for me. I am running Fedora (Linux). I copied your source for
HelloHP and saved it as HelloHP.java. I then opened a terminal window, went to
where I saved the file and compiled it from the command line. When I went to run
it I got the class not found error as expected. I then went to the parent
directory and tried again. Still failed. What am I doing wrong?
Here is the output from my attempt

vince@Vince2 sample]$ javac HelloHP.java
[vince@Vince2 sample]$ java HelloHP
Error: Could not find or load main class HelloHP
[vince@Vince2 sample]$ cd ..
[vince@Vince2 hsqldb]$ java dto.HelloHP
Error: Could not find or load main class dto.HelloHP

Thank you in advance


August 6, 2016 at 6:58 AM Anonymous said...

Update - I made a few changes and got it to work. I commented out the package
statement in the source and added "-cp ." to the java command. This worked. What
was wrong with the original code?
Here is some output:

vince@Vince2 sample]$ cat HelloHP.java

package HelloHP;
/**
* Simple Java program to demonstrate following error
* Error :Could not find or load main class
*
* @author Javin Paul
*/
public class HelloHP {

public static void main(String args[]) {
System.out.println("My first program in Java, HelloWorld !!");

}

}
[vince@Vince2 sample]$ java -cp . HelloHP
Error: Could not find or load main class HelloHP
[vince@Vince2 sample]$ javac HelloHP.java
[vince@Vince2 sample]$ java -cp . HelloHP
My first program in Java, HelloWorld !!


August 6, 2016 at 7:20 AM dArch said...

Very helpful explanation ... solved my issue w/o a fuss, thanks:-)

August 9, 2016 at 7:44 PM javin paul said...

@dArch, thanks!!glad to know that it help you to solve your issue.

August 10, 2016 at 6:12 PM Anonymous said...

Eclipse - main class not found error
I was also getting same problem in Eclipse i.e. whenever I run my program either
by Run configurations or right click and run as Java program, I get the popup
complaining about could not find or load main class. I debug it by debug as Java
program and found that it was one of the dependent JAR which was available in
classpath but Eclipse was not seeing it. My error was resolved after deleting
existing run configuration where User entry was not pointing to default
classpath. Just deleting the run configuration and re-creating it by running the
class as right click, Run as Java program will fix the error.

September 23, 2016 at 1:01 AM Unknown said...

I get an error could not find or load main class in my code how to fix it can
anyone help me


October 14, 2016 at 6:59 AM Gupta Ujjwal said...

import java.sql.*;
import java.io.*;
import java.util.*;
import java.lang.*;
class scrolldemo
{
public static void main(String args[])throws IOException,ClassNotFoundException
{
Scanner sr=new Scanner(System.in);

Connection con=null;
Statement stmt=null;
ResultSet rs=null;
int ch;

//Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
try
{
//con=DriverManager.getConnection("jdbc:odbc:developer");
con=DriverManager.getConnection("jdbc:ucanaccess://C:\\Users\\User\\Desktop\\db.accdb");
stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
rs=stmt.executeQuery("select * from student");

do
{
System.out.println("1) First Record");
System.out.println("2) Last Record");
System.out.println("3) Previous Record");
System.out.println("4) Next Record");
System.out.println("5) Exit Record");
System.out.println("Enter your choice");
ch=sr.nextInt();
if(ch==1)
{
if(!rs.first())
{
rs.first();
System.out.println(rs.getString(1)+" "+rs.getString(2));
}
else
{
System.out.println("Already on first record");
}
}
else if(ch==2)
{
if(!rs.last())
{
rs.last();
System.out.println(rs.getString(1)+" "+rs.getString(2));
}
else
{
System.out.println("Already on last record");
}
}
if(ch==3)
{
if(rs.previous())
System.out.println(rs.getString(1)+" "+rs.getString(2));
else
System.out.println("Already on first record");
}
if(ch==4)
{
if(rs.next())
System.out.println(rs.getString(1)+" "+rs.getString(2));
else
System.out.println("Already on last record");
}
}while(ch!=0);
rs.close();
stmt.close();
con.close();

}
catch(SQLException e)
{
System.out.println(e);
}
new scrolldemo();
}
}

I am trying to run this program but i am getting an error could not find or load
main class scrolldemo.

I have saved the java file in " C:\Users\User\Desktop "

I have set the classpath as "C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext" as
my ucanaccess.jar file is in this folder because my OS does not support Type1
driver.

when i compile the program as "javac demo.java"
and try to run as " java scrolldemo"
I get an error "could not find or load main class scrolldemo"
I used classpath to set the ucanaccess.jar file so that i wont get an error as
"ClassNotFoundException"
Please Help me.

December 13, 2016 at 12:40 PM keith said...

Your description is really great and I thought FINALLY my problem is over. Sadly
not.
I'm getting really desperate... My app compiles fine with the -classpath switch
under javac however if I try to run it with -cp or -classpath. I have included
the compile below with the error from not having the classpath from
completeness.
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
# javac JDBCQuery.java
JDBCQuery.java:71: error: package com.ibm.as400.access does not exist
DriverManager.registerDriver(new com.ibm.as400.access.AS400JDBCDriver());
^
# javac -classpath /usr/lib/jvm/java-8-oracle/jre/lib/jt400.jar JDBCQuery.java
#
# java JDBCQuery 172.1.1.1 PSPF PRICE
Exception in thread "main" java.lang.NoClassDefFoundError:
com/ibm/as400/access/AS400JDBCDriver
at JDBCQuery.main(JDBCQuery.java:71)
Caused by: java.lang.ClassNotFoundException:
com.ibm.as400.access.AS400JDBCDriver
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more
# java -cp /root JDBCQuery 172.1.1.1 PSPF PRICE
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/as400/….
(same as previous)
# java -classpath /root JDBCQuery 172.1.1.1 PSPF PRICE
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/as400/….
(same as previous)
# echo $CLASSPATH
/usr/lib/jvm/java-8-oracle/jre/lib:.
tried above with CLASSPATH unset too. Code is below, it is just trying to
connect to an iSeries using the IBM jtopen 9.1 tool:
import java.sql.*;
public class JDBCQuery
{
public static void main (String[] parameters)
{
Connection connection = null;
try {
DriverManager.registerDriver(new com.ibm.as400.access.AS400JDBCDriver());
connection = DriverManager.getConnection ("jdbc:as400://" + system);
DatabaseMetaData dmd = connection.getMetaData ();
Statement select = connection.createStatement ();
ResultSet rs = select.executeQuery (
"SELECT * FROM " + collectionName + dmd.getCatalogSeparator() + tableName);
ResultSetMetaData rsmd = rs.getMetaData ();
while (rs.next ()) {
for (int i = 1; i <= columnCount; ++i) {
String value = rs.getString (i);
if (rs.wasNull ())
value = "";
System.out.print (format (value, columnWidths[i-1]));
System.out.print (" ");
}
System.out.println ();
}
}
catch (Exception e) {
System.out.println ();
System.out.println ("ERROR: " + e.getMessage());
}
finally {
try {
if (connection != null)
connection.close ();
}
catch (SQLException e) {
// Ignore.
}
}
System.exit (0);
}
}
If I don't include any of the connection information the script outputs the
error messages correctly (removed due to char limit) so it looks to me that it
has an issue with the JTOpen driver. Any help would be GREATLY appreciate.
# ls -lh /usr/lib/jvm/java-8-oracle/jre/lib/jt400.jar
-rwx------ 1 root root 4.6M Feb 12 18:28
/usr/lib/jvm/java-8-oracle/jre/lib/jt400.jar

February 12, 2017 at 3:23 AM Anonymous said...

Finally explained well, whithout a stupid advice to set classpath environmental
variable for simple programs. Thank you a lot!

March 8, 2017 at 2:58 AM Revolper said...

It was really useful, thank u :)

March 22, 2017 at 7:16 AM Nikita said...

Great Explanation. I tried to run java program from command line but i am still
getting the same issue.
Project structure:
example/Snippet.java
example/org.json.jar

I've to include the jar in classpath and i'm executing the program from example
directory.(Running from Linux terminal)
javac -cp ./org.json.jar Snippet.java
java -cp ./org.json.jar:. Snippet

June 14, 2017 at 12:20 AM javin paul said...

Hello @Nikita, did you able to run the program from command line or you still
have some error?

June 14, 2017 at 4:50 AM Anonymous said...

Thank you for this page, and related help. It helped me a lot as beginner. !

August 8, 2017 at 3:01 AM javin paul said...

@Anonymous, glad that this tutorial helped you to solve your problem.

August 9, 2017 at 6:34 AM Unknown said...

java and javac cmd are working properly on normal cmd line so it shows that
environment variable is working properly but when i run any programthen it can
compile only and make a byte code but i cannot run this class file via javac
tool.it shows Error: Could not find or load main class.plz resolve this problem
send your response on gauravlodhi41@gmil.com.

November 15, 2017 at 10:26 AM Unknown said...

Hello, I have followed your blog and I am still facing the same issue.
Please Assist me on
https://stackoverflow.com/questions/49738153/java-cannot-load-or-find-main-class
or assist me here.

April 9, 2018 at 3:49 PM javin paul said...

Hello Jesse, Can you share how you are running your program in Eclipse? What
have you put as Main Class etc?

April 10, 2018 at 4:54 AM Unknown said...

i still get the same error, the app runs in netbeans but not in dist folder

May 3, 2018 at 1:26 PM Unknown said...

Hi, I am getting 'error: could not find or load main class' when I am trying run
a java program with multiple classes, but it is working fine with a single
class. What might be the reason for this?

June 15, 2018 at 10:52 AM Ubuntu Cinnamon said...

I don't know how I didn't know this as an expert java developer

August 14, 2018 at 7:10 AM Unknown said...

Thanks, this article is really problem-solving for me

January 11, 2019 at 2:07 AM Anonymous said...

class exceptionDeom2
{
public static void main(String args[])
{
try{
System.out.println(3/0);
System.out.println("in try");
}
catch(ArithmeticException e){
System.out.println("Exception"+e.getMessage());
}
/* finally{
System.out.println("learning Exception Handeling");
}*/
}
}
Error:-
E:\java\Java_Programs\Exception handling> java exceptionDemo2
Error: Could not find or load main class exceptionDemo2
PS E:\java\Java_Programs\Exception handling>

January 21, 2019 at 12:30 AM Anonymous said...

Thank you. You are awesome!!

January 21, 2019 at 5:27 AM Anonymous said...

I Created a JavaFX Application with BlueJ. The Appplication compiles and runs as
expected with BlueJ. However, When I create a Jar File of the application and
try to run it by double clicking, Nothing Happens. When I run it using CMD it
displays an error
"Error: Could not find or load main class".
I even tried Wrapping the Jar in an .exe file using Launch 4J with the same
results. I am frustrated I have spent a week trying to figure this out. I have
read thousands of online fixes including this and I cant seem to find the
solution.

My Objective is create a standalone .exe file which I can then share with a
friend or run on any windows machine.
please help.

March 7, 2019 at 3:09 PM Unknown said...

I was looking for solution on this issue for over 3 hour , only now its work by
your suggestions , after adding the environment variable
CLASSPATH=%CLASSPATH%;.

Thanks for great explanation

March 23, 2019 at 4:52 AM Juliano said...

When I build my .jar file once I try to java -jar I get hte following "Javassist
version 3.22.0-GA
Copyright (C) 1999-2017 Shigeru Chiba. All Rights Reserved." while if I run with
java -cp test.jar com.test.boot.Mainkt I get correct execution. Any suggestion
for me to be able to run my jar file as java -jar test.jar

March 26, 2019 at 5:44 AM Anonymous said...

Thanks Man, You saved my day. Thanks a lot

July 12, 2019 at 5:18 AM Anonymous said...

Even without any package one can get this error.
The note touches upon this by saying CLASSPATH=%CLASSPATH%; must be there to
include the current directory.
I got this error when I just used
set classpath=c:\Java\jdk1.8.0_211;c:\Json\json-simple-1.1.1.jar
The above will not pick a class from the current directory )c:\Json)

set classpath=;C:\Java\jdk1.8.0_211;c:\Json\json-simple-1.1.1.jar - solved it
or better to use

set classpath=%CLASSPATH%;C:\Java\jdk1.8.0_211;c:\Json\json-simple-1.1.1.jar



October 23, 2019 at 12:15 AM Anonymous said...

Thank you for this help. Within Eclipse, no problem running my Java with
Package. Using your help above was able to run my Java classes without a Package
from the command line, but not Java classes with Package. Solved issue by
copying my .java to Notepad and deleting top Package line and Save, then
recompiling with javac. It worked! Thanks again.

November 7, 2019 at 2:05 PM javin paul said...

Great to hear that @Anonymous

November 7, 2019 at 6:11 PM Invoice control de facturas said...

Yo lo resolví así y con la siguiente configuración de CLASS_PATH y path.
W10 64
Open Java jdk-13.0.1
Apache Netbeans 11.2

JAVA_PATH = C:\JavaOpen\jdk-13.0.1\
PATH = %JAVA_PATH%\bin\

En el CMD, entrar a la carpeta ...\target\classesy ahí llamar a la clase main
del programa, ejemplo :
...\target\classes>java openjava.holamundo.inicio

(En mi proyecto la ruta de salida es:
C:\Users\Usuario\Documents\NetBeansProjects\holaMundo\target\classes\openjava\holamundo)

Y listo! funciona!

November 24, 2019 at 12:51 PM RG said...

Thanks for the good article.

In the article echo %CLASSPATH should be echo %CLASSPATH% in windows 10 home
from the command line.

December 16, 2019 at 4:24 PM Juan Jesus said...

Thank you for the explanation, Javin!

January 1, 2020 at 12:04 AM Anonymous said...

import java.awt.*;
import java.awt.event.*;
import java.applet.*;

public class ClickableDice extends Applet implements MouseListener {

int die1 = 4; // The values shown on the dice.
int die2 = 3;


public void init() {
// To initialize the applet, register the applet to listen
// for mouse events on itself. Also set a light blue
// background color.
addMouseListener(this);
setBackground( new Color(200,200,255) );
}


public void paint(Graphics g) {
// The paint method draws a blue border and then
// draws the two dice.
g.setColor( Color.blue );
g.drawRect(0,0,99,99);
g.drawRect(1,1,97,97);
drawDie(g, die1, 10, 10);
drawDie(g, die2, 55, 55);
}


void drawDie(Graphics g, int val, int x, int y) {
// Draw a die with upper left corner at (x,y). The die is
// 35 by 35 pixels in size. The val parameter gives the
// value showing on the die (that is, the number of dots).
g.setColor(Color.white);
g.fillRect(x, y, 35, 35);
g.setColor(Color.black);
g.drawRect(x, y, 34, 34);
if (val > 1) // upper left dot
g.fillOval(x+3, y+3, 9, 9);
if (val > 3) // upper right dot
g.fillOval(x+23, y+3, 9, 9);
if (val == 6) // middle left dot
g.fillOval(x+3, y+13, 9, 9);
if (val % 2 == 1) // middle dot (for odd-numbered val's)
g.fillOval(x+13, y+13, 9, 9);
if (val == 6) // middle right dot
g.fillOval(x+23, y+13, 9, 9);
if (val > 3) // bottom left dot
g.fillOval(x+3, y+23, 9, 9);
if (val > 1) // bottom right dot
g.fillOval(x+23, y+23, 9,9);
}


void roll() {
// Roll the dice by randomizing their values. Tell the
// system to repaint the applet, to show the new values.
// Also, play a clicking sound to give the user more feedback.
die1 = (int)(Math.random()*6) + 1;
die2 = (int)(Math.random()*6) + 1;
play(getCodeBase(), "click.au");
repaint();
}


public void mousePressed(MouseEvent evt) {
// When the user clicks the applet, roll the dice.
roll();
}


public void mouseReleased(MouseEvent evt) { }
public void mouseClicked(MouseEvent evt) { }
public void mouseEntered(MouseEvent evt) { }
public void mouseExited(MouseEvent evt) { }


} // end class ClickableDice


Can you solve this errors in my program


April 27, 2020 at 6:28 AM Unknown said...

still not able to overcome with this problem.

April 30, 2020 at 11:26 AM javin paul said...

@Unknown, can you provide more details about your situation, may be we can guide
you in the right direction.

April 30, 2020 at 9:54 PM Anonymous said...

import java.util.*;
class Student
{
int rno;
String name;
void info()
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter the name of the student ");
name = sc.next();
System.out.println("Enter the Roll no. ");
rno = sc.nextInt();
}
}

class Test extends Student
{
int mrk1,mrk2;
public void mrks()
{
Scanner m = new Scanner(System.in);
System.out.println("Enter the marks of 1st subject ");
int m1 = m.nextInt();
System.out.println("Enter the marks of 2nd subject ");
int m2 = m.nextInt();
mrk1 = m1;
mrk2 = m2;
}
public void display()
{
System.out.println("Name of the student:- " + name);
System.out.println("Roll no. of the student:- " + rno);
System.out.println("Marks of 1st subject:- " + mrk1);
System.out.println("Marks of 2nd subject:- " + mrk2);
}
public static void main(String args[])
{
System.out.println("B227 KK");
Test te = new Test();
te.info();
te.mrks();
te.display();
System.out.println("B227 KK");
}
}


I am getting a error in this program

August 31, 2020 at 10:13 AM lakshmi Naresh said...

awww it got worked for me, like below
- cd ..
- java firstPackage.HelloWorld



September 2, 2020 at 1:06 AM Anonymous said...

Hello,thank you for your help. It was really usable. One question: if I open my
JAR file (already compiled) in the Command Prompt, it works, but if I open it
directly from a folder in Windows, it doesn't show errors but quickly exits.
Why?

October 31, 2020 at 11:34 AM javin paul said...

It depends how are you opening? if you use winrar or winzip, you can see class
files inside JAR on Windows.

October 31, 2020 at 11:48 PM Anonymous said...

Literally thank you so much

December 11, 2021 at 6:15 PM Dinesh said...

Nice help regarding setting of classpath variable in various ways. Thank you so
much for wrining this article.

March 22, 2022 at 4:51 AM



POST A COMMENT






Newer Post Older Post Home

Subscribe to: Post Comments ( Atom )



SEARCH THIS BLOG






SUBSCRIBE FOR DISCOUNTS AND UPDATES

Follow




INTERVIEW QUESTIONS

 * core java interview question (176)
 * interview questions (102)
 * data structure and algorithm (85)
 * Coding Interview Question (78)
 * object oriented programming (37)
 * SQL Interview Questions (35)
 * design patterns (35)
 * spring interview questions (32)
 * thread interview questions (30)
 * collections interview questions (25)
 * database interview questions (16)
 * servlet interview questions (15)
 * Programming interview question (6)
 * hibernate interview questions (6)





BEST OF JAVAREVISITED

 * How Spring MVC works internally?
 * How to design a vending machine in Java?
 * How HashMap works in Java?
 * Why String is Immutable in Java?
 * 10 Articles Every Programmer Must Read
 * How to convert lambda expression to method reference in Java 8?
 * 10 Tips to improve Programming Skill
 * 10 OOP design principles programmer should know
 * How Synchronization works in Java?
 * 10 tips to work fast in Linux
 * 5 Books to improve Coding Skills






JAVA TUTORIALS

 * date and time tutorial (24)
 * FIX protocol tutorial (15)
 * Java Certification OCPJP SCJP (33)
 * java collection tutorial (81)
 * java IO tutorial (29)
 * Java JSON tutorial (15)
 * Java multithreading Tutorials (61)
 * Java Programming Tutorials (19)
 * Java xml tutorial (16)
 * JDBC (34)
 * jsp-servlet (37)
 * online resources (226)





GET NEW BLOG POSTS ON YOUR EMAIL

GET NEW POSTS BY EMAIL:


Subscribe



FOLLOWERS





CATEGORIES

 * courses (394)
 * SQL (68)
 * linux (50)
 * database (49)
 * Java Certification OCPJP SCJP (33)
 * Eclipse (30)
 * REST (28)
 * JVM Internals (24)
 * JQuery (21)
 * Testing (19)
 * general (18)
 * Maven (16)




BLOG ARCHIVE

 * ►  2022 (681)
   * ►  August (86)
   * ►  July (151)
   * ►  June (115)
   * ►  May (69)
   * ►  April (133)
   * ►  March (25)
   * ►  February (45)
   * ►  January (57)

 * ▼  2021 (962)
   * ►  December (134)
   * ►  November (88)
   * ►  October (41)
   * ►  September (57)
   * ►  August (224)
   * ▼  July (360)
     * Parsing Large JSON Files using Jackson Streaming A...
     * How to Solve UnrecognizedPropertyException: Unreco...
     * How to parse JSON with date field in Java - Jackso...
     * How to Ignore Unknown Properties While Parsing JSO...
     * How to Find Prime Factors of Integer Numbers in Ja...
     * java.lang.ClassNotFoundException: org.postgresql.D...
     * Why multiple inheritances are not supported in Java
     * How to create HTTP Server in Java - ServerSocket E...
     * Law of Demeter in Java - Principle of least Knowle...
     * How to do GROUP BY in Java 8? Collectors.groupingB...
     * 10 Things Every Java Programmer Should Know about ...
     * 10 Tips to Debug Java Program in Eclipse - Examples
     * How SSL, HTTPS and Certificates Works in Java web ...
     * 3 Ways to Convert an Array to ArrayList in Java? E...
     * Difference between LEFT and RIGHT OUTER Joins in S...
     * Difference Between Linked List and Array in Java? ...
     * When to Make a Method Static in Java? Example
     * Different Types of JDBC Drivers in Java - Quick Ov...
     * Difference between ClassNotFoundException vs NoCla...
     * Why Enum Singleton are better in Java? Examples
     * Builder Design pattern in Java - Example Tutorial
     * 5 Coding Tips for Improving Performance of Java ap...
     * Difference between repaint and revalidate method i...
     * How to Count number of Set bits or 1's of Integer ...
     * When a class is loaded and initialized in JVM - Ja...
     * How to Add Two Integer Numbers without using Plus ...
     * Java ArrayList and HashMap Performance Improvement...
     * Is Swing Thread Safe in Java? Answer
     * Invalid initial and maximum heap size in JVM - How...
     * How to Close Java Program or Swing Application wit...
     * How to Check if Integer Number is Power of Two in ...
     * InvokeLater and InvokeAndWait in Java Swing (an ex...
     * How to Use Break, Continue, and Label in Loop in ...
     * 10 Examples of HotSpot JVM Options in Java
     * Difference between Sun (Oracle) JVM and IBM JVM?
     * How to Generate MD5 checksum for Files in Java? Ex...
     * How to find CPU and Memory used by Java process in...
     * 10 XSLT or XML, XSL Transformation Interview Quest...
     * How ClassLoader Works in Java? Example
     * 3 ways to solve java.lang.NoClassDefFoundError in ...
     * 20 Design Patterns and Software Design Interview Q...
     * How to use Comparator and Comparable in Java? With...
     * 10 Interview Questions on Java Generics for Progra...
     * What is -XX:+UseCompressedOops in 64 bit JVM? Example
     * Top 10 Garbage Collection Interview Questions and ...
     * What is Class File and Byte Code in Java? Example
     * Top 10 Java Swing Interview Questions Answers aske...
     * How to compare two lists of values in Microsoft Ex...
     * Difference between JVM, JIR, JRE, and JDK in Java?...
     * How to reload/refresh a page using JavaScript and ...
     * How to increase Heap memory of Apache Tomcat Serve...
     * How many characters allowed on VARCHAR(n) columns ...
     * What is bounded and unbounded wildcards in Generic...
     * How to Split String based on delimiter in Java? Ex...
     * Difference between Right shift and Unsigned right ...
     * What is the maximum Heap Size of 32 bit or 64-bit ...
     * How to Replace Line Breaks , New Lines From String...
     * How to Convert Byte Array to InputStream and Outpu...
     * How to Create JUnit Tests in Eclipse and NetBeans ...
     * 10 Articles Every Programmer Must Read
     * What is java.library.path? How to set in Eclipse I...
     * How to add and substract days in current date in J...
     * 10 JDK 7 Features to Revisit, Before You Welcome J...
     * Java Program to find factorial of number in Java -...
     * 7 Examples to Read File into a Byte Array in Java
     * Difference between Connected vs Disconnected RowSe...
     * Difference between Stub and Mock object in Java Un...
     * How to Add Leading Zeros to Integers in Java ? Str...
     * How to Implement Linked List in Java with JUnit Te...
     * Difference between FileInputStream and FileReader ...
     * Top 10 Puzzles, Riddles, Logical, and Lateral Thin...
     * Difference between UTF-8, UTF-16 and UTF-32 Charac...
     * How to Implement Thread in Java with Example
     * Difference between valueOf and parseInt method in ...
     * How to Compare Two Enum in Java? Equals vs == vs C...
     * Difference Between Abstract Class vs Interface in ...
     * What is String args[] Argument in Java Main metho...
     * How to disable JUnit Test - @Ignore annotation Exa...
     * The Ultimate Guide of Generics in Java - Examples
     * Difference between trunk, tags and branches in SVN...
     * How to Check If Number is Even or Odd without usin...
     * How to Convert InputStream to Byte Array in Java -...
     * Java Program to print Prime numbers in Java - Exa...
     * Java Program to Find Sum of Digits in a Number usi...
     * How to compare two XML files in Java - XMLUnit Exa...
     * JAXB Date Format Example using Annotation | Java D...
     * How to convert double to int in Java? Example
     * Does making all fields Final makes the class Immut...
     * Top 10 Tips on Logging in Java - Tutorial
     * How to Setup Java Remote Debugging in Eclipse - St...
     * How to Find First and Last element in LinkedList J...
     * Difference Between java and javaw Commands from JDK
     * Java Program to connect Oracle Database with Examp...
     * Difference between ValidatorForm vs ValidatorActio...
     * 10 points about Java Heap Space or Java Heap Memory
     * Top 12 Apache Web Server Interview Questions Answe...
     * What is interface in Java with Example - Tutorial
     * String replaceAll() example - How to replace all c...
     * Java Program to Reverse an Integer Number - Exampl...
     * How to Measure Elapsed Execution Time in Java - Sp...
   * ►  June (5)
   * ►  May (7)
   * ►  April (15)
   * ►  March (17)
   * ►  February (8)
   * ►  January (6)

 * ►  2020 (96)
   * ►  December (13)
   * ►  November (10)
   * ►  October (7)
   * ►  September (4)
   * ►  August (5)
   * ►  July (8)
   * ►  June (2)
   * ►  May (8)
   * ►  April (20)
   * ►  March (11)
   * ►  February (8)

 * ►  2019 (24)
   * ►  December (3)
   * ►  November (6)
   * ►  October (4)
   * ►  August (1)
   * ►  July (2)
   * ►  June (2)
   * ►  May (1)
   * ►  April (2)
   * ►  February (1)
   * ►  January (2)

 * ►  2018 (5)
   * ►  September (1)
   * ►  August (1)
   * ►  July (2)
   * ►  June (1)

 * ►  2017 (22)
   * ►  December (2)
   * ►  November (2)
   * ►  October (4)
   * ►  September (2)
   * ►  July (3)
   * ►  June (5)
   * ►  May (3)
   * ►  April (1)




TRANSLATE THIS BLOG


  Powered by Google Übersetzer



REFERENCES

 1. Oracle's Java Tech Network
 2. jQuery Documentation
 3. Microsoft SQL Server Documentation
 4. Java SE 8 API Documentation
 5. Spring Documentation
 6. Oracle's JAva Certification
 7. Spring Security 5 Documentation




PAGES

 * Privacy Policy
 * Terms and Conditions


Copyright by Javin Paul 2010-2021. Powered by Blogger.






Diese Website verwendet Cookies von Google, um Dienste anzubieten und Zugriffe
zu analysieren. Deine IP-Adresse und dein User-Agent werden zusammen mit
Messwerten zur Leistung und Sicherheit für Google freigegeben. So können
Nutzungsstatistiken generiert, Missbrauchsfälle erkannt und behoben und die
Qualität des Dienstes gewährleistet werden.Weitere InformationenOk


ORIGINALTEXT


Bessere Übersetzung vorschlagen

--------------------------------------------------------------------------------




×
Java Design Patterns and Architecture (FREE Course)
Yes, PleaseNo, Thanks

AddThis

Show
AddThis What's Next
Recommended for you
Top 50 Java Programs from Coding Interviews
javarevisited.blogspot.com

AddThis
Hide