Win a copy of Terraform in Action this week in the Cloud forum!

Ed Dablin

Ranch Hand
+ Follow
since Oct 09, 2012
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ed Dablin

How do I do the following (alternatively, what do I need to learn to do the following):
I've written a Java app that asks for you name and replies "Hello, name".
How do I host this on the internet?
For example, do I ftp the class and expect my hosting company to run it on their JVM?
Or do I upload the source code and compile it on the server?
Or do I need to learn a new technology like servlets and JSP?
When I try to find simple answers on forums, I get lost in a maze of Tomcats, Apaches, Ajaxs and stuff I don't know about.
I am not looking for a detailed explanation, just a simple roadmap of what I have to do next
8 years ago

Paul Clapham wrote:Well, frankly just the idea of running a hosted application which isn't a web application is in itself unusual. That's not to say that such applications are nonexistent, just that they are uncommon.

OK I've check with my ISP and my question has thrown them into a state of confusion and talk of big bucks. So I guess the Head First Java chapter 15 *Daily Advice Server* is not the basis for a larger app.
Searching around, I have come across Java Servlets and Java Server Pages. If I want to develop an implement a server based application that can be hosted on the internet and used by other people, should I learn more about servlets and JSPs? Feeling a bit lost here and wouold appreciate a pointer which way to go in my education
8 years ago
I guess I'm asking: does my question make sense? Do you guys routinely run your java non-HTML apps on hosted sites or am I asking something unusual?
8 years ago
Hi. I've just started to learn about sockets, serversockets and establishing a simple server using stream sockets.
I have a very simple server and client application working on my LAN between my iMac and PC. So far so good.
I now want to put my server on the WAN i.e. the internet.
My question is, will an internet hosting company allow my java server app to open a socket? Do I need to ask for a special kind of access?
I don't want to sign up to a hosting deal to find out they only permit web pages, emails and FTP.
By the way, hosting on my company's server doesn't work due to security restrictions.
8 years ago
I don't know the reason why, but I feel uncomfortable instantiating the class containing the main method, as in this example:

It feels more natural to keep the main method in one class, and create a second class for the purpose of instantiation.
For example:

Either method works. Is there a reason to prefer one over the other?
Should I just learn to get over it?
9 years ago

fred rosenberger wrote:

Ed Dablin wrote:I'm finding that 90 percent of the problems I face as a java beginner are related to the programming environment.
For example, learning the quirks of the IDE (Eclipse in my case)...

Which is why most folk around here recommend beginners DON'T USE an IDE.

Fred, I think you are right. I think it is easier to learn using javac.exe and java.exe with, say, Notepass++ or Textwrangler, in the Command/Terminal window environment. Others may think otherwise....
9 years ago
I'm finding that 90 percent of the problems I face as a java beginner are related to the programming environment.
For example, learning the quirks of the IDE (Eclipse in my case), which today locked me out of all my projects in project explorer, and I still don't know why.
Then there are the mysteries of classpaths etcetera when operating in the JDK command line version.
These environmental issues can take up a whole day when you're learning on your own.
It is normally impossible to explain these issues on a forum - you need to be there to see for yourself!
In comparison, the actual coding is the easy bit.
Just a thought and a grumble. Now back to work...

9 years ago
Can I ask the senior members of this forum what are the most common pitfalls in Java programming for beginners.
Perhaps Scanner should be on the list. What else?
9 years ago
Say you find an external class library that you like, and will want to use over and over.
I know you can add the jar files to each new project manually, but that is a lot of repetition.
Can you add them to Eclipse so that they will be available to any new project automatically, so you only have to type an import statement?
I've added some external jar files to my Eclipse java project. I put them in a lib sub-folder of my project.
They are:
I have added them to the build.
It seems to work OK because the following line does not generate an error
(By the way, it took a lot of trial-and-error to figure out the correct import statement - how one is supposed to know the syntax?)

Anyhow, my question is, how do I open the javadoc file joda-time-2.1-javadoc.jar?
Ideally, I would like to be able to access the javadoc using Help>Dynamic Help
9 years ago
Thanks all! Marked as resolved
9 years ago
I'm running this:

and Eclipse console gives answer as 1471228928
But my calculator says the answer is 31536000000
I thought I might have exceeded the max long value. But Oracle says:

The long data type is a 64-bit signed two's complement integer. It has a minimum value of -9,223,372,036,854,775,808 and a maximum value of 9,223,372,036,854,775,807 (inclusive).

Obviously I am doing something very, very stupid. But what?
9 years ago
OK I've managed to get JavaMail to work with Gmail. I can send and receive emails.
I've failed to get Hotmail to work.
Thanks for the comment about SMS Gateways. I have one in mind, but would be pleased to hear from anyone who has succeeded
in sending and receiving SMS text messages from their Java programs.
9 years ago
What is the easiest / simplest way to connect my java program to the world?
Simply put, my program takes a little user input, and returns the answer.
I would now like to make my program available to others.
In order of preference:
1. User sends SMS text and gets back an SMS text (not everyone owns a computer or smart phone)
2. User send email and gets back an email
3. User interacts via web browser. Does this necessitate converting my program to a servlet?

9 years ago