Java is a general-purpose programming language designed to be used in conjunction with Java Virtual Machine (JVM). "Java platform" is the name for computing systems that have installed tools for developing and running Java programs. Use this tag for questions referring to Java programming language ...

learn more… | top users | synonyms (6) | java jobs

0
votes
0answers
5 views

Android HttpUrlConnection “Internal server error” error 500

I'm trying to connect to a local database through .php page on ubuntu with LAMP in my android application, but I keep getting "Internal server error" although it was connecting just fine this morning, ...
0
votes
0answers
4 views

Serving Compiled Scripts on Webserver

I have a webserver running Apache http webserver and it works fine. I can view/download the files I put in the htdocs folder through a web browser. What I want to be able to do is write Java code in ...
2
votes
1answer
11 views

Java Filechooser showMultipleDiaglogue add files in order?

Is there a way select multiple files and have them added to a list in the order that you clicked? I know how to select multiple files, but they usually just get added in alphabetic order.
0
votes
0answers
7 views

What do I need to do to generate classes with *maven-jaxb2-plugin* without manually editing the NAMESPACE in a WSDL?

I'm stuck on a problem with JAX2B marshaling. Here is the error: JAXB unmarshalling exception; nested exception is javax.xml.bind.UnmarshalException: unexpected element (uri:"", ...
0
votes
1answer
36 views

Efficient Data Structure To Store Millions of Records

I have an input file that contains millions of records and each record contains again thousands of columns in which each of the column is separated by a delimiter. Number of records and columns can ...
0
votes
0answers
9 views

Browser navigates to webpage, but I get 500 error when using HttpURLConnection

I need to send a request to a webpage. In the past, I have used HttpURLConnection, and everything worked fine. When I try to do the same thing this time, I get a 500 return code. Usually, this ...
1
vote
0answers
17 views

Java JFrame won't show up after using .setVisible(true) after being invisible

I'll start explaining from the bottom to top, so you will actually understand what I was trying to do, and understand my code better. I am creating a library, that let's you capture an area, whether ...
0
votes
1answer
14 views

Execute Java Code based on list of checkboxes in HTML

I have written two methods that will perform different functions based on the parameter passed to it. In this case, it is an array of checkbox values (Strings). On my .JSP I have said list of ...
0
votes
2answers
14 views

Call a method when fragment is visible to user

I need execute a method when the fragment is visible (to the user). Example: I have 2 buttons (button 1 and button 2) , 2 fragments(fragment 1 and fragment 2) and the method loadImages() inside the ...
0
votes
0answers
4 views

JPA equivalent of Hibernate's join and subselect in mapping

