[Bluej-discuss] 7.47 creating jars - linux problem
ric104
ric104 at ecs.soton.ac.uk
Wed Nov 22 22:20:36 GMT 2006
Thanks Brian
Yeah it was the main method not being right. I have two versions of java on my Linux and that doesnt help, but I like to make life challenging for myself.
Thanks again
Roland
On Wed, 22 Nov 2006 15:12:03 -0500, "Bryan J. Higgs" <bhiggs at rivier.edu> wrote:
> First, make sure that your java really is the proper version. Type in
> the following:
>
> java -version
>
>
> The first line of the output should tell you the version of Java you're
> running. Here's what my Java 1.5 version (on Microsoft Windows XP)
> outputs in response to the above command:
>
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode)
>
>
> I suspect that you'll probably find that your version is less than 1.5.
> If that's true, then you need to fix your path to point to the proper
> Java version's bin directory.
>
> Regarding the second problem:
>
> * Since you appear to be running on U/Linux, try using:
>
> ./java -jar /home/icedearth/test.jar
>
>
> to ensure that you're really running the java that is in that
> (current working) directory
>
> * It looks like you might have a main class specified, but you may
> not have the correct set of prerequisites
> 1. The class must be a *public *class
> 2. The signature of the main method must be:
>
> *public static void main(String[] args)*
>
>
> If you omit any of these items, Java won't recognize you main as
> a real main entry point.
> A common mistake is to omit the static keyword. Another is to
> omit the public keyword.
>
> I hope that helps!
>
> Bryan
>
> ric104 wrote:
>> Thanks for that, I solved it by running BlueJ as root
>>
>> The problem Im haivng now is when i run "java -jar whatever.jar" I am
> getting the following message:
>>
>> Exception in thread "main" java.lang.UnsupportedClassVersionError: Game
> (Unsupported major.minor version 49.0)
>> at java.lang.ClassLoader.defineClass0(Native Method)
>> at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
>> at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
>> at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
>> at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
>> at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
>> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
>> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
>>
>> Ouch!
>>
>> And here is what is says when I actually use java 5
>>
>> root at icedearth[/usr/lib/jvm/java-1.5.0-sun/bin]# java -jar
> /home/icedearth/test.jar
>> no suitable method `main' in class
>> root at icedearth[/usr/lib/jvm/java-1.5.0-sun/bin]#
>>
>> I have checked that main exists and run it in BlueJ ok, any ideas?
>>
>> Thanks
>>
>> Roland
>>
>>
>>
>>
>> On Tue, 21 Nov 2006 20:49:03 -0500, "Josh Rountree"
> <mage at carolina.rr.com> wrote:
>>
>>> Sounds like you need to add execute to the directory you are saving
> too,
>>> that will allow it to be opened.
>>>
>>> -----Original Message-----
>>> From: bluej-discuss-bounces at bluej.org
>>> [mailto:bluej-discuss-bounces at bluej.org] On Behalf Of ric104
>>> Sent: Tuesday, November 21, 2006 5:16 PM
>>> To: General discussion for users of BlueJ
>>> Subject: [Bluej-discuss] 7.47 creating jars - linux problem
>>>
>>> Hi
>>>
>>> I am using BlueJ with Debian Sarge, but everytime I try to save or
> create
>>> a
>>> jar i get the message:
>>> The jar file could not be written (check the file system for access
> rights
>>> and disk space availability)
>>>
>>> I have given the bluej directory and bluej.sh read write and execute
>>> rights
>>> and made the directory I am saving in read and write for everyone, but
>>> still
>>> i have this problem. I dont seem to have this problem with any other
> app
>>> similar to blue j (i.e run from a .sh, as Google Earth works fine)
>>>
>>> Has anyone else had these probs in LInux, its creating the jar manifest
>>> file
>>> and thats it. very odd.
>>>
>>> Thanks
>>>
>>> Roland Clothier
>>> 2nd Year ITO Student
>>> University of Southampton
>>>
>>> _______________________________________________
>>> mailing list bluej-discuss at bluej.org
>>> To unsubscribe or change your preferences, go to
>>> http://lists.bluej.org/mailman/listinfo/bluej-discuss
>>>
>>> --
>>> No virus found in this incoming message.
>>> Checked by AVG Free Edition.
>>> Version: 7.1.409 / Virus Database: 268.14.11/543 - Release Date:
>>> 11/20/2006
>>>
>>>
>>> --
>>> No virus found in this outgoing message.
>>> Checked by AVG Free Edition.
>>> Version: 7.1.409 / Virus Database: 268.14.11/543 - Release Date:
>>> 11/20/2006
>>>
>>>
>>> _______________________________________________
>>> mailing list bluej-discuss at bluej.org
>>> To unsubscribe or change your preferences, go to
>>> http://lists.bluej.org/mailman/listinfo/bluej-discuss
>>>
>>
>> _______________________________________________
>> mailing list bluej-discuss at bluej.org
>> To unsubscribe or change your preferences, go to
>> http://lists.bluej.org/mailman/listinfo/bluej-discuss
>>
> _______________________________________________
> mailing list bluej-discuss at bluej.org
> To unsubscribe or change your preferences, go to
> http://lists.bluej.org/mailman/listinfo/bluej-discuss
More information about the bluej-discuss
mailing list