Java with package compilation run

Source: Internet
Author: User

Package Cn.togeek.job;public class Test {public   static void Main (string[] args) throws Exception {      System.out.pr Intln ("hello,world!");}   }

1 javac Test.java

Operating normally

Then run

Java Test

Will error

1 At Java.lang.ClassLoader.defineClass1 (Native Method)2 At Java.lang.ClassLoader.defineClass (Unknown Source)3 At Java.security.SecureClassLoader.defineClass (Unknown Source)4 At Java.net.URLClassLoader.defineClass (Unknown Source)5At java.net.urlclassloader.access$100(Unknown Source)6At java.net.urlclassloader$1. Run (Unknown Source)7At java.net.urlclassloader$1. Run (Unknown Source)8 At java.security.AccessController.doPrivileged (Native Method)9 At Java.net.URLClassLoader.findClass (Unknown Source)Ten At Java.lang.ClassLoader.loadClass (Unknown Source) One At Sun.misc.launcher$appclassloader.loadclass (Unknown Source) A At Java.lang.ClassLoader.loadClass (Unknown Source) -At Sun.launcher.LauncherHelper.checkAndLoadMain (Unknown Source)

This time:

.. /.. /..

And then run, OK, okay.

It's OK to run like this.

E:\SRC>JAVA-CP./main/java/cn.togeek.job.testhello,world!

In
E:\SRC>JAVA-CP e:/src/main/java/cn.togeek.job.testhello,world!


This will work in all folders!

  

Java with package compilation run

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.