Help Needed With JDK Install - IDEs, Libraries, & Programming Tools

I'm just starting in my attempt to develop apps for Android, and am starting by learning Java. I have downloaded the Headfirst Java textbook along with JDK and Eclipse. However, I can still not open the .class and .java extension files needed for the textbook. Perhaps I did something wrong? What exactly is supposed to open those files? I am running Windows 8 and have not figured this out. Any help would be appreciated, thanks!

Imnice777 said:
I'm just starting in my attempt to develop apps for Android, and am starting by learning Java. I have downloaded the Headfirst Java textbook along with JDK and Eclipse. However, I can still not open the .class and .java extension files needed for the textbook. Perhaps I did something wrong? What exactly is supposed to open those files? I am running Windows 8 and have not figured this out. Any help would be appreciated, thanks!
Click to expand...
Click to collapse
.class is a compiled executable, just like exe why you need to see the content of it, .class is meant to be executed. just do java <yourclass_name> and press enter. in CMD prompt. it will run.
as you said you had installed eclipse/JDK?, then to open java file it is an editor.
Are you facing anything else ?
Amit

Eclipse can be kinda funky if you haven't got your classpath set up correctly. Try installing Intellij IDEA and opening the .java files in that, compiling then running.

If you have a hard time installing JDK
Try goormIDE
You can easily build a development environment with a cloud IDE service that provides docker-based containers.

Related

Java Midlet Question

I really want to use a name picker (randomly picks a name from a pre-defined list)
Google reveals this java version is exactly what I need for a desktop
Is there any way I can use it on the pocket pc (does not work in midlet manager)
http://www.davebsoft.com/jaws/apps/namepicker.jnlp
You normally need a jar version of the program to work with midlet manager - best you do a search for a jar version.
The author kindly sent me his JAR file for this app. I have placed it onto my device but cannot open it
Is it incompatable or am I making a silly mistake
Thanks
Hays
Is that the zip he sent you or did you send you a jar file? Even when i rename it namepicker.jar it wont install, i am sure there is something wrong with the file.
Is that the zip he sent you or did he send you a jar file? Even when i rename it namepicker.jar it wont install, i am sure there is something wrong with the file.
he sent this text in his email
The jar file is here, but it probably isn't set up the way you need it:
http://davebsoft.com/jaws/apps/lib/namepicker.jar
I downloaded it but can't get it working
yep - still says invalid - contact the author again he must have a valid jar that works
will do
thanks for your help
the author replied
"invalid" in what context? It's valid in the context in which you've been
running it on your PC or whatever. Maybe it lacks a manifest file or
something. There are free tool to extract and rebuild jar files.
The message it gives is that it has an 'invalid java application desciptor' i.e. the jad part of the jar is wrong.
just a guess, but its probably made for jave for desktops, not j2me.
OMG. The Java that is written is for PC (or eqv) Java not for Java for phone (eg. midlet). That's why it doesn't run. Midlet is a very small subset of the real Java, the code is different, and there isn't much function in midlet version of java, and it is a pain to program in midlet-java (whatever you call it). Hence the JAR is not working. Try running it on your PC, it will work.
No, you can't extract it and run it on your midlet-enabled phone. No, even if you have the source, you can't do that either, unless you translate the code manually. I don't think there is a converter for that matter, especially it involved GUI.
That explains it
Anyone up for the challenge of writing a good pocket pc version ??
Hays
Try this one...
This is an OSS JVM that's meant to be J2SE compliant so it might just run. Try your luck.

SlimServer Client developement - HELP NEEDED with XML

Hi there...
I have embarked upon the developement of a slimserver client for the pocket pc using c#. There is no decent one around that I know of!
Anyway, it is going to be open sourced, and I have already implemented the use of the CLI interface. however, I am a bit stuck with the XML one. I have attached the relevant sources! The problem is that when it runs through the emulator, it is unable to deserialise a slimserver xml file and returns a NotSupported Exception (I have attached a sample xml file). I generated a c# class library for slimserver's xml schema using xsd.exe.
The funny thing is that when I run the compiled .exe file in windows (without the emulator), it runs smoothly, and deserialises it perfectly! It also works when compiled for a normal desktop application!
Could someone help please?

