Questions tagged [java]

Java is an object-oriented language and runtime environment (JRE). Java programs are platform independent, because they are compiled to bytecode and their execution is handled by a Virtual Machine called the Java VM or JVM.

Java is a high-level, platform-independent, object-oriented programming language and runtime environment. The Java language derives much of its syntax from and , but its object model is simpler than that of and it has fewer low-level facilities. Java applications are typically compiled to bytecode (called class files) that can be executed by a Java Virtual Machine (), independent of computer architecture. The manages memory with the help of a garbage collector (see ) in order to handle object removal from memory when not used anymore, as opposed to manually deallocating memory in other languages such as

Java is a general-purpose, concurrent, class-based, language designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA): code that executes on one platform need not be recompiled to run on another. Java is a popular programming language, particularly for web applications, with 10 million reported users. Java was originally developed by James Gosling at Sun Microsystems (which has since merged into Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++, but it has fewer low-level facilities than either of them.

Principles

The Java language was created with the following primary goals:

  1. Simple, object-oriented and familiar.
  2. Robust and secure.
  3. Architecture-neutral and portable.
  4. Execute with high performance.
  5. Interpreted, multi-threaded, and dynamic.
  6. Write once, run anywhere (WORA).

Versions

Notable Java versions, code-names, and release dates include:

JDK 1.0                  (January 23, 1996)
JDK 1.1                  (February 19, 1997)
J2SE 1.2    [Playground] (December 8, 1998)
J2SE 1.3    [Kestrel]    (May 8, 2000)
J2SE 1.4    [Merlin]     (February 6, 2002)
J2SE 5.0    [Tiger]      (September 30, 2004)
Java SE 6   [Mustang]    (December 11, 2006)
Java SE 7   [Dolphin]    (July 28, 2011)

For more codename as release date, visit J2SE Code Names

Whats new in each version of JDK: click here

Java SE 8 is expected in the summer of 2013 and is available as an Early Access Download.

The End Of Public Updates (Formerly called End Of Life) are:

J2SE 1.4   -  Oct 2008
J2SE 5.0   -  Oct 2009
Java SE 6  -  Feb 2013
Java SE 7  -  Jul 2014

Initial help

Before asking a question, use the search box in the upper right corner to see if it has been asked before by others (we have many duplicates), and please read Writing the perfect question to learn how to get Jon Skeet to answer your question.


Background

Java is a high-level, platform-independent, object-oriented programming language originally developed by James Gosling for Sun Microsystems and released in 1995. The Java trademark is currently owned by Oracle, which purchased Sun Microsystems on April 20, 2009.

The main reference implementation of Java is open source (the OpenJDK), which is supported by major companies including Oracle, Apple, SAP and IBM.

Very few computers can run Java programs directly. Therefore the Java environment is normally made available by installing a suitable software component. For Windows computers, this is usually done by downloading the free Java Runtime Environment (JRE) from Oracle which allows the system to run Java programs. The easiest way to do this is from java.com, and on a Macintosh computer, the user is prompted to download Java when an application requiring it is started. In -like system, Java is typically installed via the package manager.

Developers frequently need additional tools which are available in the free Java Development Kit (JDK) alternative to the JRE, which for Windows must be downloaded from Oracle and installed manually.

Java is compiled into bytecode which is interpreted on the JVM by compiling into native code. The compilation is done just-in-time (JIT). Initially this was viewed as a performance hit but with JVM and JIT compilation improvements this has become a lesser concern. Some time the JVM may be faster than native code compiled to target an older version of the processor for backward compatibility reasons.

Note: Other vendors exist, but they usually have license fees. For Linux and other platforms consult the operating system documentation.

More information:

Hello World

public class HelloWorld {
  public static void main(String[] args) {
    System.out.println("Hello, World!");
  }
}

Compilation and invocation of Hello World:

javac -d . HelloWorld.java
java -cp . HelloWorld

Java source code is compiled to an intermediate form (bytecode instructions for the Java Virtual Machine) that can be executed with the java command.

Beginners' resources

Day to day resources

Advanced resources

Free Java Programming Books and Resources

177 questions
12
votes
2 answers

Java .class bytecode debugger

What is the good Java debugger for .class files, if no source code available? jdb is seems pretty weak :( I don't need to decompile .class, but I want to debug bytecode.
Drop Drop
  • 123
  • 1
  • 4
4
votes
1 answer

Determine if exe is written using Java

I'm examining my Windows programs to determine which ones are written in Java, and if so, whether they import a log4j library affected by the log4shell vulnerability. Programs that are packaged as JAR files and use the JVM to run are fairly easy to…
Trent Gm
  • 141
  • 2
3
votes
0 answers

Java Byte Code Debugger

I'm trying to reverse a highly obfuscated program written in java. None of the deobfuscators seem to work so I have been poking at it in eclipse. I can attach to a running process and have figured some of the code out but it appears the part im…
MDK
  • 131
  • 1
2
votes
3 answers

Syntax errors when decompiling with JD-GUI

I am aware that when decompiling a jar file, it is normal for the resulting .java files to contain syntax errors, but I am unsure of why and worse off I am sometimes unsure of how to fix these syntax errors. Take int[] arrayOfInt = new int['€'];,…
DaveTheMinion
  • 191
  • 2
  • 9
2
votes
2 answers

Reversing Engineering ZKM

So I am attempting to reverse engineer a jar obfuscated with Zelix Klass-Master. I have been using JMD, although it crashes whenever it attempts to crack the bytecode, saying "Could not locate control field" and giving me a NullPointerException.…
2
votes
1 answer

difference between two .class files

Could you tell me how to detect difference between (same) .class files? I have a java class compilated with Maven2 on my local computer => works good! I jave the same java class compilated with Maven2 on Apache Continuum => doesn't work! The two…
user1929504
  • 31
  • 1
  • 3
2
votes
1 answer

Does proper/easy editor exist for .class java files?

As you see from the title my problem is editing .class files. I've been trying to compile .java to .class, but no luck! I'm getting strange errors. (Using DJ Java compiler/decompiler). My question is does an easy editor exist for .class files…
Sandro
  • 21
  • 1
1
vote
1 answer

Recover architecture. Open source application

I am attempting to recover the architecture for an open source application (Written in Java). Obviously I have looked at the available documentation but it has not given me the detail that I need to know. I would like to know what would be the best…
MysteryMan
  • 65
  • 5
1
vote
0 answers

Accessing debug log on Java application

I'm currently reverse engineering a JSP applet running through JBoss. Decompiling the code it looks like there are a bunch of Logger.debug() calls in the code that aren't guarded. A quick read through the API and I didn't see where this output…
Fewmitz
  • 1,022
  • 5
  • 16
1
vote
1 answer

Java Malware Dollar Sign

I am analyzing a mobile malware sample and got a trouble. When i put sample in JADX, i see some dollar sign. I mean like this; What does these dollar signs means?
1
vote
0 answers

What tools can be appropriate to reverse engineer a (open-source) java program?

I am very new reverse engineering, and have the below mentioned tasks to achieve on a open source program called Apache Ant. What (preferably free) tools can be appropriate to achieve these. I have been exploring Enterprise Architect for days and it…
Bilal Mirza
  • 111
  • 1
1
vote
1 answer

Going around finding a signature used in a .APK file

So I've decompiled an APK and I believe that I have now is the source code (most with a bunch of random variables and method names, but from what I've read this is completely normal) the app in question uses a signature in the registration request…
Reece
  • 11
  • 1
0
votes
1 answer

What types are read from byte array?

I try to understand what data types are read from a byte array. These methods seem to follow a common pattern: public class Reader { static short readA(byte[] bytes, int i) { int s = ((((short) bytes[i]) & 255) << 8) |…
maiermic
  • 103
  • 2
0
votes
1 answer

Java obfuscated methods and params

Try to decompile several classes from jar and found this public static final boolean \u2005\u200e; and if (\u2005\u200e) { final boolean \u2005\u200e = tEstPrOJEcTDEV7i.\u2005\u200e; } how to convert this names to normal? In byte code…
Lol Kek
  • 3
  • 1
-1
votes
1 answer

How to "follow"Java software executing

I am facing with a software made in Java. This program is a group of jar called in a flow after the first startup.jar There is a way or method to follow executing and know which class is currently running without inject a log class inside all class…
itseeder
  • 319
  • 2
  • 6
  • 13