由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - one java question under ubuntu
相关主题
Interview的人问我最新java 版本是多少htmlunit中的classpath问题,总是找不到package
type erasure weird problemgenerics这样改对马?
现在做JAVA开发的用什么系统可靠点啊?scala - I 服了 U
Ant problem菜鸟问关于Java Programming的问题
ant javac error in eclipse 3.0?Re: 新生上路
How big is the penalty for compile with debugging mode on?faint, unreachable statement in java
也问一个Eclipse的问题JBuilder question
Debian+Eclipse Indigohelp "java.lang.NoSuchMethodError"
相关话题的讨论汇总
话题: javac话题: java话题: openjdk话题: when话题: ubuntu
进入Java版参与讨论
1 (共1页)
f******e
发帖数: 582
1
I am using ubuntu and I try to compile a .java program which has generics,
like “Stack mydata”. When I compile, I got errors like
“generics are not supported..”
When I type “javac –version”, it has “javac 1.6.0_24”. Is this the new
version of javac?
I notice that openjdk-6-jak has been installed. Openjdk-7-jdk is available.
However, when I run “apt-get install openjdk-7-jdk”, it cannot find the
package.
What is wrong? Is it something wrong with my javac? Thanks a lot.
e*****t
发帖数: 1005
2
I think so. Generics is added in java 5. So java 6 has it and if you don't
specify java source version, it should be 6 by default.
double check if you set the source level to be 1.4

new
.

【在 f******e 的大作中提到】
: I am using ubuntu and I try to compile a .java program which has generics,
: like “Stack mydata”. When I compile, I got errors like
: “generics are not supported..”
: When I type “javac –version”, it has “javac 1.6.0_24”. Is this the new
: version of javac?
: I notice that openjdk-6-jak has been installed. Openjdk-7-jdk is available.
: However, when I run “apt-get install openjdk-7-jdk”, it cannot find the
: package.
: What is wrong? Is it something wrong with my javac? Thanks a lot.

u****s
发帖数: 2186
3
exploit is right.
try
which -a javac
to see if any alias set for javac that has -source -target options set

【在 e*****t 的大作中提到】
: I think so. Generics is added in java 5. So java 6 has it and if you don't
: specify java source version, it should be 6 by default.
: double check if you set the source level to be 1.4
:
: new
: .

f*******n
发帖数: 12623
4
also, Stack is illegal. int is not a reference type. Only reference
types can go in < >
b******y
发帖数: 9224
5
估计楼主的设置的路径不对?我一般在ubuntu下的.bashrc文件里这样设置path, 比如
说:
export PATH=/root/jdk1.6.0_22/bin:$PATH
export JAVA_HOME=/root/jdk1.6.0_22
f******e
发帖数: 582
6
Thanks for the reply.
I solved the problem, but I do not why. This is what I do: in the Makefile,
I remove the "-source 1.4" which is used by javac. Then the compile goes on
well.
what is the usage of "-source 1.4"? Thanks.
T****U
发帖数: 3344
7
it forces compiler to user java 1.4 instead of current 1.6/1.7 version.

,
on

【在 f******e 的大作中提到】
: Thanks for the reply.
: I solved the problem, but I do not why. This is what I do: in the Makefile,
: I remove the "-source 1.4" which is used by javac. Then the compile goes on
: well.
: what is the usage of "-source 1.4"? Thanks.

e*****t
发帖数: 1005
8
makefile?
这个你还是得多看看java的基本东西。

,
on

【在 f******e 的大作中提到】
: Thanks for the reply.
: I solved the problem, but I do not why. This is what I do: in the Makefile,
: I remove the "-source 1.4" which is used by javac. Then the compile goes on
: well.
: what is the usage of "-source 1.4"? Thanks.

1 (共1页)
进入Java版参与讨论
相关主题
help "java.lang.NoSuchMethodError"ant javac error in eclipse 3.0?
Question on J2EE containerHow big is the penalty for compile with debugging mode on?
javac compiler也问一个Eclipse的问题
com.sun.tools.javac.Main 问题Debian+Eclipse Indigo
Interview的人问我最新java 版本是多少htmlunit中的classpath问题,总是找不到package
type erasure weird problemgenerics这样改对马?
现在做JAVA开发的用什么系统可靠点啊?scala - I 服了 U
Ant problem菜鸟问关于Java Programming的问题
相关话题的讨论汇总
话题: javac话题: java话题: openjdk话题: when话题: ubuntu