Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » sempiternal HelloWorld(can't run the basic HelloWorld)
sempiternal HelloWorld [message #897014] Fri, 20 July 2012 18:54 Go to next message
d. grens is currently offline d. grensFriend
Messages: 2
Registered: July 2012
Junior Member
Hi
I've been using eclipse CDT for years I must now switch to java and installed the JDT version on Juno.
I first did a check with a classical HelloWorld program which works fine on my linux console

When I try to compile and run on eclipse I've got the error in the Problems window:
Archive for required library: '/usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre/lib/ext/gnome-java-bridge.jar' in project 'Hello World' cannot be read or is not a valid ZIP file Hello World Build path Build Path Problem

and if I run it nevertheless I've got on the console window:


Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld
Caused by: java.lang.ClassNotFoundException: HelloWorld
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
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: HelloWorld. Program will exit.

I'm new in java and I'm pretty sure it's something about the launch or(and) build configuration but the configuration options in JDT seems to me numerous and cryptic

When I followed for example the instructions from:
www.cis.upenn.edu/~matuszek/cit591-2004/Pages/starting-eclipse.html
to create a launch configuration it still gives me the exact same errors

the HelloWorld compiles and works fine within a linux shell console so it should not be a true error with the .jar file being invalid

Can anybody explain me my probably obvious newbee error ?

Thanks

Re: sempiternal HelloWorld [message #897018 is a reply to message #897014] Fri, 20 July 2012 19:06 Go to previous messageGo to next message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
It looks like you installed something that put a Java extension in your jdk. The gnome-java-bridge.jar isn't a normal jar included in a JDK installation. Eclipse must have picked it up because it is in the lib/ext folder.

You can try removing it from the jre configuration. Go to Window->Preferences->Java->Installed JREs. Select the JRE you are using and edit it. Remove the entry for gnome-java-bridge.jar.
Re: sempiternal HelloWorld [message #897125 is a reply to message #897018] Sun, 22 July 2012 07:08 Go to previous message
d. grens is currently offline d. grensFriend
Messages: 2
Registered: July 2012
Junior Member
I started to dig around the .jar problem

and it was in fact a bug of openjdk on some linux-opensuse systems:
the
/usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre/lib/ext/gnome-java-bridge.jar
must be present on the system but in this release it is read forbidden for anybody but root (???)
just changing it's mode to rwx-r--r-- solved it

Thanks for the hint, it was trully a jar pb

PS: But I still don't understand why javac HelloWorld.java + java HelloWorld works and eclipse didn't want to compile run the same program ?



Previous Topic:Downloaded Juno package but after install and running it says it is Indigo
Next Topic:Change Log for Eclipse
Goto Forum:
  


Current Time: Sat Apr 27 01:08:08 GMT 2024

Powered by FUDForum. Page generated in 0.08139 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top