WM6: start Java app from C++ app?

Hello,
I'm currently in the need to code a C++ app under Windows Mobile 6 that starts an installed Java app. I already hoped that call system("java java_app") might work, but my C++ compiler (VS 2005) does not even know system() function. And I don't think it would work this way: to install a Java app, I start a .jar file, and then, I can start the app manually via start menu under Start -> Program Files -> Tools -> Java, where I can select from all installed Java apps, and obviously, the installation does not create .jar or. class files anywhere in the file system. The Java runtime environment on my phone (HTC Diamond) is an Esmertec Jbed.
Thanks for any help.
As far as I could find out, Java apps under Jbed JVM can be started from command line by
\windows\jbed.exe -run sX_
where X=0,1,2,3,... ist the index of the desired app in the list of installed Java apps. So, Java app can be started from C++ programm using ShellExecuteEx(), filling the lpFile member of the SHELLEXECUTEINFO parameter with "\\windows\\jbed.exe" and lpParameters member with "-run sX_".
Very nice, so far, however, there are two troubles remaining:
- the index X of the desired Java app depends on the sequence, in which the Java apps have been installed
- the Java midlets have a hierarchical structure. A midlet might contain several sub-midlets, but only the highest-level midlets are accessable by the s-index
Well, I think the hierarchical structure is a solvable problem, the desired midlet can be installed as a top-level midlet. But still the index problem. Is there maybe a registry entry that maps midlets to indices?
I found the solution!
Jbed stores for each installed midlet a sX_.jah, sX_.obj and a sX_suite.utf file in \windows\appdb folder. The .jah and .obj are binary files, but the .utf files are readable text files that contain some information of the corresponding midlet, that enables one to identify midlet from index X. So, all I need to do in my C++ app is to open the .utf files subsequently and to check if I find the information that identifies the desired midlet.

Applet support?

Hi,
I know HTC supports java. With regard to that, I have some questions/doubts.
1. Whether the HTC supports Applet, in other word the IE/Opera/Skyfire browser supports applet? Since many of the banking application I am using is having the logon in applet and it's not loadind in opera. Any idea how to achieve it?
2. I have installed Mysaifu JVM which will run the java program. So it accepts .class file or .jar file. I need to compile it in my phone. How can I do it?
For example: I will write my own java file(.java). I need a compiler to compile the .java to .class file.

NoClassDefFoundError

hi,
i' trying to use an external library in my android sourcecode, but i fail at executing after successful compiling with a "NoClassDefFoundError"
i set the CLASSPATH to the external JAR File i want to use, and imported that jar file as a library, but still the same error.
what is missing, or where am i wrong?
please help
Agassiz said:
i set the CLASSPATH to the external JAR File
Click to expand...
Click to collapse
And how do you do that? As far as I know Java does not have an API to modify CLASSPATH at runtime.
oh i forgot to mention, that i use Eclipse to code android apps
ok after adding a JAR file into my project (not a library - like i did before), the time to build the workspace takes a very long time... everytime i type ctrl+s for saving even one new character, the workspace is being rebuilt, that takes about 5 to 10 seconds... thats really annoying...
Agassiz said:
hi,
i' trying to use an external library in my android sourcecode, but i fail at executing after successful compiling with a "NoClassDefFoundError"
i set the CLASSPATH to the external JAR File i want to use, and imported that jar file as a library, but still the same error.
what is missing, or where am i wrong?
please help
Click to expand...
Click to collapse
Copy the jar you are using into a folder in your project, such as assets.
In eclipse:
right click on your project.
Go to properties.
Click on java build path.
Click on the libraries tab
Click add JAR
Select your JAR and press ok. press ok to exit the project properties.
Your application should now find the class you are looking for.
corruptor64 said:
Copy the jar you are using into a folder in your project, such as assets.
In eclipse:
right click on your project.
Go to properties.
Click on java build path.
Click on the libraries tab
Click add JAR
Select your JAR and press ok. press ok to exit the project properties.
Your application should now find the class you are looking for.
Click to expand...
Click to collapse
hey thanks a lot this worked out.
but eclipse is very slow now. if i remove the JAR file it runs fast like always... the jar file's size is just 3,6MB :/

Categories

Resources