Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
关于deepin内安装openjdk的问题
Apps Section
6106
views ·
3
replies ·
To
floor
Go
wy2325
deepin
2012-04-26 16:47
Author
由于目前学习java,需要安装jdk。刚开始的时候我使用深度软件中心安装opendjk,可是却卡住了。事实上一直到现在我的深度软件中心还是坏的。不管安装还是卸载,全都是无限等待。使用终端安装卸载却都没问题。
回到正题,使用软件中心未果,于是我转而使用命令进行安装,这次倒没什么问题了,不过使用java编译的时候死活报错。首先,代码是肯定没问题的,我在eclipse中和windows下编译运行都没错,在deepin里却报错了,错误如下:
wy@Deepin11:/media/Work/code/Schedule$ java Priority
Exception in thread "main" java.lang.UnsupportedClassVersionError: Priority : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: Priority. Program will exit.
Copy the Code
我之前安装的是openjdk-6-jdk,我以为是安装错误,使用“java -version“显示的版本如下:
wy@Deepin11:/media/Work/code/Schedule$ java -version
java version "1.6.0_23"
OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre11-0ubuntu1.11.10.2)
OpenJDK Server VM (build 20.0-b11, mixed mode)
Copy the Code
于是我又通过“sudo apt-get install openjdk-7-jdk”安装了openjdk7的jdk和jre,可是安装完后查询版本号还是“java version "1.6.0_23"”跟上面显示的一模一样。
求大牛解答……
Reply
Like 0
Favorite
View the author
All Replies
FEI17
deepin
2012-04-26 22:17
#1
先用purg卸载 然后再装新版本试试?
Reply
Like 0
View the author
EvilBeast
deepin
2012-04-26 22:24
#2
找他 --》小白旗(707519239)(五彩书生) DBbuilder作者 Java开发的
Reply
Like 0
View the author
wy2325
deepin
2012-04-27 03:03
#3
问题解决了,确定是openjdk6的问题,我安装openjdk-7-jdk后,通过命令
update-alternatives --config java
Copy the Code
更改了环境变量,之后openjdk7很好用。
Reply
Like 0
View the author
Please
sign
in first
Featured Collection
Change
UOS AI 2.8 Released! Three New Intelligent Agents & Major Evolution
Solid Q&A | deepin 25 Common Questions – The Immutable System Edition
New Thread
Popular Ranking
Change
Bright is not working on deepin25, it is stuck
Nvidia Drivers in Fresh installed V25.0.10 with Secure Boot on.
Popular Events
More
回到正题,使用软件中心未果,于是我转而使用命令进行安装,这次倒没什么问题了,不过使用java编译的时候死活报错。首先,代码是肯定没问题的,我在eclipse中和windows下编译运行都没错,在deepin里却报错了,错误如下:
求大牛解答……