Using Hibernate I can use join to map fields in an entity. -- Example -- If I have the following class: public class Order{ private String orderNum; private String productName; ...
0
votes
0answers
9 views

PythonInterpreter can't find my module

I would like to use my python code through the PythonInterpreter of jython. This is what I did. public static void main(String[] args) { String dataFolder, prepFolder; PythonInterpreter py = ...
0
votes
0answers
22 views

Why must Regex escapes be escaped? [duplicate]

Getting down and dirty with the regex implementation in Java, I spent a good two hours today troubleshooting a regex that was supposed to match consecutive whitespaces, but didn't. After googling and ...
1
vote
2answers
33 views

Convert double to String in Java [duplicate]

I am to convert a double value to a String. double d=12345678.999; String str = String.valueOf(d); or, just plain String str = ""+d; Does it, however in the exponent form-- returning the String ...
0
votes
4answers
16 views

Sharing a variable between many Activities in Android App

I am letting my user login to Facebook, Twitter and G+ on my app. After they log in, I want to know that they are logged in on every activity in my app. I am looking to find a way to find this out on ...
0
votes
0answers
9 views

Unable to serialize generic case classes derived from generic trait

I am using the following code: trait ScanList[E] { sealed trait Event case class Added(item: E) extends Event case class Requeued(item: E) extends Event case class Processed(item: E, at: ...
0
votes
1answer
14 views

Joda Time Interval Not returning what I expect

I have the following program import java.util.*; import java.text.*; import org.joda.time.*; public class ScopeControl { public static Interval getInterval() { DateTime currDate = new ...
0
votes
0answers
11 views

Spring Data JPA BeanCreationException

I used Spring Data JPA to set up my project. I used Spring JavaConfig to do bean configuration as suggested from Spring Data JPA's website: @Configuration @EnableJpaRepositories ...
0
votes
0answers
21 views

How to split and store parts of HL7 message into array jython?

I receive an HL7 message file that looks like: MSH|2131|321|dsaf|321|fdss|43242|gfdsg| PID|432|gfdsgsd|342|grfg|343| PV1|trwr|432423|gfgfds|4243|gfdsgfd| ORC|||F|RE OBR|20140707|fdsadf|423423|fdsas ...
0
votes
0answers
8 views

Access Android NDK App Native Looper

What I'm trying to do: I know that the C++ side of the Android App (Android NDK) is processing all the events that are delivered to it. That works properly. What I'm trying to do is send a message ...
0
votes
0answers
11 views

Wrapping an Android TabActivity inside a FrameLayout

I currently have a class which extends BaseTabActivity. I would like to wrap this class within a Frame I'm using elsewhere in my application - however I'm having a bit of trouble understanding how to ...
0
votes
0answers
12 views

Encode text from Tex file to UTF-8 format

I have .tex file that can have universal encoding types from Latin, Cp...., ISO-...., or UTF-.. or whatsoever. I need to encode this text file to parse the content and then store it to some kind of ...
0
votes
0answers
15 views

Joining tables in hibernate

I have two tables Customer Rate ------------- ----------- res_number product strategy ...
-5
votes
2answers
28 views

How to learn Android Java best pratices

I am trying to get into Android programming in Java for a few months. I learned a lot about how to use APIs, I found a lot of great answers here on Stackoverflow and so on but what I would really like ...
0
votes
5answers
39 views

Java - How to get the index of a given element in an array

I have an array of contacts like so : public class Application { private Scanner input; private Contact[] contacts; private int ArrayNum; public Application() { input = new Scanner(System.in); ...
0
votes
0answers
2 views

Unable to authenticate against ldap server using jboss 6.1 through web application

I am new to ldap and jboss both. I am trying to authenticate users against ldap server. I am using Apache DS for ldap server and JBoss AS 6.1 as app server for same. My web.xml is as follows: { ...
0
votes
0answers
14 views

Java: Reading from a URL produces gibberish

So I've been trying to read the html code from kickass.to(it works fine on other sites) but all I get is some weird gibberish. My code: BufferedReader in = new BufferedReader( new ...
0
votes
0answers
7 views

how to load splash screen dynamically at run time rcp application?

I'm trying to launch two modes of our rcp application, for which we need to change splash screen based on mode i.e., When I'm trying to start application in one mode then a different splash screen, ...
1
vote
1answer
16 views

Why does Java 8 from Netbeans hijack Java 7 running in my browser?

Java 7 is my system default JRE. All of my web browsers are configured to invoke JRE7 on a new instance, as default. Netbeans fires up Java 8 on a new instance, as its 'isolated' default (isolated in ...
0
votes
0answers
11 views

Using List collection makes Hibernate throw stackoverflow error

I have three domain objects, one parent object with two children. The parent object has a many to one relationship with both children, and therefore both children have a collection of parent objects, ...
-1
votes
1answer
54 views

Java: array methods

This code supposedly checks an array of integers for 9's and returns it's frequency but the method is not being recognized. Any help please to make this code work. public static int arrayCount9(int[] ...
3
votes
2answers
74 views

Converting a real string integer (e.g. “thirty five”) to integer

Is there a way to convert an English string representation of an integer (e.g. "one hundred eighty") to an integer? As expected Integer.parseInt("thirty five") threw a NumberFormatException. Is there ...
0
votes
0answers
13 views

Java Login & Register System And Server

I need help with doing a login and register system with a server to my game. I want it to check if the player exists on the server as a txt file and if you register the server saves the player as a ...
0
votes
0answers
5 views

setclasspath.sh doesn't exist in bin folder when tomcat installed with Chef

I installed tomcat6 from opscode cookbook using chef. I don't see setclasspath.sh file in bin folder. Am I missing something ?
1
vote
3answers
41 views

What is busy spin in a multi-threaded environment?

What is "Busy Spin" in multi-threaded environment? How it is useful and how can it be implemented in java in a multi-threaded environment? In what way can it be useful in improving the ...
0
votes
0answers
9 views

Antlr: Could not find or local main class even when it is there

I have an antlr grammar and I have written and listener for it. I am running the latest version of ubuntu. I run the following commands #Generate java -jar antlr-4.1-complete.jar -package pascal -o ...
0
votes
2answers
39 views

cannot be resolved to a variable- Java

I got this error. Exception in thread "main" java.lang.Error: Unresolved compilation problems: rgb2 cannot be resolved to a variable its always the rgb2 array that caused the error. How to solve ...
1
vote
0answers
14 views

Decode Html code to unicode java [duplicate]

I am trying to find a quick way to decode html numbers (not just special characters) and convert them to unicode in Java. For example, I would like to be able to convert "&#1042 ;&#1085 ...
-3
votes
4answers
17 views

Creating a new project without the same classes?

This is most likely a rather simple/stupid question. If I create a new project in eclipse it extends all the classes I have in the previous project. The problem is the project is overloaded with so ...
1
vote
2answers
16 views

Why is Collections.synchronizedSet(HashSet) faster than HashSet for addAll, retainAll, and contains?

I ran a test to find the best concurrent Set implementation for my program, with a non-synchronized HashSet as a control, and ran into an interesting result: the addAll, retainAll, and contains ...
-1
votes
1answer
59 views

NullPointerException on same line no matter how I change code

So I am getting a NullPointerException on the same line of code no matter how I change it. Even if I put a blank line there is still the same error on same line. Has anyone else had this happen? I'm ...
0
votes
1answer
33 views

Java Operator confusion [duplicate]

What is the difference between += and =+ in Java? I tried searching but got no results. How do those two work specifically? Any help will be appreciated!
0
votes
1answer
27 views

failed JUnit test reruns once and stops

My failed Junit test reruns once and stops but i am looking to have it run 3 times. I guess my annotation is screwed in some way. Pls what is the proper format for annotation. Note: I will also ...
0
votes
0answers
7 views

Using CompositeInputFormat - Map-side Join

I am triyng to execute a Map-side Join using CompositeInputFormat. The mapper function is not even called. Below are the two files. FILE A - KEY#VALUE 1#1;1 1#1;2 1#1;3 1#1;5 2#2;2 2#2;2 3#3;2 3#3;3 ...
0
votes
0answers
8 views

HTTP File Upload in REST API with pause/cancel control

I'm working in a REST API to provide file uploads. The problem is that I need to know some way to control incoming bytes from file. In the actual way (code below), I just have control of bytes after ...
0
votes
0answers
13 views

sms send and delivered notify project android

I have a big problem with my project. Basically what my project is designed for: First of all it must be run on old android version, 10 api level.. The app should: take a message from a web service ...
0
votes
1answer
26 views

Getting “java.sql.SQLException: Line contains wrong number of columns” using CsvJDBC

I am using CsvJdbc (it is a JDBC-driver for csv-files) to access a csv-file. But while reading the csv it is throwing the below Exception. java.sql.SQLException: Line contains wrong number of ...
0
votes
2answers
36 views

Super Simple Escape Sequence [Beginner]

I'm trying to replace "C:\FREQ\" with a whitespace. String trimmed = files[i].toString().replace("C:\FREQ\", ""); But eclipse gives an error on the "C:\FREQ\" , saying Invalid escape sequence. What ...
0
votes
1answer
52 views

using interface as a type

I read some Android code in the Fragment's section and trying to figure out the logic behind it. I have an Interface inside my class. I want to based on some conditions, the String value of the ...
0
votes
2answers
20 views

Best technique for saving download list

im trying to develop a download manager for my college project using java. I wanna know the best technique that can be used to save the download list. Im using jtable and abstracttablemodel to display ...
1
vote
1answer
23 views

Why can we have only one constructor with @Inject annotation?

I know the above is mandated by the spec but would like to understand why? What will be the problem(s) if multiple constructors in a class are allowed to have @Inject annotation. I am talking about ...