关于命令行上执行java命令的错误分析 - Could not find or load main class+机器学习

http://blog.csdn.net/xyz0330/article/details/39639723

java源程序中package设置不当会导致无法运行class文件的错误

1. 在java源文件开头没有包声明语句 package your_package; 
D:\jtest> javac J_Hello.java

D:\jtest> java J_Hello
Hello, the Java world!

2. 在java源文件开头有包声明语句 package your_package; 
D:\jtest>javac J_Hello1.java

D:\jtest>java J_Hello1
Error: Could not find or load main class J_Hello1

错误原因:
编译含有包声明语句的java源程序文件的格式是:
    javac -d your_path your_class.java
此命令能在 your_path/your_package/ 下生成 your_class.class。

上面的命令中没有-d选项,javac会在当前目录下生成J_Hello1.class(没有报错)。
但是执行java命令,会因为找不到class而出错。

解决方法:
1. 在当前目录下手工创建com/mypkg/test目录,将移动J_Hello1.class到该目录下。
2. 用 javac -d . J_Hello1.java 编译,将直接生成./com/mypkg/test/J_Hello1.class。 
D:\jtest>javac -d . J_Hello1.java


D:\jtest>Java com.mypkg.test.J_Hello1

Hello, the Java world!


以下是实例程序:

[java]  view plain  copy
  1. // J_Hello.java  
  2. public class J_Hello {  
  3.     public static void main(String[] args) {  
  4.         System.out.println("Hello, the Java world!");  
  5.     }  
  6. }  

[java]  view plain  copy
  1. // J_Hello1.java  
  2. package com.mypkg.test;   
  3.   
  4. public class J_Hello1 {  
  5.     public static void main(String[] args) {  
  6.         System.out.println("Hello, the Java world!");  
  7.     }  
  8. }  

机器学习(凑数)

What is Machine Learning?

"A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E."

Example: playing checkers.

E = the experience of playing many games of checkers

T = the task of playing checkers.

P = the probability that the program will win the next game.

监督式学习:

     we are given a data set and already know what our correct output should look like, having the idea that there is a relationship between the input and the output.

"regression"

    we are trying to predict results within a continuous output, meaning that we are trying to map input variables to some continuous function    

"classification" 

    we are instead trying to predict results in a discrete output. In other words, we are trying to map input variables into discrete categories.

attributes:  

    如果输入数据的维数(特征)非常多甚至无限维,后面可以用支持向量机来解决

Unsupervised Learning:

    数据集无标签
    聚类问题(细分市场,社交网络的划分等等)、鸡尾酒问题(从2个混叠的话筒中分辨出音乐和说话声)

    Clustering: Take a collection of 1,000,000 different genes, and find a way to automatically group these genes into groups that are somehow similar or related by different variables, such as lifespan, location, roles, and so on.

    Non-clustering: The "Cocktail Party Algorithm", allows you to find structure in a chaotic environment. (i.e. identifying individual voices and music from a mesh of sounds at a cocktail party).



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值